瀏覽代碼

fixed avoid division by zero BT#540

Carlos Vargas 15 年之前
父節點
當前提交
ad430e9bf4
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      main/inc/lib/tracking.lib.php

+ 3 - 1
main/inc/lib/tracking.lib.php

@@ -483,8 +483,10 @@ class Tracking {
 		                    }
 		                    }
 							$count_items++;
 							$count_items++;
 						}
 						}
-						$score_of_scorm_calculate += round((($lp_scorm_result_score_total/$count_items)*100),2);
+						
+						$score_of_scorm_calculate += $count_items?round((($lp_scorm_result_score_total/$count_items)*100),2):0;						
                         $count_views++;
                         $count_views++;
+                        
 					}
 					}
 				}
 				}