예제 #1
0
 /**
  * Display the 'marked out of' information for a question.
  * Along with the regrade action.
  * @param structure $structure object containing the structure of the quiz.
  * @param int $slot which slot we are outputting.
  * @return string HTML to output.
  */
 public function marked_out_of_field(structure $structure, $slot)
 {
     if (!$structure->is_real_question($slot)) {
         $output = html_writer::span('', 'instancemaxmark decimalplaces_' . $structure->get_decimal_places_for_question_marks());
         $output .= html_writer::span($this->pix_icon('spacer', '', 'moodle', array('class' => 'editicon visibleifjs', 'title' => '')), 'editing_maxmark');
         return html_writer::span($output, 'instancemaxmarkcontainer infoitem');
     }
     $output = html_writer::span($structure->formatted_question_grade($slot), 'instancemaxmark decimalplaces_' . $structure->get_decimal_places_for_question_marks(), array('title' => get_string('maxmark', 'quiz')));
     $output .= html_writer::span(html_writer::link(new \moodle_url('#'), $this->pix_icon('t/editstring', '', 'moodle', array('class' => 'editicon visibleifjs', 'title' => '')), array('class' => 'editing_maxmark', 'data-action' => 'editmaxmark', 'title' => get_string('editmaxmark', 'quiz'))));
     return html_writer::span($output, 'instancemaxmarkcontainer');
 }