original_string: public function col_allocatedmarker(stdClass $row) {
          static $markers = null;
          static $markerlist = array();
          if ($markers === null) {
              list($sort, $params) = users_order_by_sql('u');
              // Only enrolled users could be assigned as potential markers.
              $markers = get_enrolled_users($this->assignment->get_context(), 'mod/assign:grade', 0, 'u.*', $sort);
              $markerlist[0] = get_string('choosemarker', 'assign');
              $viewfullnames = has_capability('moodle/site:viewfullnames', $this->assignment->get_context());
              foreach ($markers as $marker) {
                  $markerlist[$marker->id] = fullname($marker, $viewfullnames);
              }
          }
          if (empty($markerlist)) {
              // TODO: add some form of notification here that no markers are available.
              return '';
          }
          if ($this->is_downloading()) {
              if (isset($markers[$row->allocatedmarker])) {
                  return fullname($markers[$row->allocatedmarker],
                          has_capability('moodle/site:viewfullnames', $this->assignment->get_context()));
              } else {
                  return '';
              }
          }
  
          if ($this->quickgrading && has_capability('mod/assign:manageallocations', $this->assignment->get_context()) &&
              (empty($row->workflowstate) ||
               $row->workflowstate == ASSIGN_MARKING_WORKFLOW_STATE_INMARKING ||
               $row->workflowstate == ASSIGN_MARKING_WORKFLOW_STATE_NOTMARKED)) {
  
              $name = 'quickgrade_' . $row->id . '_allocatedmarker';
              return  html_writer::select($markerlist, $name, $row->allocatedmarker, false);
          } else if (!empty($row->allocatedmarker)) {
              $output = '';
              if ($this->quickgrading) { // Add hidden field for quickgrading page.
                  $name = 'quickgrade_' . $row->id . '_allocatedmarker';
                  $attributes = ['type' => 'hidden', 'name' => $name, 'value' => $row->allocatedmarker];
                  $output .= html_writer::empty_tag('input', $attributes);
              }
              $output .= $markerlist[$row->allocatedmarker];
              return $output;
          }
      }
code: public function col_allocatedmarker(stdClass $row) {
          static $markers = null;
          static $markerlist = array();
          if ($markers === null) {
              list($sort, $params) = users_order_by_sql('u');
              // Only enrolled users could be assigned as potential markers.
              $markers = get_enrolled_users($this->assignment->get_context(), 'mod/assign:grade', 0, 'u.*', $sort);
              $markerlist[0] = get_string('choosemarker', 'assign');
              $viewfullnames = has_capability('moodle/site:viewfullnames', $this->assignment->get_context());
              foreach ($markers as $marker) {
                  $markerlist[$marker->id] = fullname($marker, $viewfullnames);
              }
          }
          if (empty($markerlist)) {
              // TODO: add some form of notification here that no markers are available.
              return '';
          }
          if ($this->is_downloading()) {
              if (isset($markers[$row->allocatedmarker])) {
                  return fullname($markers[$row->allocatedmarker],
                          has_capability('moodle/site:viewfullnames', $this->assignment->get_context()));
              } else {
                  return '';
              }
          }
  
          if ($this->quickgrading && has_capability('mod/assign:manageallocations', $this->assignment->get_context()) &&
              (empty($row->workflowstate) ||
               $row->workflowstate == ASSIGN_MARKING_WORKFLOW_STATE_INMARKING ||
               $row->workflowstate == ASSIGN_MARKING_WORKFLOW_STATE_NOTMARKED)) {
  
              $name = 'quickgrade_' . $row->id . '_allocatedmarker';
              return  html_writer::select($markerlist, $name, $row->allocatedmarker, false);
          } else if (!empty($row->allocatedmarker)) {
              $output = '';
              if ($this->quickgrading) { // Add hidden field for quickgrading page.
                  $name = 'quickgrade_' . $row->id . '_allocatedmarker';
                  $attributes = ['type' => 'hidden', 'name' => $name, 'value' => $row->allocatedmarker];
                  $output .= html_writer::empty_tag('input', $attributes);
              }
              $output .= $markerlist[$row->allocatedmarker];
              return $output;
          }
      }
code_tokens: public function col_allocatedmarker ( stdClass $ row ) { static $ markers = null ; static $ markerlist = array ( ) ; if ( $ markers === null ) { list ( $ sort , $ params ) = users_order_by_sql ( 'u' ) ; // Only enrolled users could be assigned as potential markers. $ markers = get_enrolled_users ( $ this -> assignment -> get_context ( ) , 'mod/assign:grade' , 0 , 'u.*' , $ sort ) ; $ markerlist [ 0 ] = get_string ( 'choosemarker' , 'assign' ) ; $ viewfullnames = has_capability ( 'moodle/site:viewfullnames' , $ this -> assignment -> get_context ( ) ) ; foreach ( $ markers as $ marker ) { $ markerlist [ $ marker -> id ] = fullname ( $ marker , $ viewfullnames ) ; } } if ( empty ( $ markerlist ) ) { // TODO: add some form of notification here that no markers are available. return '' ; } if ( $ this -> is_downloading ( ) ) { if ( isset ( $ markers [ $ row -> allocatedmarker ] ) ) { return fullname ( $ markers [ $ row -> allocatedmarker ] , has_capability ( 'moodle/site:viewfullnames' , $ this -> assignment -> get_context ( ) ) ) ; } else { return '' ; } } if ( $ this -> quickgrading && has_capability ( 'mod/assign:manageallocations' , $ this -> assignment -> get_context ( ) ) && ( empty ( $ row -> workflowstate ) || $ row -> workflowstate == ASSIGN_MARKING_WORKFLOW_STATE_INMARKING || $ row -> workflowstate == ASSIGN_MARKING_WORKFLOW_STATE_NOTMARKED ) ) { $ name = 'quickgrade_' . $ row -> id . '_allocatedmarker' ; return html_writer :: select ( $ markerlist , $ name , $ row -> allocatedmarker , false ) ; } else if ( ! empty ( $ row -> allocatedmarker ) ) { $ output = '' ; if ( $ this -> quickgrading ) { // Add hidden field for quickgrading page. $ name = 'quickgrade_' . $ row -> id . '_allocatedmarker' ; $ attributes = [ 'type' => 'hidden' , 'name' => $ name , 'value' => $ row -> allocatedmarker ] ; $ output .= html_writer :: empty_tag ( 'input' , $ attributes ) ; } $ output .= $ markerlist [ $ row -> allocatedmarker ] ; return $ output ; } }
docstring: list current marker
  
  @param stdClass $row - The row of data
  @return id the user->id of the marker.
docstring_tokens: list current marker