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

Deleting a quiz category with no questions behaves like it does have questions.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.2, 2.3.4, 2.9, 3.0.4
    • Fix Version/s: 3.0.5, 3.1.1
    • Component/s: Questions, Quiz
    • Environment:
      2.1.2+ (Build: 20111012), PHP Version 5.3.6, MySQL 5.1.57.
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      Test pre-requisites

      1. Go to a Moodle 2.6.0 instance (or any prior to MDL-20154)
      2. Create a course in it and enrol teacher and student
      3. As a teacher:
        • Create a new Question category A (from the question bank)
        • Add two (true/false) questions to the new category A
        • Create another Question category B
        • Add one true/false question to it
        • Create a new quiz 1
        • Add a 'Random question' to the quiz based on the category A
        • Create a new quiz 2
        • Add the question from B
      4. As the student:
        • Attempt and finish the quizzes
      5. As the teacher (in that order):
        • Delete the quiz 1
        • Delete the questions in the question category A
        • Delete the questions in the question category B
        • Delete the quiz 2
        • Try deleting the category A, you'll be warned that some questions remain in that category, DO NOT proceed
        • Try deleting the category B, you'll be warned that some questions remain in that category, DO NOT proceed

      Test steps

      1. Update to the version you're meant to test
      2. As the teacher, try to delete the question category A again
      3. Confirm that the category was deleted without any warning, or need for additional input from your part
      4. All the entries in mdl_question for category A should be gone
      5. Repeat for category B
      Show
      Test pre-requisites Go to a Moodle 2.6.0 instance (or any prior to MDL-20154 ) Create a course in it and enrol teacher and student As a teacher: Create a new Question category A (from the question bank) Add two (true/false) questions to the new category A Create another Question category B Add one true/false question to it Create a new quiz 1 Add a 'Random question' to the quiz based on the category A Create a new quiz 2 Add the question from B As the student: Attempt and finish the quizzes As the teacher (in that order): Delete the quiz 1 Delete the questions in the question category A Delete the questions in the question category B Delete the quiz 2 Try deleting the category A, you'll be warned that some questions remain in that category, DO NOT proceed Try deleting the category B, you'll be warned that some questions remain in that category, DO NOT proceed Test steps Update to the version you're meant to test As the teacher, try to delete the question category A again Confirm that the category was deleted without any warning, or need for additional input from your part All the entries in mdl_question for category A should be gone Repeat for category B
    • Workaround:
      Hide

      The method that I use does finally delete the category, it just takes an extra step.

      Show
      The method that I use does finally delete the category, it just takes an extra step.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_23_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-29905-master
    • Sprint:
      3.2 Sprint 1

      Description

      I have a quiz category with unused questions, so I want to get rid of it. First, I delete all of the questions. The quiz category show "(0)" questions (see picture). Second, I try to delete the category. I get a warning saying that there are still questions in this category and must move them somewhere (see picture). I move them to my "Junk Questions" category. The quiz category then gets deleted, and no actual questions are moved to my Junk Questions category. Everything is now fine.

      The problem, however, is that Moodle warns me about deleting the quiz category even though there are now questions in it.

        Attachments

        1. Delete a category with 0 questions.jpg
          169 kB
          Rick Jerz
        2. mdl_question.csv
          44 kB
          Stephen Bourget
        3. Save Questions to Junk.jpg
          61 kB
          Rick Jerz

          Issue Links

            Activity

              People

              • Votes:
                16 Vote for this issue
                Watchers:
                18 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Jul/16