]> git.mjollnir.org Git - moodle.git/commitdiff
Avoid some division by 9 warnings when showing anonymously
authorstronk7 <stronk7>
Sun, 14 Mar 2004 01:22:28 +0000 (01:22 +0000)
committerstronk7 <stronk7>
Sun, 14 Mar 2004 01:22:28 +0000 (01:22 +0000)
and no answers have been introduced.

mod/choice/view.php

index 2329b60119073c07947b5af6702b1638c810cceb..05c92e05e2a9420fad13e510ebc31454d952f08e 100644 (file)
                 if (!$key and !$choice->showunanswered) {
                     continue;
                 }
-                $height = $COLUMN_HEIGHT * ((float)$column[$key] / (float)$maxcolumn);
+                $height = 0;
+                if ($maxcolumn) {
+                    $height = $COLUMN_HEIGHT * ((float)$column[$key] / (float)$maxcolumn);
+                }
                 echo "<td valign=\"bottom\" align=\"center\">";
                 echo "<img src=\"column.png\" height=\"$height\" width=\"49\">";
                 echo "</td>";