Permalink
Browse files

MDL-27631 question bank Show question text in the question list when …

…top level category is used
  • Loading branch information...
1 parent 58609af commit 3388d2f9f94bb22a7b0f8fc86fe29aa07c7bc12d @mkassaei mkassaei committed with timhunt Aug 5, 2011
Showing with 16 additions and 12 deletions.
  1. +9 −5 mod/quiz/editlib.php
  2. +7 −7 question/editlib.php
View
@@ -1118,13 +1118,17 @@ protected function print_category_info($category) {
echo '</span></div></div>';
}
- protected function display_options($recurse = 1, $showhidden = false, $showquestiontext = false) {
+ protected function display_options($recurse, $showhidden, $showquestiontext) {
echo '<form method="get" action="edit.php" id="displayoptions">';
echo "<fieldset class='invisiblefieldset'>";
- echo html_writer::input_hidden_params($this->baseurl, array('recurse', 'showhidden', 'showquestiontext'));
- $this->display_category_form_checkbox('recurse', get_string('recurse', 'quiz'));
- $this->display_category_form_checkbox('showhidden', get_string('showhidden', 'quiz'));
- echo '<noscript><div class="centerpara"><input type="submit" value="'. get_string('go') . '" />';
+ echo html_writer::input_hidden_params($this->baseurl,
+ array('recurse', 'showhidden', 'showquestiontext'));
+ $this->display_category_form_checkbox('recurse', $recurse,
+ get_string('recurse', 'quiz'));
+ $this->display_category_form_checkbox('showhidden', $showhidden,
+ get_string('showhidden', 'quiz'));
+ echo '<noscript><div class="centerpara"><input type="submit" value="' .
+ get_string('go') . '" />';
echo '</div></noscript></fieldset></form>';
}
}
View
@@ -1181,24 +1181,24 @@ protected function display_category_form($contexts, $pageurl, $current) {
echo "</div>\n";
}
- protected function display_options($recurse = 1, $showhidden = false, $showquestiontext = false) {
+ protected function display_options($recurse, $showhidden, $showquestiontext) {
echo '<form method="get" action="edit.php" id="displayoptions">';
echo "<fieldset class='invisiblefieldset'>";
- echo html_writer::input_hidden_params($this->baseurl, array('recurse', 'showhidden', 'showquestiontext'));
- $this->display_category_form_checkbox('recurse', get_string('recurse', 'quiz'));
- $this->display_category_form_checkbox('showhidden', get_string('showhidden', 'quiz'));
- $this->display_category_form_checkbox('qbshowtext', get_string('showquestiontext', 'quiz'));
+ echo html_writer::input_hidden_params($this->baseurl, array('recurse', 'showhidden', 'qbshowtext'));
+ $this->display_category_form_checkbox('recurse', $recurse, get_string('recurse', 'quiz'));
+ $this->display_category_form_checkbox('showhidden', $showhidden, get_string('showhidden', 'quiz'));
+ $this->display_category_form_checkbox('qbshowtext', $showquestiontext, get_string('showquestiontext', 'quiz'));
echo '<noscript><div class="centerpara"><input type="submit" value="'. get_string('go') .'" />';
echo '</div></noscript></fieldset></form>';
}
/**
* Print a single option checkbox. Used by the preceeding.
*/
- protected function display_category_form_checkbox($name, $label) {
+ protected function display_category_form_checkbox($name, $value, $label) {
echo '<div><input type="hidden" id="' . $name . '_off" name="' . $name . '" value="0" />';
echo '<input type="checkbox" id="' . $name . '_on" name="' . $name . '" value="1"';
- if (optional_param($name, false, PARAM_BOOL)) {
+ if ($value) {
echo ' checked="checked"';
}
echo ' onchange="getElementById(\'displayoptions\').submit(); return true;" />';

0 comments on commit 3388d2f

Please sign in to comment.