Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-84727

Question Bank: system-level subcategories are fully copied and questions are duplicated multiple times when backing up courses

XMLWordPrintable

    • MOODLE_405_STABLE

      Moodle version: 4.5.1 (Build: 20241209)

      In our Moodle installation, the question bank contains approximately 45 categories directly under the system-level category. These categories are widely used across multiple courses, allowing for more efficient management and updates. The questions are linked to quizzes that display them randomly.

      We have been using this setup since Moodle 4.1.3 without issues. However, after upgrading, when creating a course backup, all questions from all system-root subcategories are being copied into each course. Additionally, the copied questions are duplicated excessively, resulting in questions.xml files several GB in size, containing records of up to 10 million questions.

      This issue makes the system inoperable, as the restore process becomes unmanageable due to excessive data, leading to system crashes.

      When testing on a fresh Moodle installation with minimal courses, the backup process works. However, in a real scenario where multiple system-level subcategories exist (in our case, around 45 subcategories with 50 questions each), the excessive duplication prevents both the backup process and normal question bank operations.

      Steps to reproduce:

      1. Create multiple question subcategories directly under the system-level category.
      2. Create a course with a quiz that randomly selects questions from one of the system-level subcategories.
      3. Perform a course backup.
      4. Download the backup file and inspect the questions.xml file.

      Possible related issues:

      https://tracker.moodle.org/browse/MDL-75854

        1. question_bank.png
          37 kB
          Miguel Alós
        2. Q.png
          72 kB
          Miguel Alós
        3. questions_xml.png
          29 kB
          Miguel Alós
        4. 84727 unable to reproduce - question bank.png
          193 kB
          Andrew Gosali
        5. 84727 unable to reproduce - question categories.png
          68 kB
          Andrew Gosali
        6. 84727 unable to reproduce - quiz.png
          235 kB
          Andrew Gosali
        7. 84727 unable to reproduce - questions.xml
          13 kB
          Andrew Gosali
        8. questions.7z
          38.76 MB
          Miguel Alós

            Unassigned Unassigned
            mgalos Miguel Alós
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.