From: moodler Date: Wed, 17 Dec 2003 13:35:49 +0000 (+0000) Subject: A small fix for showing pictures in randomly-selected questions X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3fb839a1e48a0416a6a0eee59c50f6ae80058009;p=moodle.git A small fix for showing pictures in randomly-selected questions --- 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))) {