Skip to content

Commit 370b567

Browse files
danmarsdenmichael-milette
authored andcommitted
Fix #104 - return correct values in get_state call when subcourse not configured with completion.
1 parent d162288 commit 370b567

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

classes/completion/custom_completion.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ public function get_state(string $rule): int {
4343

4444
if (empty($subcourse->completioncourse)) {
4545
// The rule not enabled, return early.
46-
return $type;
46+
return COMPLETION_UNKNOWN;
4747
}
4848

4949
if (empty($subcourse->refcourse)) {
5050
// Misconfigured subcourse instance, behave as if was not enabled.
51-
return $type;
51+
return COMPLETION_INCOMPLETE;
5252
}
5353

5454
// Check if the referenced course is completed.

0 commit comments

Comments
 (0)