Merge branch 'MDL-53111_m31v1' of https://github.com/sbourget/moodle into MOODLE_31_STABLE

This commit is contained in:
Andrew Nicols
2016-06-27 14:18:36 +08:00
+6
View File
@@ -426,6 +426,12 @@ class mod_lesson_mod_form extends moodleform_mod {
$data->completiontimespent = 0;
}
}
if (!empty($data->completionunlocked)) {
$autocompletion = !empty($data->completion) && $data->completion == COMPLETION_TRACKING_AUTOMATIC;
if (empty($data->completionendreached) || !$autocompletion) {
$data->completionendreached = 0;
}
}
return $data;
}
}