From d288fa5255edf0c574c88c051acb9185dac1e51e Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 14 May 2003 16:52:25 +0000 Subject: [PATCH] Better code to deal with shuffleorder. Now feedback is always in the same order as the quiz, and reports are always in the natural order. --- mod/quiz/lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index 0e2a03ad67a..0169bf566cb 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -716,11 +716,13 @@ function quiz_print_quiz_questions($quiz, $results=NULL, $questions=NULL, $shuff notify("Error when reading questions from the database!"); return false; } + } - if (!empty($quiz->shufflequestions)) { // Mix everything up + if (!$shuffleorder) { + if (!empty($quiz->shufflequestions)) { // Mix everything up $questions = swapshuffle_assoc($questions); } else { - $shuffleorder= explode(",", $quiz->questions); // Use defined order + $shuffleorder = explode(",", $quiz->questions); // Use originally defined order } }