Merge branch 'wip-MDL-59523-master-fix' of git://github.com/abgreeve/moodle

This commit is contained in:
Andrew Nicols
2017-08-02 10:47:52 +08:00
3 changed files with 7 additions and 3 deletions
+1
View File
@@ -834,6 +834,7 @@ function scorm_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('scorm', array('timeopen', 'timeclose'), $data->timeshift, $data->courseid);
$status[] = array('component' => $componentstr, 'item' => get_string('datechanged'), 'error' => false);
return $status;
}
+1
View File
@@ -234,6 +234,7 @@ 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);
$status[] = array('component' => $componentstr, 'item' => get_string('datechanged'), 'error' => false);
return $status;
}
+5 -3
View File
@@ -1894,25 +1894,27 @@ function workshop_reset_userdata(stdClass $data) {
// See MDL-9367.
shift_course_mod_dates('workshop', array('submissionstart', 'submissionend', 'assessmentstart', 'assessmentend'),
$data->timeshift, $data->courseid);
$status = array();
$status[] = array('component' => get_string('modulenameplural', 'workshop'), 'item' => get_string('datechanged'),
'error' => false);
if (empty($data->reset_workshop_submissions)
and empty($data->reset_workshop_assessments)
and empty($data->reset_workshop_phase) ) {
// Nothing to do here.
return array();
return $status;
}
$workshoprecords = $DB->get_records('workshop', array('course' => $data->courseid));
if (empty($workshoprecords)) {
// What a boring course - no workshops here!
return array();
return $status;
}
require_once($CFG->dirroot . '/mod/workshop/locallib.php');
$course = $DB->get_record('course', array('id' => $data->courseid), '*', MUST_EXIST);
$status = array();
foreach ($workshoprecords as $workshoprecord) {
$cm = get_coursemodule_from_instance('workshop', $workshoprecord->id, $course->id, false, MUST_EXIST);