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

Delete a course contain quizzes contain questiones should be deleted if the question is not used

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 5.0
    • Questions, Quiz
    • None
    • MOODLE_500_STABLE
    • MDL-85701-500
    • MDL-85701-master
    • Hide

      Test Case 1: Course Backup and Restore with unused question

      1. Create 1 course, "Course1"
      2. Go to "Course1", create a Quiz called Quiz1
      3. In Quiz1, we create a  True/False question called T/F1 
      4. Backup the course
      5. Restore the backup file to a new course called "Course 2"
      6. Delete the "Course 1"

      Expected: Site home course should not contain any question since the quiz contain it has been deleted.

      Test case 2: Course Backup and Restore with used question

      1. Create 2 courses, "Course1" and "Course2"
      2. Go to "Course1", create a Quiz called Quiz1
      3. In Quiz1, we create a  True/False called T/F1 
      4. Go to "Course2", create a Quiz called Quiz2
      5. In Quiz2, add the true/false question from the "Quiz 1"
      6. Backup the "Course1"
      7. Restore the backup file to a new course called "Course 3"
      8. Delete the "Course 1"

      Expected: Site home course should  contain T/F1

      Return to the quiz on "Course2" and to go the "Questions" tab. Confirm that the page displays without errors.

       

      Show
      Test Case 1: Course Backup and Restore with unused question Create 1 course, "Course1" Go to "Course1", create a Quiz called Quiz1 In Quiz1, we create a  True/False question called T/F1  Backup the course Restore the backup file to a new course called "Course 2" Delete the "Course 1" Expected: Site home course should not contain any question since the quiz contain it has been deleted. Test case 2: Course Backup and Restore with used question Create 2 courses, "Course1" and "Course2" Go to "Course1", create a Quiz called Quiz1 In Quiz1, we create a  True/False called T/F1  Go to "Course2", create a Quiz called Quiz2 In Quiz2, add the true/false question from the "Quiz 1" Backup the "Course1" Restore the backup file to a new course called "Course 3" Delete the "Course 1" Expected: Site home course should  contain T/F1 Return to the quiz on "Course2" and to go the "Questions" tab. Confirm  that the page displays without errors.  
    • Show
      Code verified against automated checks with warnings. Checked MDL-85701 using repository: https://github.com/NashTechOpenUniversity/moodle MOODLE_500_STABLE (0 errors / 1 warnings) [branch: MDL-85701-500 | CI Job ] overview (0/0) , phplint (0/0) , phpcs (0/1) , js (0/0) , css (0/0) , phpdoc (0/0) , commit (0/0) , savepoint (0/0) , thirdparty (0/0) , externalbackup (0/0) , grunt (0/0) , shifter (0/0) , mustache (0/0) , gherkin (0/0) , main (0 errors / 1 warnings) [branch: MDL-85701-master | CI Job ] overview (0/0) , phplint (0/0) , phpcs (0/1) , js (0/0) , css (0/0) , phpdoc (0/0) , commit (0/0) , savepoint (0/0) , thirdparty (0/0) , externalbackup (0/0) , grunt (0/0) , shifter (0/0) , mustache (0/0) , gherkin (0/0) , Should these errors be fixed? Built on: Tue Jun 10 02:47:38 UTC 2025

      Following the changes introduced in MDL-84591, an unintended behavior has been observed.

      When a course containing questions used in a quiz is deleted, those questions are automatically moved to the site course.

      However, if the questions are no longer in use by any quiz, they should be deleted instead of being moved.

            vuvanhieu143 Hieu Vu
            vuvanhieu143 Hieu Vu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

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