Moodle

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

Details

  • Type: Bug Bug
  • Status: Reopened Reopened
  • Priority: Major 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.

Issue Links

Activity

Hide
Petr Škoda (skodak) added a comment -

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

Show
Petr Škoda (skodak) added a comment - 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
Hide
Tim Hunt added a comment -

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.

Show
Tim Hunt added a comment - 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.
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.
Hide
Tim Hunt added a comment -

Actually, this one is still very much relevant, I am sad to say.

Show
Tim Hunt added a comment - Actually, this one is still very much relevant, I am sad to say.

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated: