Browse Source

Added line to avoid fatal error when leaving learning path. Not sure if this is the right method to improve the quality of tracking, but at least avoiding fatal error (related to CT#1413)

Yannick Warnier 14 years ago
parent
commit
fd85b5e710
1 changed files with 2 additions and 2 deletions
  1. 2 2
      main/newscorm/lp_ajax_save_item.php

+ 2 - 2
main/newscorm/lp_ajax_save_item.php

@@ -3,7 +3,7 @@
  * This script contains the server part of the xajax interaction process. The client part is located
  * in lp_api.php or other api's.
  * This is a first attempt at using xajax and AJAX in general, so the code might be a bit unsettling.
- * @package dokeos.learnpath
+ * @package chamilo.learnpath
  * @author Yannick Warnier <ywarnier@beeznest.org>
  */
 /**
@@ -60,7 +60,7 @@ function save_item($lp_id,$user_id,$view_id,$item_id,$score=-1,$max=-1,$min=-1,$
         }
     }
     //$objResponse->addAlert(api_get_path(REL_CODE_PATH).'newscorm/learnpathItem.class.php');
-
+    if (!is_a($mylp,'learnpath')) { return ''; }
 
     $prereq_check = $mylp->prerequisites_match($item_id);
     if($prereq_check === true) //launch the prerequisites check and set error if needed