From 3fb839a1e48a0416a6a0eee59c50f6ae80058009 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 17 Dec 2003 13:35:49 +0000 Subject: [PATCH] A small fix for showing pictures in randomly-selected questions --- mod/quiz/quizfile.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mod/quiz/quizfile.php b/mod/quiz/quizfile.php index 830b00e27e..db1b086e96 100644 --- a/mod/quiz/quizfile.php +++ b/mod/quiz/quizfile.php @@ -26,8 +26,7 @@ $idreg = '[0-9]+'; if (!ereg("^/?($idreg)/($idreg)/((.+/)?([^/]+))$", $pathinfo, - $regs) ) - { + $regs) ) { error("File parameters are badly formated"); } if (! ($quiz = get_record('quiz', 'id', $regs[1]))) { @@ -65,9 +64,12 @@ // Now verify the consistency between $quiz, $question, its category and $relativepathname /////////////////////////////////////////////////// - if (!in_array($question->id, explode(',', $quiz->questions), FALSE)) { - error("Specified question is not on the specified quiz"); - } + // For now, let's not worry about this. The following check doesn't + // work for randomly selected questions and it gets complicated + //if (!in_array($question->id, explode(',', $quiz->questions), FALSE)) { + // error("Specified question is not on the specified quiz"); + //} + if (! ($questioncategory = get_record('quiz_categories', 'id', $question->category))) { -- 2.39.5