MDL-71104 core_completion: Fix fetching of grade completion status
We should be able to fetch the grade completion status for modules that do not have custom completion configured. This also improves unit testing coverage.
This commit is contained in:
@@ -1111,13 +1111,13 @@ class completion_info {
|
||||
$customdata = (array)$cm->customdata;
|
||||
// Return early if the plugin does not define custom completion rules.
|
||||
if (empty($customdata['customcompletionrules'])) {
|
||||
return [];
|
||||
return $data;
|
||||
}
|
||||
|
||||
// Return early if the activity modules doe not implement the activity_custom_completion class.
|
||||
$cmcompletionclass = activity_custom_completion::get_cm_completion_class($cm->modname);
|
||||
if (!$cmcompletionclass) {
|
||||
return [];
|
||||
return $data;
|
||||
}
|
||||
|
||||
/** @var activity_custom_completion $customcmcompletion */
|
||||
|
||||
Reference in New Issue
Block a user