コード例 #1
0
 /**
  * list current marking workflow state
  *
  * @param stdClass $row
  * @return string
  */
 public function col_workflowstatus(stdClass $row)
 {
     $o = '';
     $gradingdisabled = $this->setaskment->grading_disabled($row->id);
     // The function in the setaskment keeps a static cache of this list of states.
     $workflowstates = $this->setaskment->get_marking_workflow_states_for_current_user();
     $workflowstate = $row->workflowstate;
     if (empty($workflowstate)) {
         $workflowstate = ASSIGN_MARKING_WORKFLOW_STATE_NOTMARKED;
     }
     if ($this->quickgrading && !$gradingdisabled) {
         $notmarked = get_string('markingworkflowstatenotmarked', 'setask');
         $name = 'quickgrade_' . $row->id . '_workflowstate';
         $o .= html_writer::select($workflowstates, $name, $workflowstate, array('' => $notmarked));
         // Check if this user is a marker that can't manage allocations and doesn't have the marker column added.
         if ($this->setaskment->get_instance()->markingworkflow && $this->setaskment->get_instance()->markingallocation && !has_capability('mod/setask:manageallocations', $this->setaskment->get_context())) {
             $name = 'quickgrade_' . $row->id . '_allocatedmarker';
             $o .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => $name, 'value' => $row->allocatedmarker));
         }
     } else {
         $o .= $this->output->container(get_string('markingworkflowstate' . $workflowstate, 'setask'), $workflowstate);
     }
     return $o;
 }