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:
@@ -80,7 +80,11 @@ class progress {
|
||||
$completed = 0;
|
||||
foreach ($modules as $module) {
|
||||
$data = $completion->get_data($module, true, $userid);
|
||||
$completed += $data->completionstate == COMPLETION_INCOMPLETE ? 0 : 1;
|
||||
if (($data->completionstate == COMPLETION_INCOMPLETE) || ($data->completionstate == COMPLETION_COMPLETE_FAIL)) {
|
||||
$completed += 0;
|
||||
} else {
|
||||
$completed += 1;
|
||||
};
|
||||
}
|
||||
|
||||
return ($completed / $count) * 100;
|
||||
|
||||
Reference in New Issue
Block a user