Skip to content

Commit

Permalink
MDL-27631 question bank Show question text in the question list when …
Browse files Browse the repository at this point in the history
…top level category is used
  • Loading branch information
mkassaei authored and timhunt committed Aug 26, 2011
1 parent 58609af commit 3388d2f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
14 changes: 9 additions & 5 deletions mod/quiz/editlib.php
Expand Up @@ -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>';
}
}
Expand Down
14 changes: 7 additions & 7 deletions question/editlib.php
Expand Up @@ -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;" />';
Expand Down

0 comments on commit 3388d2f

Please sign in to comment.