Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-43079 quiz statistics : fix stats graph when all grades zero

  • Loading branch information...
commit 7ef639c709b122be34a2792c510cf94fcd57eb50 1 parent cb891e5
@jamiepratt jamiepratt authored stronk7 committed
Showing with 6 additions and 0 deletions.
  1. +6 −0 mod/quiz/report/statistics/statistics_graph.php
View
6 mod/quiz/report/statistics/statistics_graph.php
@@ -146,6 +146,12 @@
$gridresolution = 10;
$max = ceil($max / $gridresolution) * $gridresolution;
$min = floor($min / $gridresolution) * $gridresolution;
+
+if ($max == $min) {
+ // Make sure there is some difference between min and max y values.
+ $max = $min + $gridresolution;
+}
+
$gridlines = ceil(($max - $min) / $gridresolution) + 1;
$graph->parameter['y_axis_gridlines'] = $gridlines;
Please sign in to comment.
Something went wrong with that request. Please try again.