From 48bb66e3d3b77034100459343f3c25ba3660e6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Monlla=C3=B3?= Date: Mon, 3 Jun 2019 11:57:57 +0200 Subject: [PATCH] MDL-65829 analytics: Accept enrol start time after analysis time --- .../analytics/target/course_dropout.php | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/lib/classes/analytics/target/course_dropout.php b/lib/classes/analytics/target/course_dropout.php index 4cd82752828..a217bcfa13d 100644 --- a/lib/classes/analytics/target/course_dropout.php +++ b/lib/classes/analytics/target/course_dropout.php @@ -257,11 +257,6 @@ class course_dropout extends \core_analytics\local\target\binary { */ protected function calculate_sample($sampleid, \core_analytics\analysable $course, $starttime = false, $endtime = false) { - if ($this->enrolment_starts_after_calculation_start($sampleid, $starttime)) { - // Discard user enrolments whose start date is after $starttime. - return null; - } - $userenrol = $this->retrieve('user_enrolments', $sampleid); // We use completion as a success metric only when it is enabled. @@ -290,25 +285,4 @@ class course_dropout extends \core_analytics\local\target\binary { } return 0; } - - /** - * Does the user enrolment created after this time range start time or starts after it? - * - * We need to identify these enrolments because the indicators can not be calculated properly - * if the student enrolment started half way through this time range. - * - * User enrolments whose end date is before time() have already been discarded in - * course_enrolments::is_valid_sample. - * - * @param int $sampleid - * @param int $starttime - * @return bool - */ - protected function enrolment_starts_after_calculation_start(int $sampleid, int $starttime) { - $userenrol = $this->retrieve('user_enrolments', $sampleid); - if ($userenrol->timestart && $userenrol->timestart > $starttime) { - return true; - } - return false; - } }