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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.5.6, 3.6.4
    • 3.5.4, 3.6.2
    • Questions
    • MOODLE_35_STABLE, MOODLE_36_STABLE
    • MOODLE_35_STABLE, MOODLE_36_STABLE
    • MDL-64941-master
    • 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".

      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.

        1. MDL-64941.jpg
          28 kB
          Anna Carissa Sadia

            mgauk Martin Gauk
            mgauk Martin Gauk
            Tim Hunt Tim Hunt
            Adrian Greeve Adrian Greeve
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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