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

    Details

    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-27394_master

      Description

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  timhunt Tim Hunt
                  Reporter:
                  timhunt Tim Hunt
                  Peer reviewer:
                  Eloy Lafuente (stronk7)
                  Integrator:
                  Eloy Lafuente (stronk7)
                  Tester:
                  Eloy Lafuente (stronk7)
                  Participants:
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    5/May/11