-
Bug
-
Resolution: Fixed
-
Minor
-
5.0
-
MOODLE_500_STABLE
-
MOODLE_500_STABLE
-
MDL-84728_main -
-
-
Steps to reproduce:
1. Create 3 courses, "Course1" and "Course2" and "Course3"
2. Add a question bank to "Course1", add 2 questions to the default category.
3. Add a quiz to "Course2". Add a random question to the quiz with the category filter set to the Course1 question bank's default category.
4. Back up the quiz.
5. Restore the quiz to Course3.
6. Open the quiz and go to the Questions tab.
Expected: The random question shows the Course1 question bank's default category
Actual: The random question shows a red notice that the category is missing.
This happens because the restore process creates all question categories that are in the backup then decides later if they're needed, but blindly points any restored set references to the new category without working out whether we're going to keep it, or whether we should point to the original one instead.