mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-43079 quiz statistics : fix stats graph when all grades zero
This commit is contained in:
parent
f7434db109
commit
34292e218d
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue