Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f7434db
)
MDL-43079 quiz statistics : fix stats graph when all grades zero
author
James Pratt
<me@jamiep.org>
Wed, 27 Nov 2013 05:49:19 +0000
(12:49 +0700)
committer
James Pratt
<me@jamiep.org>
Wed, 27 Nov 2013 10:50:05 +0000
(17:50 +0700)
mod/quiz/report/statistics/statistics_graph.php
patch
|
blob
|
blame
|
history
diff --git
a/mod/quiz/report/statistics/statistics_graph.php
b/mod/quiz/report/statistics/statistics_graph.php
index
de6a3f0
..
9830c0f
100644
(file)
--- a/
mod/quiz/report/statistics/statistics_graph.php
+++ b/
mod/quiz/report/statistics/statistics_graph.php
@@
-146,6
+146,12
@@
foreach ($fieldstoplot as $fieldtoplot => $notused) {
$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;