Skip to content

Commit

Permalink
MDL-59063 analytics: Finished courses can't be used for prediction
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Oct 17, 2017
1 parent 019ad9c commit fefa341
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lang/en/moodle.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@
$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!';
Expand Down
5 changes: 5 additions & 0 deletions lib/classes/analytics/target/course_dropout.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ public function is_valid_analysable(\core_analytics\analysable $course, $fortrai
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');
Expand Down

0 comments on commit fefa341

Please sign in to comment.