Commit fefa3412 authored by David Monllaó's avatar David Monllaó
Browse files

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

parent 019ad9c7
......@@ -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');
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment