MDL-59063 analytics: Finished courses can't be used for prediction

This commit is contained in:
David Monllao
2017-10-17 14:05:40 +02:00
parent 019ad9c7a8
commit fefa34120a
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -292,6 +292,7 @@ $string['counteditems'] = '{$a->count} {$a->items}';
$string['country'] = 'Country';
$string['course'] = 'Course';
$string['courseadministration'] = 'Course administration';
$string['coursealreadyfinished'] = 'Course already finished';
$string['courseapprovedemail'] = 'Your requested course, {$a->name}, has been approved and you have been made a {$a->teacher}. To access your new course, go to {$a->url}';
$string['courseapprovedemail2'] = 'Your requested course, {$a->name}, has been approved. To access your new course, go to {$a->url}';
$string['courseapprovedfailed'] = 'Failed to save the course as approved!';
@@ -158,6 +158,11 @@ class course_dropout extends \core_analytics\local\target\binary {
return get_string('coursetoolong', 'analytics');
}
// Finished courses can not be used to get predictions.
if (!$fortraining && $course->is_finished()) {
return get_string('coursealreadyfinished');
}
// Ongoing courses data can not be used to train.
if ($fortraining && !$course->is_finished()) {
return get_string('coursenotyetfinished');