original_string: public function get_user_list() {
          global $CFG, $SITE;
  
          $courseid = $SITE->id;
          if (!empty($this->course)) {
              $courseid = $this->course->id;
          }
          $context = context_course::instance($courseid);
          $limitfrom = empty($this->showusers) ? 0 : '';
          $limitnum  = empty($this->showusers) ? COURSE_MAX_USERS_PER_DROPDOWN + 1 : '';
          $courseusers = get_enrolled_users($context, '', $this->groupid, 'u.id, ' . get_all_user_name_fields(true, 'u'),
                  null, $limitfrom, $limitnum);
  
          if (count($courseusers) < COURSE_MAX_USERS_PER_DROPDOWN && !$this->showusers) {
              $this->showusers = 1;
          }
  
          $users = array();
          if ($this->showusers) {
              if ($courseusers) {
                  foreach ($courseusers as $courseuser) {
                       $users[$courseuser->id] = fullname($courseuser, has_capability('moodle/site:viewfullnames', $context));
                  }
              }
              $users[$CFG->siteguest] = get_string('guestuser');
          }
          return $users;
      }
code: public function get_user_list() {
          global $CFG, $SITE;
  
          $courseid = $SITE->id;
          if (!empty($this->course)) {
              $courseid = $this->course->id;
          }
          $context = context_course::instance($courseid);
          $limitfrom = empty($this->showusers) ? 0 : '';
          $limitnum  = empty($this->showusers) ? COURSE_MAX_USERS_PER_DROPDOWN + 1 : '';
          $courseusers = get_enrolled_users($context, '', $this->groupid, 'u.id, ' . get_all_user_name_fields(true, 'u'),
                  null, $limitfrom, $limitnum);
  
          if (count($courseusers) < COURSE_MAX_USERS_PER_DROPDOWN && !$this->showusers) {
              $this->showusers = 1;
          }
  
          $users = array();
          if ($this->showusers) {
              if ($courseusers) {
                  foreach ($courseusers as $courseuser) {
                       $users[$courseuser->id] = fullname($courseuser, has_capability('moodle/site:viewfullnames', $context));
                  }
              }
              $users[$CFG->siteguest] = get_string('guestuser');
          }
          return $users;
      }
code_tokens: public function get_user_list ( ) { global $ CFG , $ SITE ; $ courseid = $ SITE -> id ; if ( ! empty ( $ this -> course ) ) { $ courseid = $ this -> course -> id ; } $ context = context_course :: instance ( $ courseid ) ; $ limitfrom = empty ( $ this -> showusers ) ? 0 : '' ; $ limitnum = empty ( $ this -> showusers ) ? COURSE_MAX_USERS_PER_DROPDOWN + 1 : '' ; $ courseusers = get_enrolled_users ( $ context , '' , $ this -> groupid , 'u.id, ' . get_all_user_name_fields ( true , 'u' ) , null , $ limitfrom , $ limitnum ) ; if ( count ( $ courseusers ) < COURSE_MAX_USERS_PER_DROPDOWN && ! $ this -> showusers ) { $ this -> showusers = 1 ; } $ users = array ( ) ; if ( $ this -> showusers ) { if ( $ courseusers ) { foreach ( $ courseusers as $ courseuser ) { $ users [ $ courseuser -> id ] = fullname ( $ courseuser , has_capability ( 'moodle/site:viewfullnames' , $ context ) ) ; } } $ users [ $ CFG -> siteguest ] = get_string ( 'guestuser' ) ; } return $ users ; }
docstring: Return list of users.
  
  @return array list of users.
docstring_tokens: Return list of users .