MDL-46163 quiz/questions: fix missing hidden fields.

I have done this by eliminating the duplication between the base class
and the subclass.

This was a regression introdcued by MDL-40313.
This commit is contained in:
Tim Hunt
2014-07-02 14:32:53 +01:00
committed by Dan Poltawski
parent 9cafb3433f
commit 84deaaf8bb
2 changed files with 18 additions and 25 deletions
+4 -19
View File
@@ -1230,25 +1230,10 @@ class quiz_question_bank_view extends core_question\bank\view {
echo $OUTPUT->box_end();
}
/**
* Display the form with options for which questions are displayed and how they are displayed.
* This differs from parent display_options_form only in that it does not have the checkbox to show the question text.
* @param bool $showquestiontext Display the text of the question within the list. (Currently ignored)
*/
protected function display_options_form($showquestiontext) {
global $PAGE;
echo html_writer::start_tag('form', array('method' => 'get',
'action' => new moodle_url('/mod/quiz/edit.php'), 'id' => 'displayoptions'));
echo html_writer::start_div();
foreach ($this->searchconditions as $searchcondition) {
echo $searchcondition->display_options($this);
}
$this->display_advanced_search_form();
$go = html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('go')));
echo html_writer::tag('noscript', html_writer::tag('div', $go), array('class' => 'inline'));
echo html_writer::end_div();
echo html_writer::end_tag('form');
$PAGE->requires->yui_module('moodle-question-searchform', 'M.question.searchform.init');
protected function display_options_form($showquestiontext, $scriptpath = '/mod/quiz/edit.php',
$showtextoption = false) {
// Overridden just to change the default values of the arguments.
parent::display_options_form($showquestiontext, $scriptpath, $showtextoption);
}
protected function print_category_info($category) {
+14 -6
View File
@@ -582,22 +582,30 @@ class view {
/**
* Display the form with options for which questions are displayed and how they are displayed.
* @param bool $showquestiontext Display the text of the question within the list.
* @param string $path path to the script displaying this page.
* @param bool $showtextoption whether to include the 'Show question text' checkbox.
*/
protected function display_options_form($showquestiontext) {
protected function display_options_form($showquestiontext, $scriptpath = '/question/edit.php',
$showtextoption = true) {
global $PAGE;
echo '<form method="get" action="edit.php" id="displayoptions">';
echo "<fieldset class='invisiblefieldset'>";
echo \html_writer::start_tag('form', array('method' => 'get',
'action' => new \moodle_url($scriptpath), 'id' => 'displayoptions'));
echo \html_writer::start_div();
echo \html_writer::input_hidden_params($this->baseurl, array('recurse', 'showhidden', 'qbshowtext'));
foreach ($this->searchconditions as $searchcondition) {
echo $searchcondition->display_options($this);
}
$this->display_showtext_checkbox($showquestiontext);
if ($showtextoption) {
$this->display_showtext_checkbox($showquestiontext);
}
$this->display_advanced_search_form();
$go = \html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('go')));
echo \html_writer::tag('noscript', \html_writer::div($go), array('class' => 'inline'));
echo \html_writer::end_div();
echo \html_writer::end_tag('form');
$PAGE->requires->yui_module('moodle-question-searchform', 'M.question.searchform.init');
echo '<noscript><div class="centerpara"><input type="submit" value="'. get_string('go') .'" />';
echo '</div></noscript></fieldset></form>';
}
/**