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

quiz random question tags are deleted accidentally on entire site

XMLWordPrintable

    • MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • MOODLE_35_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Hide
      1. In the question bank for a course, create an essay question with tags essay and easy.
      2. In the question bank for a course, create a second essay question with tags essay and hard.
      3. Create a quiz in the course.
      4. Go to the 'Edit quiz' page.
      5. Click the 'Add' menu and choose 'a random question'.
      6. Set tags to 'essay' and 'easy', and click the button.
      7. Click the 'Add' menu and choose 'a random question'.
      8. Set tags to 'hard', and click the button.
      9. Click the 'Configure' gear icon by the first random question (the one with two tags).
      10. Delete one of the tags, and click the Save button.
      11. Click the 'Configure' gear icon by the second random question (the one with just tag 'hard').
      12. Verify that in the pop-up, it still shows Tags: hard.
      Show
      In the question bank for a course, create an essay question with tags essay and easy. In the question bank for a course, create a second essay question with tags essay and hard. Create a quiz in the course. Go to the 'Edit quiz' page. Click the 'Add' menu and choose 'a random question'. Set tags to 'essay' and 'easy', and click the button. Click the 'Add' menu and choose 'a random question'. Set tags to 'hard', and click the button. Click the 'Configure' gear icon by the first random question (the one with two tags). Delete one of the tags, and click the Save button. Click the 'Configure' gear icon by the second random question (the one with just tag 'hard'). Verify that in the pop-up, it still shows Tags: hard.

      If you have a Quiz with a random question with multiple tags and want to delete a tag from list, then you can delete ALL slot tags globally at portal level.

      Reproduction:

      • Create a quiz (Quiz1)
      • Add question q1 (any type) and add a tag 't1' -> slot1 will be created
      • Add question q2 (any type) and add a tags 't1' and 't2' -> slot2 created
      • Add question q3 (any type) and add tags 't1','t2' and 't3' ->slot3 created
      • Add a random question (slot4) and define 't1', 't2' and 't3' tags for filtering
      • Create another quiz (Quiz2)
      • Add a random question (slot5) and define 't1', 't2' and 't3' tags for filtering (use the same question bank category as in the previous quiz)
      • Open slot5 for editing and remove 't2' tag.
      • Issues:
        • in slot5 not only t2 will be removed but others
        • slot4 tags will be removed

      Source of issue: filtering on deletion is based on a totally bad concept in /mod/quiz/editrandom.php.

      I've attached a patch, tested in 3.6.10 with MySQL. Please validate if the modified SQL command is correct on all other supported database engines.

       

            timhunt Tim Hunt
            epititk Bence Molnar
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Adrian Greeve Adrian Greeve
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h

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