-
Bug
-
Resolution: Fixed
-
Major
-
2.1.4, 2.2.1, 2.3
-
MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
MDL-31386-master-1 -
When using a matched answer question in a lesson, the fields (Correct Answer, Wrong Answer, Answer 1, Answer n) are determined by the order of the answers in the database. That's to say that when they're retrieved, they are sorted by id ascending. As a result you get:
- id 0: Correct Answer: "Correct Answer text"
- id 1: Wrong Answer: "Wrong Answer text"
- id 2: Answer 1: "Answer 1 text"
- id 3: Answer 2: "Answer 2 text"
- id 4: Answer 3: "Answer 3 text"
When backing up a course with a lesson, these are ordered n reverse:
<answer id="5">
|
</answer>
|
<answer id="4">
|
</answer>
|
<answer id="3">
|
</answer>
|
<answer id="2">
|
</answer>
|
<answer id="1">
|
</answer>
|
As a result, when the restore takes place, the questions are taken out of order and reversed:
- id 0: Correct Answer: "Answer 3 text"
- id 1: Wrong Answer: "Answer 2 text"
- id 2: Answer 1: "Answer 1 text"
- id 3: Answer 2: "Wrong Answer text"
- id 4: Answer 3: "Correct Answer text"
And you end up with the
I can't decide whether the issue lies with:
- the backup process reversing the order of the answers; or
- the restore process not ordering the answers by the id in the XML structure.