-
Bug
-
Resolution: Fixed
-
Minor
-
2.2
-
MOODLE_22_STABLE
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
The current code for updating quiz calendar events uses something like
$event->description = $quiz->intro;
|
where $quiz is the raw object used by quiz_add_instance() etc. The course/mod.php processes the intro field automatically - but only after this calendar event handling code. So if there are images embedded into the quiz description, the event is created/updated with invalid URLs like
<img src="http://moodle/draftfile.php?file=/user/draft/188339625/image.png" />
|
which is tricky to spot as it actually displays the image to the user who created/updated the quiz for the limited period of the draft file area lifetime.
The docs page http://docs.moodle.org/dev/Calendar_API suggests using format_module_intro() to convert draftfile URLs into correct ones, and all modules I checked use this approach. After fixing the quiz_update_events(), an upgrade step might be needed to go through all quiz instances and reformat the description field of their events.