MDL-41101 mod_assign: replaced 'view submission grading table' add_to_log call with...
[moodle.git] / mod / assign / locallib.php
index 43d5485..19cd799 100644 (file)
@@ -3214,8 +3214,16 @@ class assign {
 
         $o .= $this->view_footer();
 
-        $logmessage = get_string('viewsubmissiongradingtable', 'assign');
-        $this->add_to_log('view submission grading table', $logmessage);
+        $logmessage = new lang_string('viewsubmissiongradingtable', 'assign');
+        $event = \mod_assign\event\grading_table_viewed::create(array(
+            'context' => $this->get_context(),
+            'other' => array(
+                'assignid' => $this->get_instance()->id
+            )
+        ));
+        $event->set_legacy_logdata('view submission grading table', $logmessage);
+        $event->trigger();
+
         return $o;
     }