original_string: public static function get_feedback_access_information($feedbackid, $courseid = 0) {
          global $PAGE;
  
          $params = array(
              'feedbackid' => $feedbackid,
              'courseid' => $courseid,
          );
          $params = self::validate_parameters(self::get_feedback_access_information_parameters(), $params);
  
          list($feedback, $course, $cm, $context, $completioncourse) = self::validate_feedback($params['feedbackid'],
              $params['courseid']);
          $feedbackcompletion = new mod_feedback_completion($feedback, $cm, $completioncourse->id);
  
          $result = array();
          // Capabilities first.
          $result['canviewanalysis'] = $feedbackcompletion->can_view_analysis();
          $result['cancomplete'] = $feedbackcompletion->can_complete();
          $result['cansubmit'] = $feedbackcompletion->can_submit();
          $result['candeletesubmissions'] = has_capability('mod/feedback:deletesubmissions', $context);
          $result['canviewreports'] = has_capability('mod/feedback:viewreports', $context);
          $result['canedititems'] = has_capability('mod/feedback:edititems', $context);
  
          // Status information.
          $result['isempty'] = $feedbackcompletion->is_empty();
          $result['isopen'] = $feedbackcompletion->is_open();
          $anycourse = ($course->id == SITEID);
          $result['isalreadysubmitted'] = $feedbackcompletion->is_already_submitted($anycourse);
          $result['isanonymous'] = $feedbackcompletion->is_anonymous();
  
          $result['warnings'] = [];
          return $result;
      }
code: public static function get_feedback_access_information($feedbackid, $courseid = 0) {
          global $PAGE;
  
          $params = array(
              'feedbackid' => $feedbackid,
              'courseid' => $courseid,
          );
          $params = self::validate_parameters(self::get_feedback_access_information_parameters(), $params);
  
          list($feedback, $course, $cm, $context, $completioncourse) = self::validate_feedback($params['feedbackid'],
              $params['courseid']);
          $feedbackcompletion = new mod_feedback_completion($feedback, $cm, $completioncourse->id);
  
          $result = array();
          // Capabilities first.
          $result['canviewanalysis'] = $feedbackcompletion->can_view_analysis();
          $result['cancomplete'] = $feedbackcompletion->can_complete();
          $result['cansubmit'] = $feedbackcompletion->can_submit();
          $result['candeletesubmissions'] = has_capability('mod/feedback:deletesubmissions', $context);
          $result['canviewreports'] = has_capability('mod/feedback:viewreports', $context);
          $result['canedititems'] = has_capability('mod/feedback:edititems', $context);
  
          // Status information.
          $result['isempty'] = $feedbackcompletion->is_empty();
          $result['isopen'] = $feedbackcompletion->is_open();
          $anycourse = ($course->id == SITEID);
          $result['isalreadysubmitted'] = $feedbackcompletion->is_already_submitted($anycourse);
          $result['isanonymous'] = $feedbackcompletion->is_anonymous();
  
          $result['warnings'] = [];
          return $result;
      }
code_tokens: public static function get_feedback_access_information ( $ feedbackid , $ courseid = 0 ) { global $ PAGE ; $ params = array ( 'feedbackid' => $ feedbackid , 'courseid' => $ courseid , ) ; $ params = self :: validate_parameters ( self :: get_feedback_access_information_parameters ( ) , $ params ) ; list ( $ feedback , $ course , $ cm , $ context , $ completioncourse ) = self :: validate_feedback ( $ params [ 'feedbackid' ] , $ params [ 'courseid' ] ) ; $ feedbackcompletion = new mod_feedback_completion ( $ feedback , $ cm , $ completioncourse -> id ) ; $ result = array ( ) ; // Capabilities first. $ result [ 'canviewanalysis' ] = $ feedbackcompletion -> can_view_analysis ( ) ; $ result [ 'cancomplete' ] = $ feedbackcompletion -> can_complete ( ) ; $ result [ 'cansubmit' ] = $ feedbackcompletion -> can_submit ( ) ; $ result [ 'candeletesubmissions' ] = has_capability ( 'mod/feedback:deletesubmissions' , $ context ) ; $ result [ 'canviewreports' ] = has_capability ( 'mod/feedback:viewreports' , $ context ) ; $ result [ 'canedititems' ] = has_capability ( 'mod/feedback:edititems' , $ context ) ; // Status information. $ result [ 'isempty' ] = $ feedbackcompletion -> is_empty ( ) ; $ result [ 'isopen' ] = $ feedbackcompletion -> is_open ( ) ; $ anycourse = ( $ course -> id == SITEID ) ; $ result [ 'isalreadysubmitted' ] = $ feedbackcompletion -> is_already_submitted ( $ anycourse ) ; $ result [ 'isanonymous' ] = $ feedbackcompletion -> is_anonymous ( ) ; $ result [ 'warnings' ] = [ ] ; return $ result ; }
docstring: Return access information for a given feedback.
  
  @param int $feedbackid feedback instance id
  @param int $courseid course where user completes the feedback (for site feedbacks only)
  @return array of warnings and the access information
  @since Moodle 3.3
  @throws  moodle_exception
docstring_tokens: Return access information for a given feedback .