From 9182889ff90c23d0adcb0dde1fe75fdf007121c8 Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Wed, 6 Jul 2005 07:32:59 +0000 Subject: [PATCH] In the past questions on the right hand side of the editing screen were previewed with the default settings whereas those on the left hand side were previewed with the quiz settings. That did create confusion among users so now questions will always be previewed with the quiz settings. --- mod/quiz/edit.php | 2 +- mod/quiz/editlib.php | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mod/quiz/edit.php b/mod/quiz/edit.php index 61c60204667..97fdf09a01a 100644 --- a/mod/quiz/edit.php +++ b/mod/quiz/edit.php @@ -472,7 +472,7 @@ if (self.name == 'editquestion') { // continues with list of questions print_simple_box_start("center", "100%"); quiz_print_cat_question_list($course, $modform->category, - isset($modform->instance), $SESSION->quiz_recurse, $page, $perpage, $SESSION->quiz_showhidden); + isset($modform->instance) ? $modform->instance : 0, $SESSION->quiz_recurse, $page, $perpage, $SESSION->quiz_showhidden); print_simple_box_end(); if (!isset($modform->instance)) { print_continue("index.php?id=$modform->course"); diff --git a/mod/quiz/editlib.php b/mod/quiz/editlib.php index 20d18b94373..0978ea1e370 100644 --- a/mod/quiz/editlib.php +++ b/mod/quiz/editlib.php @@ -430,13 +430,13 @@ function quiz_print_category_form($course, $current, $recurse=1, $showhidden=fal * * @param object $course The course object * @param int $categoryid The id of the question category to be displayed -* @param boolean $quizselected True if we are in the context of a particular quiz +* @param int $quizid The quiz id if we are in the context of a particular quiz, 0 otherwise * @param int $recurse This is 1 if subcategories should be included, 0 otherwise * @param int $page The number of the page to be displayed * @param int $perpage Number of questions to show per page * @param boolean $showhidden True if also hidden questions should be displayed */ -function quiz_print_cat_question_list($course, $categoryid, $quizselected=true, +function quiz_print_cat_question_list($course, $categoryid, $quizid, $recurse=1, $page, $perpage, $showhidden=false) { global $QUIZ_QUESTION_TYPE, $USER; @@ -465,7 +465,7 @@ function quiz_print_cat_question_list($course, $categoryid, $quizselected=true, echo "

"; print_string("selectcategoryabove", "quiz"); echo "

"; - if ($quizselected) { + if ($quizid) { echo "

"; print_string("addingquestions", "quiz"); echo "

"; @@ -558,11 +558,11 @@ function quiz_print_cat_question_list($course, $categoryid, $quizselected=true, echo "\n"; if ($canedit) { echo "\n"; - if ($quizselected) { + if ($quizid) { echo "id&sesskey=$USER->sesskey\">\"$straddtoquiz\" "; } - echo "id','$strpreview','scrollbars=yes,resizable=yes,width=700,height=480', false)\">id&quizid=$quizid','$strpreview','scrollbars=yes,resizable=yes,width=700,height=480', false)\">\"$strpreview\" "; echo "id\">\"$stredit\" "; @@ -596,7 +596,7 @@ function quiz_print_cat_question_list($course, $categoryid, $quizselected=true, echo ''.$strselectall.' /'. ' '.$strselectnone.''. ''.get_string('withselected', 'quiz').':'; - if ($quizselected) { + if ($quizid) { echo "\n"; echo ''; } @@ -605,7 +605,7 @@ function quiz_print_cat_question_list($course, $categoryid, $quizselected=true, quiz_category_select_menu($course->id, false, true, $category->id); echo ""; - if ($quizselected) { + if ($quizid) { for ($i=1;$i<=10; $i++) { $randomcount[$i] = $i; }