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 3fdc622 commit 92e6e128ff76ee6677c6c5724a9d451587658af0 @mkassaei mkassaei committed Aug 5, 2011
Showing with 9 additions and 10 deletions.
  1. +3 −4 mod/quiz/editlib.php
  2. +6 −6 question/editlib.php
@@ -1183,15 +1183,14 @@ 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',
+ $this->display_category_form_checkbox('recurse', $recurse,
get_string('includesubcategories', 'question'));
- $this->display_category_form_checkbox('showhidden',
+ $this->display_category_form_checkbox('showhidden', $showhidden,
get_string('showhidden', 'question'));
echo '<noscript><div class="centerpara"><input type="submit" value="' .
get_string('go') . '" />';
View
@@ -1246,24 +1246,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('includesubcategories', 'question'));
- $this->display_category_form_checkbox('showhidden', get_string('showhidden', 'question'));
- $this->display_category_form_checkbox('qbshowtext', get_string('showquestiontext', 'question'));
+ $this->display_category_form_checkbox('recurse', $recurse, get_string('includesubcategories', 'question'));
+ $this->display_category_form_checkbox('showhidden', $showhidden, get_string('showhidden', 'question'));
+ $this->display_category_form_checkbox('qbshowtext', $showquestiontext, get_string('showquestiontext', 'question'));
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 92e6e12

Please sign in to comment.