mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
A small fix for showing pictures in randomly-selected questions
This commit is contained in:
parent
a6478fdc0d
commit
3fb839a1e4
1 changed files with 7 additions and 5 deletions
|
@ -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)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue