From 3f87a74b60ff98550db67a03fdf9de2359c30288 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 6 Feb 2014 09:50:30 +0000 Subject: [PATCH] MDL-44018 quesiton variant was not backed up or restored. --- backup/moodle2/backup_stepslib.php | 2 +- backup/moodle2/restore_stepslib.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backup/moodle2/backup_stepslib.php b/backup/moodle2/backup_stepslib.php index 4e79cc529a3..5ec6bad4f20 100644 --- a/backup/moodle2/backup_stepslib.php +++ b/backup/moodle2/backup_stepslib.php @@ -216,7 +216,7 @@ abstract class backup_questions_activity_structure_step extends backup_activity_ $qas = new backup_nested_element($nameprefix . 'question_attempts'); $qa = new backup_nested_element($nameprefix . 'question_attempt', array('id'), array( - 'slot', 'behaviour', 'questionid', 'maxmark', 'minfraction', 'maxfraction', + 'slot', 'behaviour', 'questionid', 'variant', 'maxmark', 'minfraction', 'maxfraction', 'flagged', 'questionsummary', 'rightanswer', 'responsesummary', 'timemodified')); diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index 1045d9465d3..68c24d6ab0d 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -4069,6 +4069,9 @@ abstract class restore_questions_activity_structure_step extends restore_activit $data->questionusageid = $this->get_new_parentid($nameprefix . 'question_usage'); $data->questionid = $question->newitemid; + if (!property_exists($data, 'variant')) { + $data->variant = 1; + } $data->timemodified = $this->apply_date_offset($data->timemodified); if (!property_exists($data, 'maxfraction')) {