From 3aa159706cd97b076e6c95f7569ab6b7107bc50a Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Tue, 28 Jun 2011 17:34:24 +0100 Subject: [PATCH] MDL-27418 fix typo I really should refactor to eliminate this duplicated code. --- question/type/calculated/db/upgradelib.php | 2 +- question/type/calculated/question.php | 2 +- question/type/calculatedmulti/db/upgradelib.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/question/type/calculated/db/upgradelib.php b/question/type/calculated/db/upgradelib.php index 36fe3712727..c3db14ca4c3 100644 --- a/question/type/calculated/db/upgradelib.php +++ b/question/type/calculated/db/upgradelib.php @@ -207,7 +207,7 @@ class qtype_calculated_qe2_attempt_updater extends question_qtype_attempt_update * @param $x */ public function format_float($x, $length = null, $format = null) { - if (!is_null($format) && !is_null($format)) { + if (!is_null($length) && !is_null($format)) { if ($format == 1) { // Decimal places. $x = sprintf('%.' . $length . 'F', $x); diff --git a/question/type/calculated/question.php b/question/type/calculated/question.php index 66f2e9afbd1..b89b9c8a6f3 100644 --- a/question/type/calculated/question.php +++ b/question/type/calculated/question.php @@ -310,7 +310,7 @@ class qtype_calculated_variable_substituter { * @param $x */ public function format_float($x, $length = null, $format = null) { - if (!is_null($format) && !is_null($format)) { + if (!is_null($length) && !is_null($format)) { if ($format == 1) { // Decimal places. $x = sprintf('%.' . $length . 'F', $x); diff --git a/question/type/calculatedmulti/db/upgradelib.php b/question/type/calculatedmulti/db/upgradelib.php index 5bd757968ef..8dd51ba55b6 100644 --- a/question/type/calculatedmulti/db/upgradelib.php +++ b/question/type/calculatedmulti/db/upgradelib.php @@ -231,7 +231,7 @@ class qtype_calculatedmulti_qe2_attempt_updater extends question_qtype_attempt_u * @param $x */ public function format_float($x, $length = null, $format = null) { - if (!is_null($format) && !is_null($format)) { + if (!is_null($length) && !is_null($format)) { if ($format == 1) { // Decimal places. $x = sprintf('%.' . $length . 'F', $x);