original_string: public static function get_non_respondents($feedbackid, $groupid = 0, $sort = 'lastaccess', $page = 0, $perpage = 0,
              $courseid = 0) {
  
          global $CFG;
          require_once($CFG->dirroot . '/mod/feedback/lib.php');
  
          $params = array('feedbackid' => $feedbackid, 'groupid' => $groupid, 'sort' => $sort, 'page' => $page,
              'perpage' => $perpage, 'courseid' => $courseid);
          $params = self::validate_parameters(self::get_non_respondents_parameters(), $params);
          $warnings = $nonrespondents = array();
  
          list($feedback, $course, $cm, $context, $completioncourse) = self::validate_feedback($params['feedbackid'],
              $params['courseid']);
          $feedbackcompletion = new mod_feedback_completion($feedback, $cm, $completioncourse->id);
          $completioncourseid = $feedbackcompletion->get_courseid();
  
          if ($feedback->anonymous != FEEDBACK_ANONYMOUS_NO || $feedback->course == SITEID) {
              throw new moodle_exception('anonymous', 'feedback');
          }
  
          // Check permissions.
          require_capability('mod/feedback:viewreports', $context);
  
          if (!empty($params['groupid'])) {
              $groupid = $params['groupid'];
              // Determine is the group is visible to user.
              if (!groups_group_visible($groupid, $course, $cm)) {
                  throw new moodle_exception('notingroup');
              }
          } else {
              // Check to see if groups are being used here.
              if ($groupmode = groups_get_activity_groupmode($cm)) {
                  $groupid = groups_get_activity_group($cm);
                  // Determine is the group is visible to user (this is particullary for the group 0 -> all groups).
                  if (!groups_group_visible($groupid, $course, $cm)) {
                      throw new moodle_exception('notingroup');
                  }
              } else {
                  $groupid = 0;
              }
          }
  
          if ($params['sort'] !== 'firstname' && $params['sort'] !== 'lastname' && $params['sort'] !== 'lastaccess') {
              throw new invalid_parameter_exception('Invalid sort param, must be firstname, lastname or lastaccess.');
          }
  
          // Check if we are page filtering.
          if ($params['perpage'] == 0) {
              $page = $params['page'];
              $perpage = FEEDBACK_DEFAULT_PAGE_COUNT;
          } else {
              $perpage = $params['perpage'];
              $page = $perpage * $params['page'];
          }
          $users = feedback_get_incomplete_users($cm, $groupid, $params['sort'], $page, $perpage, true);
          foreach ($users as $user) {
              $nonrespondents[] = [
                  'courseid' => $completioncourseid,
                  'userid'   => $user->id,
                  'fullname' => fullname($user),
                  'started'  => $user->feedbackstarted
              ];
          }
  
          $result = array(
              'users' => $nonrespondents,
              'total' => feedback_count_incomplete_users($cm, $groupid),
              'warnings' => $warnings
          );
          return $result;
      }
code: public static function get_non_respondents($feedbackid, $groupid = 0, $sort = 'lastaccess', $page = 0, $perpage = 0,
              $courseid = 0) {
  
          global $CFG;
          require_once($CFG->dirroot . '/mod/feedback/lib.php');
  
          $params = array('feedbackid' => $feedbackid, 'groupid' => $groupid, 'sort' => $sort, 'page' => $page,
              'perpage' => $perpage, 'courseid' => $courseid);
          $params = self::validate_parameters(self::get_non_respondents_parameters(), $params);
          $warnings = $nonrespondents = array();
  
          list($feedback, $course, $cm, $context, $completioncourse) = self::validate_feedback($params['feedbackid'],
              $params['courseid']);
          $feedbackcompletion = new mod_feedback_completion($feedback, $cm, $completioncourse->id);
          $completioncourseid = $feedbackcompletion->get_courseid();
  
          if ($feedback->anonymous != FEEDBACK_ANONYMOUS_NO || $feedback->course == SITEID) {
              throw new moodle_exception('anonymous', 'feedback');
          }
  
          // Check permissions.
          require_capability('mod/feedback:viewreports', $context);
  
          if (!empty($params['groupid'])) {
              $groupid = $params['groupid'];
              // Determine is the group is visible to user.
              if (!groups_group_visible($groupid, $course, $cm)) {
                  throw new moodle_exception('notingroup');
              }
          } else {
              // Check to see if groups are being used here.
              if ($groupmode = groups_get_activity_groupmode($cm)) {
                  $groupid = groups_get_activity_group($cm);
                  // Determine is the group is visible to user (this is particullary for the group 0 -> all groups).
                  if (!groups_group_visible($groupid, $course, $cm)) {
                      throw new moodle_exception('notingroup');
                  }
              } else {
                  $groupid = 0;
              }
          }
  
          if ($params['sort'] !== 'firstname' && $params['sort'] !== 'lastname' && $params['sort'] !== 'lastaccess') {
              throw new invalid_parameter_exception('Invalid sort param, must be firstname, lastname or lastaccess.');
          }
  
          // Check if we are page filtering.
          if ($params['perpage'] == 0) {
              $page = $params['page'];
              $perpage = FEEDBACK_DEFAULT_PAGE_COUNT;
          } else {
              $perpage = $params['perpage'];
              $page = $perpage * $params['page'];
          }
          $users = feedback_get_incomplete_users($cm, $groupid, $params['sort'], $page, $perpage, true);
          foreach ($users as $user) {
              $nonrespondents[] = [
                  'courseid' => $completioncourseid,
                  'userid'   => $user->id,
                  'fullname' => fullname($user),
                  'started'  => $user->feedbackstarted
              ];
          }
  
          $result = array(
              'users' => $nonrespondents,
              'total' => feedback_count_incomplete_users($cm, $groupid),
              'warnings' => $warnings
          );
          return $result;
      }
code_tokens: public static function get_non_respondents ( $ feedbackid , $ groupid = 0 , $ sort = 'lastaccess' , $ page = 0 , $ perpage = 0 , $ courseid = 0 ) { global $ CFG ; require_once ( $ CFG -> dirroot . '/mod/feedback/lib.php' ) ; $ params = array ( 'feedbackid' => $ feedbackid , 'groupid' => $ groupid , 'sort' => $ sort , 'page' => $ page , 'perpage' => $ perpage , 'courseid' => $ courseid ) ; $ params = self :: validate_parameters ( self :: get_non_respondents_parameters ( ) , $ params ) ; $ warnings = $ nonrespondents = array ( ) ; list ( $ feedback , $ course , $ cm , $ context , $ completioncourse ) = self :: validate_feedback ( $ params [ 'feedbackid' ] , $ params [ 'courseid' ] ) ; $ feedbackcompletion = new mod_feedback_completion ( $ feedback , $ cm , $ completioncourse -> id ) ; $ completioncourseid = $ feedbackcompletion -> get_courseid ( ) ; if ( $ feedback -> anonymous != FEEDBACK_ANONYMOUS_NO || $ feedback -> course == SITEID ) { throw new moodle_exception ( 'anonymous' , 'feedback' ) ; } // Check permissions. require_capability ( 'mod/feedback:viewreports' , $ context ) ; if ( ! empty ( $ params [ 'groupid' ] ) ) { $ groupid = $ params [ 'groupid' ] ; // Determine is the group is visible to user. if ( ! groups_group_visible ( $ groupid , $ course , $ cm ) ) { throw new moodle_exception ( 'notingroup' ) ; } } else { // Check to see if groups are being used here. if ( $ groupmode = groups_get_activity_groupmode ( $ cm ) ) { $ groupid = groups_get_activity_group ( $ cm ) ; // Determine is the group is visible to user (this is particullary for the group 0 -> all groups). if ( ! groups_group_visible ( $ groupid , $ course , $ cm ) ) { throw new moodle_exception ( 'notingroup' ) ; } } else { $ groupid = 0 ; } } if ( $ params [ 'sort' ] !== 'firstname' && $ params [ 'sort' ] !== 'lastname' && $ params [ 'sort' ] !== 'lastaccess' ) { throw new invalid_parameter_exception ( 'Invalid sort param, must be firstname, lastname or lastaccess.' ) ; } // Check if we are page filtering. if ( $ params [ 'perpage' ] == 0 ) { $ page = $ params [ 'page' ] ; $ perpage = FEEDBACK_DEFAULT_PAGE_COUNT ; } else { $ perpage = $ params [ 'perpage' ] ; $ page = $ perpage * $ params [ 'page' ] ; } $ users = feedback_get_incomplete_users ( $ cm , $ groupid , $ params [ 'sort' ] , $ page , $ perpage , true ) ; foreach ( $ users as $ user ) { $ nonrespondents [ ] = [ 'courseid' => $ completioncourseid , 'userid' => $ user -> id , 'fullname' => fullname ( $ user ) , 'started' => $ user -> feedbackstarted ] ; } $ result = array ( 'users' => $ nonrespondents , 'total' => feedback_count_incomplete_users ( $ cm , $ groupid ) , 'warnings' => $ warnings ) ; return $ result ; }
docstring: Retrieves a list of students who didn't submit the feedback.
  
  @param int $feedbackid feedback instance id
  @param int $groupid Group id, 0 means that the function will determine the user group'
  @param str $sort sort param, must be firstname, lastname or lastaccess (default)
  @param int $page the page of records to return
  @param int $perpage the number of records to return per page
  @param int $courseid course where user completes the feedback (for site feedbacks only)
  @return array of warnings and users ids
  @since Moodle 3.3
docstring_tokens: Retrieves a list of students who didn t submit the feedback .