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

@ -159,7 +159,16 @@ if (scorm_external_link($sco->launch)) {
$result = "$CFG->wwwroot/pluginfile.php/$context->id/mod_scorm/content/$scorm->revision/$launcher";
}
add_to_log($course->id, 'scorm', 'launch', 'view.php?id='.$cm->id, $result, $cm->id);
// Trigger a Sco launched event.
$event = \mod_scorm\event\sco_launched::create(array(
'objectid' => $sco->id,
'context' => $context,
'other' => array('instanceid' => $scorm->id, 'loadedcontent' => $result)
));
$event->add_record_snapshot('course_modules', $cm);
$event->add_record_snapshot('scorm', $scorm);
$event->add_record_snapshot('scorm_scoes', $sco);
$event->trigger();
header('Content-Type: text/html; charset=UTF-8');