Merge branch 'MDL-66806_master' of git://github.com/dmonllao/moodle

This commit is contained in:
Jun Pataleta
2019-10-18 09:36:51 +08:00
2 changed files with 25 additions and 0 deletions
@@ -115,6 +115,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
@@ -130,6 +130,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
],
];
}