mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 02:46:40 +02:00
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:
parent
6770a2949a
commit
fd302dc842
2 changed files with 84 additions and 5 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue