mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 18:36:42 +02:00
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:
parent
d509f80c48
commit
0d14fcbc60
57 changed files with 1617 additions and 74 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue