Merge branch 'm31_MDL-48680_Add_Score_Status_Events' of git://github.com/scara/moodle

This commit is contained in:
David Monllao
2016-03-17 16:34:44 +08:00
+7
View File
@@ -567,6 +567,13 @@ function scorm_insert_track($userid, $scormid, $scoid, $attempt, $element, $valu
// Create status submitted event.
$event = \mod_scorm\event\status_submitted::create($data);
}
// Fix the missing track keys when the SCORM track record already exists, see $trackdata in datamodel.php.
// There, for performances reasons, columns are limited to: element, id, value, timemodified.
// Missing fields are: userid, scormid, scoid, attempt.
$track->userid = $userid;
$track->scormid = $scormid;
$track->scoid = $scoid;
$track->attempt = $attempt;
// Trigger submitted event.
$event->add_record_snapshot('scorm_scoes_track', $track);
$event->add_record_snapshot('course_modules', $cm);