From c4f7eecfc5d11e45e9ecb1aaf5372208a9c95157 Mon Sep 17 00:00:00 2001 From: jamiepratt Date: Mon, 11 Apr 2011 21:10:25 +0700 Subject: [PATCH] MDL-27139 "mathslib used by gradebook incorrectly evaluating expressions" simple fix needed to prevent problem with operator following expression with no operands such as pi(). --- lib/evalmath/evalmath.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/evalmath/evalmath.class.php b/lib/evalmath/evalmath.class.php index 9bddc50eac2..ae398715e4e 100644 --- a/lib/evalmath/evalmath.class.php +++ b/lib/evalmath/evalmath.class.php @@ -291,6 +291,7 @@ class EvalMath { return $this->trigger("wrong number of arguments ($arg_count given, " . implode('/',$this->fc[$fnn]) . " expected)"); $output[] = array('fn'=>$fn, 'fnn'=>$fnn, 'argcount'=>0); // send function to output $index++; + $expecting_op = true; } else { return $this->trigger("unexpected ')'"); }