-
Bug
-
Resolution: Fixed
-
Major
-
5.0
-
MOODLE_500_STABLE
-
MOODLE_500_STABLE
-
MDL-83977_main -
-
-
Steps to reproduce:
- Install Moodle 4.5.
- Create 2 courses, "Usage course" and "No usage course"
- In each course, go to the Question bank and create 2 questions.
- On "Usage course", create a quiz, and add one of the questions from the question bank to the quiz.
- Upgrade to Moodle 5.0.
- Run the mod_qbank\task\transfer_question_categories ad-hoc task (directly, or via the cron.
- Go to "Usage course" and navigate to "More > Question banks" then "Usage course shared question bank".
- Confirm that the two questions for this course were successfully migrated.
- Go to "No usage course" and navigate to "More > Question banks" then "No usage course shared question bank".
- Expected: The two questions for this course were successfully migrated.
- Actual: The two questions for this course have been deleted.
It seems the following code in the ad-hoc task is responsible for these deletions:
$subcategories = array_reverse(\sort_categories_by_tree($subcategories, $oldtopcategory->id)); |
foreach ($subcategories as $subcategory) { |
\qbank_managecategories\helper::question_remove_stale_questions_from_category($subcategory->id); |
if (!question_category_in_use($subcategory->id)) { |
question_category_delete_safe($subcategory); |
}
|
}
|
- Discovered while testing
-
MDLQA-19376 Question bank improvements QA testing
-
- Passed
-
-
MDLQA-19832 CLONE - As a teacher, I should have the existing questions automatically migrated into a new, automatically created, question bank module
-
- Passed
-