1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-24 01:44:27 +02:00

MDL-53111 Lesson: Allow "end reached" criteria to be disabled

This commit is contained in:
Stephen Bourget 2016-06-09 12:18:34 -04:00
parent a0a63678a9
commit fb8b18a44d

@ -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;
}
}