original_string: public function get_participant($userid) {
          global $DB, $USER;
  
          if ($userid == $USER->id) {
              $participant = clone ($USER);
          } else {
              $participant = $DB->get_record('user', array('id' => $userid));
          }
          if (!$participant) {
              return null;
          }
  
          if (!is_enrolled($this->context, $participant, 'mod/assign:submit', $this->show_only_active_users())) {
              return null;
          }
  
          $result = $this->get_submission_info_for_participants(array($participant->id => $participant));
          return $result[$participant->id];
      }
code: public function get_participant($userid) {
          global $DB, $USER;
  
          if ($userid == $USER->id) {
              $participant = clone ($USER);
          } else {
              $participant = $DB->get_record('user', array('id' => $userid));
          }
          if (!$participant) {
              return null;
          }
  
          if (!is_enrolled($this->context, $participant, 'mod/assign:submit', $this->show_only_active_users())) {
              return null;
          }
  
          $result = $this->get_submission_info_for_participants(array($participant->id => $participant));
          return $result[$participant->id];
      }
code_tokens: public function get_participant ( $ userid ) { global $ DB , $ USER ; if ( $ userid == $ USER -> id ) { $ participant = clone ( $ USER ) ; } else { $ participant = $ DB -> get_record ( 'user' , array ( 'id' => $ userid ) ) ; } if ( ! $ participant ) { return null ; } if ( ! is_enrolled ( $ this -> context , $ participant , 'mod/assign:submit' , $ this -> show_only_active_users ( ) ) ) { return null ; } $ result = $ this -> get_submission_info_for_participants ( array ( $ participant -> id => $ participant ) ) ; return $ result [ $ participant -> id ] ; }
docstring: Load a user if they are enrolled in the current course. Populated with submission
  status for this assignment.
  
  @param int $userid
  @return null|stdClass user record
docstring_tokens: Load a user if they are enrolled in the current course . Populated with submission status for this assignment .