From 19e7f33384831997dbe8917e33a26aece5f7d3d6 Mon Sep 17 00:00:00 2001 From: skodak Date: Sat, 26 May 2007 13:11:54 +0000 Subject: [PATCH] MDL-9643 some more polishing --- lib/mathslib.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/mathslib.php b/lib/mathslib.php index 3eb9cb41a4..07112d34d0 100644 --- a/lib/mathslib.php +++ b/lib/mathslib.php @@ -13,7 +13,7 @@ class calc_formula { // private properties var $_em; - var $_nfx = false; // postfix expression + var $_nfx = false; // postfix notation var $_error = false; // last error /** @@ -26,7 +26,7 @@ class calc_formula { $this->_em = new EvalMath(); $this->_em->suppress_errors = true; if (strpos($formula, '=') !== 0) { - $this->_error = "missing '='"; + $this->_error = "missing leading '='"; return; } $formula = substr($formula, 1); @@ -45,9 +45,10 @@ class calc_formula { } /** - * Raplace parameters used in calculation + * Raplace parameters used in existing formula, + * parameter names must contain only lowercase [a-z] letters, no other characters are allowed! * - * @param array $params associative array of parameters used in formula. All parameter names must be lowercase! + * @param array $params associative array of parameters used in formula */ function set_params($params) { $this->_em->v = $params; @@ -70,13 +71,11 @@ class calc_formula { $this->_error = false; return $res; } - } /** * Get last error. - * - * TODO: localize the strings + * TODO: localize the strings from contructor and EvalMath library * * @return mixed string with last error description or false if ok */ -- 2.39.5