Details
-
Type:
Bug
-
Status:
Reopened
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.9
-
Fix Version/s: None
-
Component/s: Questions
-
Labels:None
-
Affected Branches:MOODLE_19_STABLE
Description
Consider the following hierarchy of courses and course categories.
SITE
Cat A
Course A101
Course A102
Cat B
Cat B1
Course B101
Cat B2
Course B202
Now consider the following sequences of actions:
Scenario A:
1. Create question QA1 in the question bank for course A101 and add it to a quiz in that course.
Now suppose we want to share that question with A102, therefore.
2. Move QA1 to the question bank for category Cat A.
3. Add QA1 to a quiz in course A102.
So far, so good.
4. A teacher on A102 who does not know that the question is used in course A101 moves the question to the question bank for course A102.
This is currently permitted, and nothing really breaks at this stage, although it is a bad idea because.
5. Admin decides A102 is no longer needed, and deletes it.
This breaks the quiz in A101.
Scenario B:
1. Teacher creates question QB1 in the question bank for Cat B1 with the thought that they might be shared in future.
2. Teacher adds QB1 to a quiz in Course B101
3. Admin does a clean up and moves Course B101 to Cat B2 for some reason.
This is also bad, because once again we have a quiz in a course accessing a question it should not really have access to, although again, nothing breaks at this stage. And indeed, even if
4. Admin now deletes Cat B1 because it is now empty.
nothing goes wrong, once my fix to MDL-14633 is in place.
Anyway, the summary is, it is possible to get Moodle into a state where a quiz is using a question that, it it was removed, there would be no (easy) way to add back. I think this is bad, and we should try to prevent it happening.
When it is a case of moving questions in the question bank, it is reasonable to enforce the sharing rules and prevent people moving questions from a more general place to a more specific place, if that would cause the rules to be broken.
When it is a case of moving a course (or course category), I am not sure how appropriate it is to try to prevent that from the question bank. Ho Hum.
problems like this was the reason why I wanted to keep the questions in courses only and use some sort of inter module communication. Every time we move something outside of course we end up with lots of complex code in core which is hard to maintain