diff --git a/course/classes/analytics/indicator/completion_enabled.php b/course/classes/analytics/indicator/completion_enabled.php index f2598e080da..87d09199c19 100644 --- a/course/classes/analytics/indicator/completion_enabled.php +++ b/course/classes/analytics/indicator/completion_enabled.php @@ -69,10 +69,8 @@ class completion_enabled extends \core_analytics\local\indicator\binary { $course = $this->retrieve('course', $sampleid); - $cm = false; - if ($sampleorigin === 'course_modules') { - $cm = $this->retrieve('course_modules', $sampleid); - } + // It may not be available, but if it is the indicator checks if completion is enabled for the cm. + $cm = $this->retrieve('course_modules', $sampleid); $completion = new \completion_info($course);