-
Improvement
-
Resolution: Fixed
-
Minor
-
4.4.1
-
MOODLE_404_STABLE
-
MOODLE_405_STABLE
-
MDL-82587-main -
When changing question versions via mod/quiz/edit.php no event is fired when the version is changed. Quiz has many events/hooks for when things change (including when the mark is changed on the same edit page), so it's odd one is missing for this.
Our specific need for it arose while working on a feature that uses a cache which needs to be purged when something about a specific question type changes - which also needs to be purged when the question version changes.
The way changing versions is implemented is a bit weird too, it appears to be just done by directly updating the DB in a webservice rather than calling an API (contrast this with how the slot mark is updated via the quiz structure API.
It seems sensible to move the code for updating the version in to the structure class and create an associated event to fire when the version is updated.