From 6903f6db0b09178967f91c2dc3ebef154d4dff1a Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 29 Nov 2016 15:43:19 +0800 Subject: [PATCH] #57 Set the activity as viewed when downloaded --- view.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/view.php b/view.php index 47942cb..0d36238 100644 --- a/view.php +++ b/view.php @@ -122,6 +122,11 @@ if (empty($action)) { // Insert the record into the database. $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. $template = new \mod_customcert\template($template); $template->generate_pdf();