MDL-75173 core_completion: Fix course completion criteria marking.

SQL was fetching activities where completion state was 'completed,
but not passed reqyured grade'. For course completion such states
must be ignored.

Also fixed progress bar on my courses page. Same reasoning as above.
This commit is contained in:
Ilya Tregubov
2022-10-14 11:47:49 +03:00
parent 3af0824487
commit c4cd3a61c8
3 changed files with 95 additions and 3 deletions
-2
View File
@@ -151,7 +151,6 @@ class api {
AND (
mc.completionstate = :completionstate
OR mc.completionstate = :completionstatepass
OR mc.completionstate = :completionstatefail
)";
$params = [
@@ -159,7 +158,6 @@ class api {
'contextlevel' => CONTEXT_COURSE,
'completionstate' => COMPLETION_COMPLETE,
'completionstatepass' => COMPLETION_COMPLETE_PASS,
'completionstatefail' => COMPLETION_COMPLETE_FAIL
];
if ($userdata) {