Merge branch 'wip-mdl-40919' of https://github.com/rajeshtaneja/moodle
[moodle.git] / mod / survey / download.php
index 1b81d0e..d633cb3 100644 (file)
@@ -51,7 +51,14 @@ if (! $survey = $DB->get_record("survey", array("id"=>$cm->instance))) {
     print_error('invalidsurveyid', 'survey');
 }
 
-add_to_log($course->id, "survey", "download", $PAGE->url->out(), "$survey->id", $cm->id);
+$params = array(
+    'objectid' => $survey->id,
+    'context' => $context,
+    'courseid' => $course->id,
+    'other' => array('type' => $type, 'groupid' => $group)
+);
+$event = \mod_survey\event\report_downloaded::create($params);
+$event->trigger();
 
 /// Check to see if groups are being used in this survey