فهرست منبع

Fix php warning

jmontoyaa 8 سال پیش
والد
کامیت
4910db2632
1فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 5 2
      main/lp/learnpath.class.php

+ 5 - 2
main/lp/learnpath.class.php

@@ -10699,8 +10699,11 @@ EOD;
                     continue;
                 }
 
-                $exerciseResult = $exerciseResultInfo['exe_result'] * 100 / $exerciseResultInfo['exe_weighting'];
-
+                if (!empty($exerciseResultInfo['exe_weighting'])) {
+                    $exerciseResult = $exerciseResultInfo['exe_result'] * 100 / $exerciseResultInfo['exe_weighting'];
+                } else {
+                    $exerciseResult = 0;
+                }
                 $totalResult += $exerciseResult;
             }