Skip to content

Commit

Permalink
MDL-57324 scorm: exclude objective raw.score from grade update
Browse files Browse the repository at this point in the history
  • Loading branch information
danmarsden committed Dec 8, 2016
1 parent e6cb76d commit 936030d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mod/scorm/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ function scorm_insert_track($userid, $scormid, $scoid, $attempt, $element, $valu

// Trigger updating grades based on a given set of SCORM CMI elements.
$scorm = false;
if (strstr($element, '.score.raw') ||
if (in_array($element, array('cmi.core.score.raw', 'cmi.score.raw')) ||
(in_array($element, array('cmi.completion_status', 'cmi.core.lesson_status', 'cmi.success_status'))
&& in_array($track->value, array('completed', 'passed')))) {
$scorm = $DB->get_record('scorm', array('id' => $scormid));
Expand All @@ -547,7 +547,7 @@ function scorm_insert_track($userid, $scormid, $scoid, $attempt, $element, $valu
}

// Trigger CMI element events.
if (strstr($element, '.score.raw') ||
if (in_array($element, array('cmi.core.score.raw', 'cmi.score.raw')) ||
(in_array($element, array('cmi.completion_status', 'cmi.core.lesson_status', 'cmi.success_status'))
&& in_array($track->value, array('completed', 'failed', 'passed')))) {
if (!$scorm) {
Expand All @@ -560,7 +560,7 @@ function scorm_insert_track($userid, $scormid, $scoid, $attempt, $element, $valu
'context' => context_module::instance($cm->id),
'relateduserid' => $userid
);
if (strstr($element, '.score.raw')) {
if (in_array($element, array('cmi.core.score.raw', 'cmi.score.raw'))) {
// Create score submitted event.
$event = \mod_scorm\event\scoreraw_submitted::create($data);
} else {
Expand Down

0 comments on commit 936030d

Please sign in to comment.