Skip to content
Browse files

Possible division by 0 fixed with if branch line 132

  • Loading branch information...
1 parent 24157e9 commit 9fb9dac1272bdcd33d2223239593fd3c73ac90c3 trobb committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 mod/quiz/report/fullstat/report.php
View
6 mod/quiz/report/fullstat/report.php
@@ -129,7 +129,11 @@ function display($quiz, $cm, $course) { /// This function just displays the
// //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

0 comments on commit 9fb9dac

Please sign in to comment.
Something went wrong with that request. Please try again.