Skip to content

Commit

Permalink
MDL-44018 quesiton variant was not backed up or restored.
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Feb 7, 2014
1 parent 974c2cd commit 3f87a74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backup/moodle2/backup_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));

Expand Down
3 changes: 3 additions & 0 deletions backup/moodle2/restore_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit 3f87a74

Please sign in to comment.