Merge branch 'MDL-59523-master' of git://github.com/ankitagarwal/moodle

This commit is contained in:
Andrew Nicols 2017-08-01 13:43:04 +08:00
commit 3ccd1965f3
3 changed files with 13 additions and 1 deletions

View File

@ -831,7 +831,9 @@ function scorm_reset_userdata($data) {
$status[] = array('component' => $componentstr, 'item' => get_string('deleteallattempts', 'scorm'), 'error' => false);
}
// No dates to shift here.
// Any changes to the list of dates that needs to be rolled should be same during course restore and course reset.
// See MDL-9367.
shift_course_mod_dates('scorm', array('timeopen', 'timeclose'), $data->timeshift, $data->courseid);
return $status;
}

View File

@ -230,6 +230,11 @@ function wiki_reset_userdata($data) {
}
}
}
// Any changes to the list of dates that needs to be rolled should be same during course restore and course reset.
// See MDL-9367.
shift_course_mod_dates('wiki', array('editbegin', 'editend'), $data->timeshift, $data->courseid);
return $status;
}

View File

@ -1890,6 +1890,11 @@ function workshop_reset_course_form_defaults(stdClass $course) {
function workshop_reset_userdata(stdClass $data) {
global $CFG, $DB;
// Any changes to the list of dates that needs to be rolled should be same during course restore and course reset.
// See MDL-9367.
shift_course_mod_dates('workshop', array('submissionstart', 'submissionend', 'assessmentstart', 'assessmentend'),
$data->timeshift, $data->courseid);
if (empty($data->reset_workshop_submissions)
and empty($data->reset_workshop_assessments)
and empty($data->reset_workshop_phase) ) {