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

@ -113,7 +113,14 @@ $strscorm = get_string("modulename", "scorm");
$shortname = format_string($course->shortname, true, array('context' => $context));
$pagetitle = strip_tags($shortname.': '.format_string($scorm->name));
add_to_log($course->id, 'scorm', 'pre-view', 'view.php?id='.$cm->id, "$scorm->id", $cm->id);
// Trigger module viewed event.
$event = \mod_scorm\event\course_module_viewed::create(array(
'objectid' => $scorm->id,
'context' => $contextmodule,
));
$event->add_record_snapshot('scorm', $scorm);
$event->add_record_snapshot('course_modules', $cm);
$event->trigger();
if (empty($launch) && (has_capability('mod/scorm:skipview', $contextmodule))) {
scorm_simple_play($scorm, $USER, $contextmodule, $cm->id);