/** * Return the repaginate form * @param structure $structure the structure of the quiz being edited. * @param \moodle_url $pageurl the canonical URL of this page. * @return string HTML to output. */ protected function repaginate_form(structure $structure, \moodle_url $pageurl) { $perpage = array(); $perpage[0] = get_string('allinone', 'quiz'); for ($i = 1; $i <= 50; ++$i) { $perpage[$i] = $i; } $hiddenurl = clone $pageurl; $hiddenurl->param('sesskey', sesskey()); $select = html_writer::select($perpage, 'questionsperpage', $structure->get_questions_per_page(), false); $buttonattributes = array('type' => 'submit', 'name' => 'repaginate', 'value' => get_string('go')); $formcontent = html_writer::tag('form', html_writer::div(html_writer::input_hidden_params($hiddenurl) . get_string('repaginate', 'quiz', $select) . html_writer::empty_tag('input', $buttonattributes)), array('action' => 'edit.php', 'method' => 'post')); return html_writer::div($formcontent, '', array('id' => 'repaginatedialog')); }