MDL-16111 - SCORM grade not updated in Grader Report. Include grading by learning objects if status is complete.

This commit is contained in:
piers 2008-08-24 21:10:09 +00:00
parent cfcb7a17cb
commit a0b366843b

View file

@ -249,11 +249,16 @@ function scorm_insert_track($userid,$scormid,$scoid,$attempt,$element,$value) {
} }
// MDL-9552, update the gradebook everything raw score is sent // MDL-9552, update the gradebook everything raw score is sent
if (strstr($element, '.score.raw')) { // Scoring by learning objects also needs to be included in the gradebook update
if (strstr($element, '.score.raw') ||
(($element == 'cmi.core.lesson_status' || $element == 'cmi.completion_status') && ($track->value == 'completed' || $track->value == 'passed'))) {
$scorm = $DB->get_record('scorm', array('id' => $scormid)); $scorm = $DB->get_record('scorm', array('id' => $scormid));
$grademethod = $scorm->grademethod % 10;
if (strstr($element, '.score.raw') || $grademethod == GRADESCOES) {
include_once('lib.php'); include_once('lib.php');
scorm_update_grades($scorm, $userid); scorm_update_grades($scorm, $userid);
} }
}
return $id; return $id;
} }