Permalink
Browse files

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

  • Loading branch information...
1 parent 7183b0f commit 5267a0519133ca447f8d56c1d2aa0eb158ede0bf @jamiepratt jamiepratt committed with stronk7 Nov 27, 2013
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 5267a05

Please sign in to comment.