Переглянути джерело

Fixing additional bugs (first working version)

Yannick Warnier 15 роки тому
батько
коміт
7d4928b7a3
2 змінених файлів з 11 додано та 2 видалено
  1. 9 0
      main/newscorm/lp_ajax_switch_item.php
  2. 2 2
      main/newscorm/scorm_api.php

+ 9 - 0
main/newscorm/lp_ajax_switch_item.php

@@ -140,6 +140,15 @@ function switch_item_details($lp_id,$user_id,$view_id,$current_item,$next_item)
     if (!empty($myistring)) {
         $myistring = substr($myistring,1);
     }
+    /*
+     * The following lines should reinitialize the values for the SCO
+     * However, due to many complications, we are now relying more on the
+     * LMSInitialize() call and its underlying lp_ajax_initialize.php call
+     * so this code is technically deprecated (but the change of item_id should
+     * remain). However, due to numerous technical issues with SCORM, we prefer
+     * leaving it as a double-lock security. If removing, please test carefully
+     * with both SCORM and dokeos learning path tracking.
+     */ 
     $return .=
             "olms.score=".$myscore.";" .
             "olms.max=".$mymax.";" .

+ 2 - 2
main/newscorm/scorm_api.php

@@ -272,7 +272,7 @@ function LMSInitialize() {  //this is the initialize function of all APIobjects
                  + '<br />mastery_score   : '+ olms.mastery_score
                  + '<br />max_time_allowed: '+ olms.max_time_allowed+'<br />';
 	             
-        logit_scorm('LMSInitialise()'+log,0);
+        logit_scorm('LMSInitialize()'+log,0);
         olms.lms_initialized=1;
         return('true');
 	}
@@ -1466,7 +1466,7 @@ function xajax_save_item_scorm(lms_lp_id, lms_user_id, lms_view_id, lms_item_id)
 	for (k=0;k<my_scorm_values.length;k++) {
 		if (my_scorm_values[k]=='cmi.core.session_time') {
 			params += '&t='+olms.session_time;
-		} else if (my_scorm_values[k]=='cmi.core.lesson_status' && lesson_status!='') {
+		} else if (my_scorm_values[k]=='cmi.core.lesson_status' && olms.lesson_status!='') {
 			 params += '&status='+olms.lesson_status;
 		} else if (my_scorm_values[k]=='cmi.core.score.raw') {
 			 params += '&s='+olms.score;