From 9fb9dac1272bdcd33d2223239593fd3c73ac90c3 Mon Sep 17 00:00:00 2001 From: trobb Date: Tue, 23 Dec 2003 13:41:27 +0000 Subject: [PATCH] Possible division by 0 fixed with if branch line 132 --- mod/quiz/report/fullstat/report.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mod/quiz/report/fullstat/report.php b/mod/quiz/report/fullstat/report.php index d5e76f57d7..5bc0cf9c9c 100755 --- a/mod/quiz/report/fullstat/report.php +++ b/mod/quiz/report/fullstat/report.php @@ -129,7 +129,11 @@ $string[''] = ""; // //print_object($thisattempt); $reportline++; $data_tally[$reportline][$thisattempt['attemptid']][] = $thisattempt['name']; - $data_tally[$reportline][$thisattempt['attemptid']][] =round(($thisattempt['grade']/$quiz->sumgrades)*100,0); + if ($quiz->sumgrades > 0) { + $data_tally[$reportline][$thisattempt['attemptid']][] =round(($thisattempt['grade']/$quiz->sumgrades)*100,0); + } else { + $data_tally[$reportline][$thisattempt['attemptid']][] = 0; + } //now for each question, record response as it should be printed and whether right, wrong or skipped //SHORTASNSWER the answer as in $userdata; TF or MULTI need response looked by from cid from $quests //MATCH needs elaborate processing -- 2.39.5