Skip to content

Commit db6cf13

Browse files
authored
Merge pull request #105 from catalyst/fix104
Fix #104 - return correct values in get_state call when subcourse not…
2 parents 7ecddce + 1c36364 commit db6cf13

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)