Skip to content
Browse files

Merge branch 'MDL-28202_20' of git://github.com/timhunt/moodle into M…

…OODLE_20_STABLE
  • Loading branch information...
2 parents e60ca69 + 9d19a2b commit aa114967bb41111facae2e17da5aec264e9897c6 @stronk7 stronk7 committed Sep 26, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 question/type/calculated/questiontype.php
View
6 question/type/calculated/questiontype.php
@@ -2231,6 +2231,12 @@ function qtype_calculated_calculate_answer($formula, $individualdata,
// ... and have the answer rounded of to the correct length
$answer = round($answer, $answerlength);
+ //if we rounded up to 1.0, place the answer back into 0.[1-9][0-9]* format
+ if ($answer >= 1) {
+ ++$p10;
+ $answer /= 10;
+ }
+
// Have the answer written on a suitable format,
// Either scientific or plain numeric
if (-2 > $p10 || 4 < $p10) {

0 comments on commit aa11496

Please sign in to comment.
Something went wrong with that request. Please try again.