Skip to content

Commit

Permalink
MDL-59523 course_reset: Roll dates when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitagarwal committed Aug 1, 2017
1 parent d509f80 commit cb416db
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mod/scorm/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions mod/wiki/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
5 changes: 5 additions & 0 deletions mod/workshop/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) ) {
Expand Down

0 comments on commit cb416db

Please sign in to comment.