diff --git a/app/Actions/Tabulation/CalculateScoreSheetTotalDivideByWeightedPossible.php b/app/Actions/Tabulation/CalculateScoreSheetTotalDivideByWeightedPossible.php index c13c223..55107bc 100644 --- a/app/Actions/Tabulation/CalculateScoreSheetTotalDivideByWeightedPossible.php +++ b/app/Actions/Tabulation/CalculateScoreSheetTotalDivideByWeightedPossible.php @@ -48,7 +48,11 @@ class CalculateScoreSheetTotalDivideByWeightedPossible implements CalculateScore $weightsTotal += $weight; $weightedMaxPossible += $maxPossible; } - $finalScore = ($scoreTotal / $weightedMaxPossible) * 100; + if ($weightedMaxPossible > 0) { + $finalScore = ($scoreTotal / $weightedMaxPossible) * 100; + } else { + $finalScore = 0; + } // put $final score at the beginning of the $ScoreArray array_unshift($scoreArray, $finalScore);