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

Moodle 2.0 backup and restore may randomise the order of multichoice/numerical/shortanswer answers

XMLWordPrintable

    • MOODLE_20_STABLE
    • MOODLE_20_STABLE
    • MDL-27394_master
    • Hide

      Create questions of each type, but particularly numerical (with units), shortanswer, multichoice, calculated*, multianswer. With shortanswer/numerical/calculated, make sure you add multiple answers with different feedback.

      Check that queries like select * from

      {question_answers}

      , select * from

      {question_numerical_units}

      , select * from

      {question_match_sub}

      acutally return the records in an arbitrary order. With a new/small/MySQL DB, they often come out in id order, and you will not see the problem.

      Backup your questions and restore them. (e.g. backup and restore course to a new course.)

      Without this patch, you will find that the answers/choices/subquestoins have been restored in a random order.

      With this patch, it works.

      Show
      Create questions of each type, but particularly numerical (with units), shortanswer, multichoice, calculated*, multianswer. With shortanswer/numerical/calculated, make sure you add multiple answers with different feedback. Check that queries like select * from {question_answers} , select * from {question_numerical_units} , select * from {question_match_sub} acutally return the records in an arbitrary order. With a new/small/MySQL DB, they often come out in id order, and you will not see the problem. Backup your questions and restore them. (e.g. backup and restore course to a new course.) Without this patch, you will find that the answers/choices/subquestoins have been restored in a random order. With this patch, it works.

      All the backup code is missing the critical ORDER BY id for question_answers, question_numerical_units and question_match_sub.

      You often get away with that on MySQL (at least with MyISAM) but on you end up with your data in a random order.

            timhunt Tim Hunt
            timhunt Tim Hunt
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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