A small fix for showing pictures in randomly-selected questions

This commit is contained in:
moodler 2003-12-17 13:35:49 +00:00
parent a6478fdc0d
commit 3fb839a1e4

View file

@ -26,8 +26,7 @@
$idreg = '[0-9]+'; $idreg = '[0-9]+';
if (!ereg("^/?($idreg)/($idreg)/((.+/)?([^/]+))$", if (!ereg("^/?($idreg)/($idreg)/((.+/)?([^/]+))$",
$pathinfo, $pathinfo,
$regs) ) $regs) ) {
{
error("File parameters are badly formated"); error("File parameters are badly formated");
} }
if (! ($quiz = get_record('quiz', 'id', $regs[1]))) { if (! ($quiz = get_record('quiz', 'id', $regs[1]))) {
@ -65,9 +64,12 @@
// Now verify the consistency between $quiz, $question, its category and $relativepathname // Now verify the consistency between $quiz, $question, its category and $relativepathname
/////////////////////////////////////////////////// ///////////////////////////////////////////////////
if (!in_array($question->id, explode(',', $quiz->questions), FALSE)) { // For now, let's not worry about this. The following check doesn't
error("Specified question is not on the specified quiz"); // 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', if (! ($questioncategory = get_record('quiz_categories', 'id',
$question->category))) $question->category)))
{ {