/**
  * Displays one grading instance
  *
  * @param gradingform_rubric_instance $instance
  * @param int $idx unique number of instance on page
  * @param bool $cangrade whether current user has capability to grade in this context
  */
 public function display_instance(gradingform_rubric_instance $instance, $idx, $cangrade)
 {
     $criteria = $instance->get_controller()->get_definition()->rubric_criteria;
     $options = $instance->get_controller()->get_options();
     $values = $instance->get_rubric_filling();
     if ($cangrade) {
         $mode = gradingform_rubric_controller::DISPLAY_REVIEW;
         $showdescription = $options['showdescriptionteacher'];
     } else {
         $mode = gradingform_rubric_controller::DISPLAY_VIEW;
         $showdescription = $options['showdescriptionstudent'];
     }
     $output = '';
     if ($showdescription) {
         $output .= $this->box($instance->get_controller()->get_formatted_description(), 'gradingform_rubric-description');
     }
     $output .= $this->display_rubric($criteria, $options, $mode, 'rubric' . $idx, $values);
     return $output;
 }
Esempio n. 2
0
 /**
  * Displays one grading instance
  *
  * @param gradingform_rubric_instance $instance
  * @param int idx unique number of instance on page
  * @param boolean $cangrade whether current user has capability to grade in this context
  */
 public function display_instance(gradingform_rubric_instance $instance, $idx, $cangrade)
 {
     $criteria = $instance->get_controller()->get_definition()->rubric_criteria;
     $options = $instance->get_controller()->get_options();
     $values = $instance->get_rubric_filling();
     if ($cangrade) {
         $mode = gradingform_rubric_controller::DISPLAY_REVIEW;
     } else {
         $mode = gradingform_rubric_controller::DISPLAY_VIEW;
     }
     return $this->display_rubric($criteria, $options, $mode, 'rubric' . $idx, $values);
 }