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

Investigate and fix invalid question_multianswer sequence

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      (I guess)

      1. Have a backup from a course containing a broken multianswer question.
      2. Try to restore that course.
      3. Verify the restore is working.
      4. Verify the question still looks as before.
      Show
      (I guess) Have a backup from a course containing a broken multianswer question. Try to restore that course. Verify the restore is working. Verify the question still looks as before.
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      There has been situations where restore or upgrade were compromised because of invalid values in the sequence column of multianswer (Cloze) questions. In this issue we should investigate and fix the root cause. It appears that sequences could contain empty values, e.g: ,,.

      One of the causes could be that mappings to new question IDs were not found during restore, thus creating $sequence = implode(',', array(1, false, 3, ...)). That is based on my observations from MDL-35987.

      The following SQL statement may help identify invalid sequences:

      SELECT *
        FROM mdl_question_multianswer
       WHERE sequence IS NULL
          OR sequence LIKE ''
          OR sequence LIKE '%,,%';
      

        Attachments

        1. faulty_multianswer_questions_moodle.xlsx
          20 kB
          Christian Niemczik
        2. image-2018-09-29-18-58-38-529.png
          185 kB
          Christian Niemczik
        3. image-2018-10-01-09-52-38-202.png
          220 kB
          Christian Niemczik
        4. Screenshot-2018-09-29-18-28-57.jpg
          205 kB
          Christian Niemczik

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              fred Frédéric Massart
              Peer reviewer:
              Luca Bösch
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              46 Vote for this issue
              Watchers:
              35 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 minutes
                  5m