]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18051: Fixed errors in evalmath when using grade expressions that begin with...
authorsam_marshall <sam_marshall>
Thu, 21 May 2009 11:54:43 +0000 (11:54 +0000)
committersam_marshall <sam_marshall>
Thu, 21 May 2009 11:54:43 +0000 (11:54 +0000)
lib/evalmath/evalmath.class.php

index 84a74488b6d765f47d0a9b0ddd05a1d861f5e5bf..5af83986bccc711c8c049553d553f440500deb15 100644 (file)
@@ -422,7 +422,10 @@ class EvalMathStack {
     }
     
     function last($n=1) {
-        return $this->stack[$this->count-$n];
+        if ($this->count - $n >= 0) {
+            return $this->stack[$this->count-$n];
+        }
+        return null;
     }
 }