]> git.mjollnir.org Git - moodle.git/commitdiff
Better code to deal with shuffleorder.
authormoodler <moodler>
Wed, 14 May 2003 16:52:25 +0000 (16:52 +0000)
committermoodler <moodler>
Wed, 14 May 2003 16:52:25 +0000 (16:52 +0000)
Now feedback is always in the same order as the quiz, and
reports are always in the natural order.

mod/quiz/lib.php

index 0e2a03ad67a91c9a61f997c4e06dc8a37fbea44a..0169bf566cbd84fcc5d028cda1b607926ed8c751 100644 (file)
@@ -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
         }
     }