mirror of
https://github.com/moodle/moodle.git
synced 2025-08-11 11:56:40 +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
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue