Browse Source

[svn r12966] Added switch on mastery_score to adopt SCORM 1.2 recommandation fully (to support mastery_score, the LMS must be able change the status of the sco according to the real score)

Yannick Warnier 17 years ago
parent
commit
0521427c00
1 changed files with 8 additions and 1 deletions
  1. 8 1
      main/newscorm/scorm_api.php

+ 8 - 1
main/newscorm/scorm_api.php

@@ -497,9 +497,16 @@ function SetValue(param, val) {
 
 function savedata(origin) { //origin can be 'commit', 'finish' or 'terminate'
     <?php if ($autocomplete_when_80pct){ ?>
-    if( ( lesson_status == 'incomplete') && (score >= (0.8*max) ) ){
+    if ((lesson_status != 'completed') && (lesson_status != 'passed') 
+    	&& (mastery_score >=0) && (score >= mastery_score))
+    {
+      lesson_status = 'passed';
+    }
+    else if( (mastery_score < 0) && ( lesson_status == 'incomplete') && (score >= (0.8*max) ) )
+    {
       lesson_status = 'completed';
     }
+    	
     <?php }?>
     /*param = 'id='+lms_item_id+'&origin='+origin+'&score='+score+'&max='+max+'&min='+min+'&lesson_status='+lesson_status+'&time='+session_time+'&suspend_data='+suspend_data;