From 1efa93020249e0453783c862ae5e9fdecdbdeeaf Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Wed, 30 Oct 2013 10:47:53 +0800 Subject: [PATCH] MDL-42604 scorm: Fix division by zero warnings in error logs --- mod/scorm/report/graphs/graph.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/scorm/report/graphs/graph.php b/mod/scorm/report/graphs/graph.php index 3d9b7f44032..474db2a9747 100644 --- a/mod/scorm/report/graphs/graph.php +++ b/mod/scorm/report/graphs/graph.php @@ -168,7 +168,7 @@ while ($gridlines >= 10) { $gridlines /= 2; } } - -$line->parameter['y_axis_gridlines'] = $gridlines + 1; +$gridlines = max(2, ($gridlines + 1)); // We need a minimum of two lines. +$line->parameter['y_axis_gridlines'] = $gridlines; $line->draw();