Issue Details (XML | Word | Printable)

Key: MDL-14802
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Tim Hunt
Reporter: Tim Hunt
Votes: 2
Watchers: 3
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

It is possible to move shared questions in the question bank to a place where they are no longer properly shared

Created: 12/May/08 11:51 PM   Updated: 16/Oct/09 12:03 AM
Return to search
Component/s: Questions
Affects Version/s: 1.9
Fix Version/s: None

Issue Links:
Relates
 

Participants: Petr Skoda and Tim Hunt
Security Level: None
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
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.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda added a comment - 13/May/08 12:10 AM
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

Tim Hunt added a comment - 13/May/08 12:26 AM
Well, at least we went from an old sharing model that was badly broken, to a new quite robust sharing model that just has a few nasty edge cases which we can probably handle, and where anyway, some of the code that was written to protect us from the old badly broken model is still there offering protection.