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