diff --git a/backup/moodle2/backup_stepslib.php b/backup/moodle2/backup_stepslib.php index 46862a700d709..63375a98a6c94 100644 --- a/backup/moodle2/backup_stepslib.php +++ b/backup/moodle2/backup_stepslib.php @@ -216,7 +216,7 @@ protected function add_question_usages($element, $usageidname, $nameprefix = '') $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 cba5771ccfd42..09e7553e04390 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -4069,6 +4069,9 @@ protected function restore_question_attempt_worker($data, $nameprefix) { $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')) {