#48 Make required time check more robust

This commit is contained in:
Mark Nelson 2017-04-27 15:18:11 +08:00
parent 4f4be1f918
commit 7d2664991f

View file

@ -117,9 +117,11 @@ class email_certificate_task extends \core\task\scheduled_task {
} }
// Check that they have passed the required time. // Check that they have passed the required time.
if (\mod_customcert\certificate::get_course_time($customcert->courseid, if (!empty($customcert->requiredtime)) {
$enroluser->id) < ($customcert->requiredtime * 60)) { if (\mod_customcert\certificate::get_course_time($customcert->courseid,
continue; $enroluser->id) < ($customcert->requiredtime * 60)) {
continue;
}
} }
// Ok, issue them the certificate. // Ok, issue them the certificate.