MDL-40056 events: Replace old add_to_log calls with new events

This commit is contained in:
Ankit Agarwal 2014-01-07 14:10:20 +08:00
parent 25e8023d3d
commit 0a61619043
13 changed files with 80 additions and 18 deletions

View file

@ -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));