-
Bug
-
Resolution: Fixed
-
Critical
-
3.5.12, 3.6.10, 3.7.6, 3.8.3
-
MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
-
MOODLE_35_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
-
If you have a Quiz with a random question with multiple tags and want to delete a tag from list, then you can delete ALL slot tags globally at portal level.
Reproduction:
- Create a quiz (Quiz1)
- Add question q1 (any type) and add a tag 't1' -> slot1 will be created
- Add question q2 (any type) and add a tags 't1' and 't2' -> slot2 created
- Add question q3 (any type) and add tags 't1','t2' and 't3' ->slot3 created
- Add a random question (slot4) and define 't1', 't2' and 't3' tags for filtering
- Create another quiz (Quiz2)
- Add a random question (slot5) and define 't1', 't2' and 't3' tags for filtering (use the same question bank category as in the previous quiz)
- Open slot5 for editing and remove 't2' tag.
- Issues:
- in slot5 not only t2 will be removed but others
- slot4 tags will be removed
Source of issue: filtering on deletion is based on a totally bad concept in /mod/quiz/editrandom.php.
I've attached a patch, tested in 3.6.10 with MySQL. Please validate if the modified SQL command is correct on all other supported database engines.