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

Multichoice questions inside cloze lose their values after restoring a quiz and modifying the question

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.5.4, 3.6.2
    • Fix Version/s: 3.5.6, 3.6.4
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a new quiz.
      2. Add a new embedded answers (Cloze) question to this quiz.
      3. Select the quiz category (not a course category).
      4. Set the question text to:

        {1:MULTICHOICE:A~B~=C}
         
        {1:MULTICHOICE:D~E~F~G~=H~I}
        

      1. Save the question.
      2. Duplicate the quiz.
      3. As a student, start a new attempt of this quiz, answer the questions and submit.
      4. As a teacher, modify/re-save the question (just click on save changes).
      5. Review the attempt.
      6. Without the patch, both multiple choice questions show "This choice was deleted after the attempt was started".
      Show
      Create a new quiz. Add a new embedded answers (Cloze) question to this quiz. Select the quiz category (not a course category). Set the question text to: {1:MULTICHOICE:A~B~=C}   {1:MULTICHOICE:D~E~F~G~=H~I} Save the question. Duplicate the quiz. As a student, start a new attempt of this quiz, answer the questions and submit. As a teacher, modify/re-save the question (just click on save changes). Review the attempt. Without the patch, both multiple choice questions show "This choice was deleted after the attempt was started".
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Pull 3.5 Branch:
    • Pull 3.6 Branch:
    • Pull Master Branch:
      MDL-64941-master

      Description

      When you restore a quiz with a multianswer/cloze question containing multichoice subquestions and modify this question, the multichoice questions of existing attempts will lose their values and display "This choice was deleted after the attempt was started".

      The problem is that the restore multianswer class restores the subquestions in reverse order. When you save the multianswer question later, the existing subquestions will be overwritten in the order of their ascending ids (instead of the order as given in the sequence field). It overwrites the wrong subquestions and the existing attempt steps data now refer to the wrong answer ids.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/May/19

                Time Tracking

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