Permalink
Browse files

Merge branch 'MDL-29141_20' of git://github.com/timhunt/moodle into M…

…OODLE_20_STABLE
  • Loading branch information...
2 parents 081d164 + 1179c92 commit b7424c7693e121c142f6bc0a6457aadd7a243bdc @stronk7 stronk7 committed Aug 29, 2011
Showing with 22 additions and 18 deletions.
  1. +1 −1 mod/quiz/edit.php
  2. +9 −5 mod/quiz/editlib.php
  3. +1 −1 question/edit.php
  4. +11 −11 question/editlib.php
View
2 mod/quiz/edit.php
@@ -428,7 +428,7 @@ function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmo
$pagevars['qpage'],
$pagevars['qperpage'],
$pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'],
- $pagevars['showquestiontext']);
+ $pagevars['qbshowtext']);
echo '</div>';
echo '</div>';
echo '</div>';
View
14 mod/quiz/editlib.php
@@ -1120,13 +1120,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', 'qbshowtext'));
+ $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
2 question/edit.php
@@ -73,7 +73,7 @@
echo '<div class="questionbankwindow boxwidthwide boxaligncenter">';
$questionbank->display('questions', $pagevars['qpage'], $pagevars['qperpage'],
$pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'],
- $pagevars['showquestiontext']);
+ $pagevars['qbshowtext']);
echo "</div>\n";
echo $OUTPUT->footer();
View
22 question/editlib.php
@@ -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;" />';
@@ -1615,11 +1615,11 @@ function question_edit_setup($edittab, $baseurl, $requirecmid = false, $requirec
$pagevars['showhidden'] = 0;
}
- if(($showquestiontext = optional_param('showquestiontext', -1, PARAM_BOOL)) != -1) {
- $pagevars['showquestiontext'] = $showquestiontext;
- $thispageurl->param('showquestiontext', $showquestiontext);
+ if(($showquestiontext = optional_param('qbshowtext', -1, PARAM_BOOL)) != -1) {
+ $pagevars['qbshowtext'] = $showquestiontext;
+ $thispageurl->param('qbshowtext', $showquestiontext);
} else {
- $pagevars['showquestiontext'] = 0;
+ $pagevars['qbshowtext'] = 0;
}
//category list page

0 comments on commit b7424c7

Please sign in to comment.