diff --git a/backup/moodle2/backup_stepslib.php b/backup/moodle2/backup_stepslib.php index 51b6b475882..06d6aaa8798 100644 --- a/backup/moodle2/backup_stepslib.php +++ b/backup/moodle2/backup_stepslib.php @@ -210,7 +210,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', + 'slot', 'behaviour', 'questionid', 'variant', 'maxmark', 'minfraction', 'flagged', 'questionsummary', 'rightanswer', 'responsesummary', 'timemodified')); diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index f7b0fb30009..14c7ca7f7be 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -4047,6 +4047,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); $newitemid = $DB->insert_record('question_attempts', $data);