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 5267a0519133ca447f8d56c1d2aa0eb158ede0bf 1 parent 7183b0f
@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
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.