#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,10 +117,12 @@ 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 (!empty($customcert->requiredtime)) {
if (\mod_customcert\certificate::get_course_time($customcert->courseid, if (\mod_customcert\certificate::get_course_time($customcert->courseid,
$enroluser->id) < ($customcert->requiredtime * 60)) { $enroluser->id) < ($customcert->requiredtime * 60)) {
continue; continue;
} }
}
// Ok, issue them the certificate. // Ok, issue them the certificate.
$customcertissue = new \stdClass(); $customcertissue = new \stdClass();