Index: mod/scorm/locallib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/scorm/locallib.php,v
retrieving revision 1.46.2.13
diff -u -r1.46.2.13 locallib.php
--- mod/scorm/locallib.php	22 Aug 2008 03:21:52 -0000	1.46.2.13
+++ mod/scorm/locallib.php	23 Aug 2008 08:26:52 -0000
@@ -263,10 +263,14 @@
     }
     
     // MDL-9552, update the gradebook everything raw score is sent
-    if (strstr($element, '.score.raw')) {
+    if (strstr($element, '.score.raw') || 
+        (($element == 'cmi.core.lesson_status' || $element == 'cmi.completion_status') && ($track->value == 'completed' || $track->value == 'passed'))) {
         $scorm = get_record('scorm', 'id', $scormid);
-        include_once('lib.php');
-        scorm_update_grades($scorm, $userid);    
+        $grademethod = $scorm->grademethod % 10;
+        if (strstr($element, '.score.raw') || $grademethod == GRADESCOES) {
+            include_once('lib.php');
+            scorm_update_grades($scorm, $userid);
+        }
     }
     
     return $id;

