#57 Set the activity as viewed when downloaded

This commit is contained in:
Mark Nelson 2016-11-29 15:43:19 +08:00
parent 0777b07502
commit 6903f6db0b

View file

@ -122,6 +122,11 @@ if (empty($action)) {
// Insert the record into the database. // Insert the record into the database.
$DB->insert_record('customcert_issues', $customcertissue); $DB->insert_record('customcert_issues', $customcertissue);
} }
// Set the custom certificate as viewed.
$completion = new completion_info($course);
$completion->set_module_viewed($cm);
// Now we want to generate the PDF. // Now we want to generate the PDF.
$template = new \mod_customcert\template($template); $template = new \mod_customcert\template($template);
$template->generate_pdf(); $template->generate_pdf();