Skip to content

Commit

Permalink
MDL-71274 analytics: Don't generate insight for hidden courses
Browse files Browse the repository at this point in the history
Hidden courses can be used for training
but we do not want to generate insights for them
because students do not have access to hidden courses.
This was fixed in MDL-66806 for "Students at risk" model.
Fixed for "Students who have not accessed the course recently" in this issue.
  • Loading branch information
Amaia Anabitarte committed Apr 29, 2021
1 parent ff833a0 commit 723ffea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions course/classes/analytics/target/no_recent_accesses.php
Expand Up @@ -103,6 +103,10 @@ public function is_valid_analysable(\core_analytics\analysable $course, $fortrai
return get_string('nocoursestudents', 'course');
}

if (!$fortraining && !$course->get_course_data()->visible) {
return get_string('hiddenfromstudents');
}

if ($course->get_end() && $course->get_end() < $course->get_start()) {
return get_string('errorendbeforestart', 'course');
}
Expand Down

0 comments on commit 723ffea

Please sign in to comment.