-
Bug
-
Resolution: Cannot Reproduce
-
Minor
-
None
-
3.10
-
None
-
2020121700
-
MOODLE_310_STABLE
The course certificate does not uses the course completion api to calculate if the course was completed or not.
$result = $DB->get_field('course_completions', 'timecompleted', ['course' => $course->id, 'userid' => $user->id]);
|
$completiondate = $result ? userdate($result, get_string('strftimedatefullshort')) : "";
|
In some cases, the course_completion record exist, with empty completion dates, so the student gets a certificate (with empty completion date and empty grades) while he/she should not.
Perhaps there should be an extra check to see if the course was completed before issuing a certificate?
$completioninfo = new \completion_info($course);
|
if ($completioninfo->is_enabled() && $completioninfo->is_course_complete($user->id)) {
|
// issue certificate
|
}
|