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

Deleting a course containing a shared question bank breaks quizzes using the shared questions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 5.0
    • 5.0
    • Questions, Quiz
    • MOODLE_500_STABLE
    • MOODLE_500_STABLE
    • MDL-84591_main
    • Hide

      1. Create 2 courses, "Course1" and "Course2"
      2. Go to "Course1", create a question bank called "Course 1 question bank", and add a true/false question to the question bank.
      3. Go to "Course2", create a quiz, and add the true/false question from the "Course1" question bank.
      4. On the "Questions" tab in the quiz, confirm that the question is shown with a blue "Course 1 question bank" badge next to it.
      5. Go to Site administration > Courses > Manage courses and categories, and delete "Course1".
      6. Return to the quiz on "Course2" and to go the "Questions" tab

      • Confirm that the page displays without errors.
      • Confirm that the blue badge next to the question now says "System shared question
        bank"
      • Before fix An error was displayed.

      7. Go to the "Quiz" tab and click "Preview quiz"

      • Confirm that the preview attempt starts with errors.
      • Before fix An error was displayed.
      Show
      1. Create 2 courses, "Course1" and "Course2" 2. Go to "Course1", create a question bank called "Course 1 question bank", and add a true/false question to the question bank. 3. Go to "Course2", create a quiz, and add the true/false question from the "Course1" question bank. 4. On the "Questions" tab in the quiz, confirm that the question is shown with a blue "Course 1 question bank" badge next to it. 5. Go to Site administration > Courses > Manage courses and categories, and delete "Course1". 6. Return to the quiz on "Course2" and to go the "Questions" tab Confirm that the page displays without errors. Confirm that the blue badge next to the question now says "System shared question bank" Before fix An error was displayed. 7. Go to the "Quiz" tab and click "Preview quiz" Confirm that the preview attempt starts with errors. Before fix An error was displayed.
    • Hide

      Code verified against automated checks.

      Checked MDL-84591 using repository: https://github.com/marxjohnson/moodle.git

      More information about this report

      Built on: Tue Mar 11 14:17:35 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-84591 using repository: https://github.com/marxjohnson/moodle.git main (0 errors / 0 warnings) [branch: MDL-84591_main | CI Job ] More information about this report Built on: Tue Mar 11 14:17:35 UTC 2025
    • Show
      Launching automatic jobs for branch MDL-84591 _main https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18686/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64008/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64009/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64010/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64011/ App tests (stable app version) Built on: Wed Mar 19 16:30:46 UTC 2025

      If a question is used in Course A from a course-level question bank from another course, Course B, and then Course B is deleted, the quiz in Course A produces an error message, "Can't find data record in database."

      This should not happen (and I thought we had considered this). The in-use questions should be saved somehow.

            marxjohnson Mark Johnson
            rjerz Rick Jerz
            Rick Jerz Rick Jerz
            Tim Hunt Tim Hunt
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 7 minutes
                7m

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