MDL-39955 completion: Added course_module_completion_updated event
Conflicts: lib/tests/completionlib_advanced_test.php
This commit is contained in:
+14
-1
@@ -1036,7 +1036,20 @@ class completion_info {
|
||||
}
|
||||
$transaction->allow_commit();
|
||||
|
||||
events_trigger('activity_completion_changed', $data);
|
||||
$cmcontext = context_module::instance($data->coursemoduleid, MUST_EXIST);
|
||||
$coursecontext = $cmcontext->get_parent_context();
|
||||
|
||||
// Trigger an event for course module completion changed.
|
||||
$event = \core\event\course_module_completion_updated::create(
|
||||
array('objectid' => $data->id,
|
||||
'userid' => $USER->id,
|
||||
'context' => $cmcontext,
|
||||
'courseid' => $coursecontext->instanceid,
|
||||
'other' => array('relateduserid' => $data->userid)
|
||||
)
|
||||
);
|
||||
$event->add_record_snapshot('course_modules_completion', $data);
|
||||
$event->trigger();
|
||||
|
||||
if ($data->userid == $USER->id) {
|
||||
$SESSION->completioncache[$cm->course][$cm->id] = $data;
|
||||
|
||||
Reference in New Issue
Block a user