mirror of
https://github.com/moodle/moodle.git
synced 2025-08-11 03:46:42 +02:00
MDL-40056 events: Replace old add_to_log calls with new events
This commit is contained in:
parent
25e8023d3d
commit
0a61619043
13 changed files with 80 additions and 18 deletions
|
@ -53,8 +53,15 @@ require_login($course, false, $cm);
|
|||
$contextmodule = context_module::instance($cm->id);
|
||||
require_capability('mod/scorm:viewreport', $contextmodule);
|
||||
|
||||
add_to_log($course->id, 'scorm', 'userreportinteractions', 'userreportinteractions.php?id='.$cm->id, $scorm->id, $cm->id);
|
||||
|
||||
// Trigger a user interactions viewed event.
|
||||
$event = \mod_scorm\event\interactions_viewed::create(array(
|
||||
'context' => $contextmodule,
|
||||
'relateduserid' => $userid,
|
||||
'other' => array('attemptid' => $attempt, 'instanceid' => $scorm->id)
|
||||
));
|
||||
$event->add_record_snapshot('course_modules', $cm);
|
||||
$event->add_record_snapshot('scorm', $scorm);
|
||||
$event->trigger();
|
||||
|
||||
$trackdata = $DB->get_records('scorm_scoes_track', array('userid' => $user->id, 'scormid' => $scorm->id,
|
||||
'attempt' => $attempt));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue