MDL-44018 quesiton variant was not backed up or restored.

This commit is contained in:
Tim Hunt 2014-02-06 09:50:30 +00:00
parent 974c2cdc03
commit 3f87a74b60
2 changed files with 4 additions and 1 deletions

View file

@ -216,7 +216,7 @@ abstract class backup_questions_activity_structure_step extends backup_activity_
$qas = new backup_nested_element($nameprefix . 'question_attempts'); $qas = new backup_nested_element($nameprefix . 'question_attempts');
$qa = new backup_nested_element($nameprefix . 'question_attempt', array('id'), array( $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', 'flagged', 'questionsummary', 'rightanswer', 'responsesummary',
'timemodified')); 'timemodified'));

View file

@ -4069,6 +4069,9 @@ abstract class restore_questions_activity_structure_step extends restore_activit
$data->questionusageid = $this->get_new_parentid($nameprefix . 'question_usage'); $data->questionusageid = $this->get_new_parentid($nameprefix . 'question_usage');
$data->questionid = $question->newitemid; $data->questionid = $question->newitemid;
if (!property_exists($data, 'variant')) {
$data->variant = 1;
}
$data->timemodified = $this->apply_date_offset($data->timemodified); $data->timemodified = $this->apply_date_offset($data->timemodified);
if (!property_exists($data, 'maxfraction')) { if (!property_exists($data, 'maxfraction')) {