Merge branch 'MDL-66806_37' of git://github.com/dmonllao/moodle into MOODLE_37_STABLE

This commit is contained in:
Jun Pataleta
2019-10-18 09:36:43 +08:00
2 changed files with 25 additions and 0 deletions
@@ -74,6 +74,10 @@ abstract class course_enrolments extends \core_analytics\local\target\binary {
return get_string('coursenotyetstarted', 'course');
}
if (!$fortraining && !$course->get_course_data()->visible) {
return get_string('hiddenfromstudents');
}
if (!$this->students = $course->get_students()) {
return get_string('nocoursestudents', 'course');
}
+21
View File
@@ -132,6 +132,27 @@ class core_analytics_targets_testcase extends advanced_testcase {
],
'isvalid' => get_string('completionnotenabledforcourse', 'completion')
],
'coursehiddentraining' => [
'params' => [
'enablecompletion' => 1,
'startdate' => mktime(0, 0, 0, $month - 1, 24, $year - 1),
'enddate' => mktime(0, 0, 0, $month - 1, 23, $year),
'students' => true,
'visible' => '0',
],
'isvalid' => true,
],
'coursehiddenprediction' => [
'params' => [
'enablecompletion' => 1,
'startdate' => mktime(0, 0, 0, $month - 1, 24, $year),
'enddate' => mktime(0, 0, 0, $month - 1, 23, $year + 1),
'students' => true,
'visible' => '0',
],
'isvalid' => get_string('hiddenfromstudents'),
'fortraining' => false
],
];
}