MDL-9367 restore: Roll only configuration dates

It was decided to roll only configuration dates and any date related to user content
such as 'timecreated' , 'timemodified' etc should not be rolled forward.
This commit is contained in:
Ankit Agarwal 2017-06-29 13:38:47 +05:30
parent d509f80c48
commit 0d14fcbc60
57 changed files with 1617 additions and 74 deletions

View file

@ -101,10 +101,11 @@ class restore_quiz_activity_structure_step extends restore_questions_activity_st
$oldid = $data->id;
$data->course = $this->get_courseid();
// Any changes to the list of dates that needs to be rolled should be same during course restore and course reset.
// See MDL-9367.
$data->timeopen = $this->apply_date_offset($data->timeopen);
$data->timeclose = $this->apply_date_offset($data->timeclose);
$data->timecreated = $this->apply_date_offset($data->timecreated);
$data->timemodified = $this->apply_date_offset($data->timemodified);
if (property_exists($data, 'questions')) {
// Needed by {@link process_quiz_attempt_legacy}, in which case it will be present.
@ -359,8 +360,6 @@ class restore_quiz_activity_structure_step extends restore_questions_activity_st
$data->userid = $this->get_mappingid('user', $data->userid);
$data->grade = $data->gradeval;
$data->timemodified = $this->apply_date_offset($data->timemodified);
$DB->insert_record('quiz_grades', $data);
}
@ -372,10 +371,6 @@ class restore_quiz_activity_structure_step extends restore_questions_activity_st
$data->userid = $this->get_mappingid('user', $data->userid);
$data->timestart = $this->apply_date_offset($data->timestart);
$data->timefinish = $this->apply_date_offset($data->timefinish);
$data->timemodified = $this->apply_date_offset($data->timemodified);
if (!empty($data->timecheckstate)) {
$data->timecheckstate = $this->apply_date_offset($data->timecheckstate);
} else {