Merge branch 'wip-mdl-40919' of https://github.com/rajeshtaneja/moodle
[moodle.git] / mod / survey / save.php
index 0a61ec7..139ceb9 100644 (file)
         print_error('invalidsurveyid', 'survey');
     }
 
-    add_to_log($course->id, "survey", "submit", "view.php?id=$cm->id", "$survey->id", "$cm->id");
+    $params = array(
+        'context' => $context,
+        'courseid' => $course->id,
+        'other' => array('surveyid' => $survey->id)
+    );
+    $event = \mod_survey\event\response_submitted::create($params);
+    $event->trigger();
 
     $strsurveysaved = get_string('surveysaved', 'survey');