Пример #1
0
 /**
  * Render the form for setting a quiz' overall grade
  *
  * @param structure $structure the quiz structure.
  * @param \moodle_url $pageurl the canonical URL of this page.
  * @return string HTML to output.
  */
 public function maximum_grade_input($structure, \moodle_url $pageurl)
 {
     $output = '';
     $output .= html_writer::start_div('maxgrade');
     $output .= html_writer::start_tag('form', array('method' => 'post', 'action' => 'edit.php', 'class' => 'quizsavegradesform'));
     $output .= html_writer::start_tag('fieldset', array('class' => 'invisiblefieldset'));
     $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
     $output .= html_writer::input_hidden_params($pageurl);
     $a = html_writer::empty_tag('input', array('type' => 'text', 'id' => 'inputmaxgrade', 'name' => 'maxgrade', 'size' => $structure->get_decimal_places_for_grades() + 2, 'value' => $structure->formatted_quiz_grade()));
     $output .= html_writer::tag('label', get_string('maximumgradex', '', $a), array('for' => 'inputmaxgrade'));
     $output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'savechanges', 'value' => get_string('save', 'quiz')));
     $output .= html_writer::end_tag('fieldset');
     $output .= html_writer::end_tag('form');
     $output .= html_writer::end_tag('div');
     return $output;
 }