[svn r17290] minor - style changes - eliminated error : division by zero - (partial FS#3249)

skala
Isaac Flores 16 years ago
parent 8b30a7db27
commit 848b9b7544
  1. 7
      main/gradebook/lib/be/category.class.php

@ -24,7 +24,7 @@
*/
/**
* Defines a gradebook Category object
* @author Bert Steppé, Stijn Konings
* @author Bert Stepp<EFBFBD>, Stijn Konings
* @package dokeos.gradebook
*/
class Category implements GradebookItem
@ -483,10 +483,11 @@ class Category implements GradebookItem
foreach ($links as $link) {
$linkres = $link->calc_score ($stud_id);
if (isset($linkres) && $link->get_weight() != 0) {
$linkweight = $link->get_weight();
$linkweight = $link->get_weight();
$link_res_denom = ($linkres[1]==0) ? 1 : $linkres[1];
$rescount++;
$weightsum += $linkweight;
$ressum += (($linkres[0]/$linkres[1]) * $linkweight);
$ressum += (($linkres[0]/$link_res_denom) * $linkweight);
}
}

Loading…
Cancel
Save