Permalink
Browse files

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

  • Loading branch information...
jamiepratt committed Nov 27, 2013
1 parent 20776b4 commit d8ca0c903c0c034bd704da0f7ca5d845e6dc973a
Showing with 6 additions and 0 deletions.
  1. +6 −0 mod/quiz/report/statistics/statistics_graph.php
@@ -153,6 +153,12 @@ function graph_get_new_colour() {
$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;

0 comments on commit d8ca0c9

Please sign in to comment.