MDL-9552, update the gradebook everytime score is sent

This commit is contained in:
toyomoyo
2007-11-05 07:29:59 +00:00
parent dd861fbc33
commit 31248c5d9c
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -461,7 +461,7 @@ function scorm_update_grades($scorm=null, $userid=0, $nullifnone=true) {
if ($scorm != null) {
if ($grades = scorm_get_user_grades($scorm, $userid)) {
grade_update('mod/scorm', $scorm->course, 'mod', 'scorm', $scorm->id, 0, $grades);
grade_update('mod/scorm', $scorm->course, 'mod', 'scorm', $scorm->id, 0, $grades[$userid]);
} else if ($userid and $nullifnone) {
$grade = new object();
+8
View File
@@ -237,6 +237,14 @@ function scorm_insert_track($userid,$scormid,$scoid,$attempt,$element,$value) {
$track->timemodified = time();
$id = insert_record('scorm_scoes_track',$track);
}
// MDL-9552, update the gradebook everything raw score is sent
if (strstr($element, '.score.raw')) {
$scorm = get_record('scorm', 'id', $scormid);
include_once('lib.php');
scorm_update_grades($scorm, $userid);
}
return $id;
}