From ddb061f88f3958ea17701090774d1f582376a348 Mon Sep 17 00:00:00 2001 From: Jean-Michel Vedrine Date: Mon, 1 Jan 2018 19:19:33 +0100 Subject: Fix bug in parser equals function --- parser.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parser.php b/parser.php index 05440a7..0b08bb7 100644 --- a/parser.php +++ b/parser.php @@ -1083,7 +1083,7 @@ class qtype_algebra_parser_special extends qtype_algebra_parser_term { * constant which is defined by an internal switch based on the constant's name. * * @param $params array of values keyed by variable name - * @return the numerical value of the term given the provided values for the variables + * @return int the numerical value of the term given the provided values for the variables */ public function evaluate($params) { if ($this->_sign == '-') { @@ -1127,7 +1127,7 @@ class qtype_algebra_parser_special extends qtype_algebra_parser_term { public function equals($expr) { // Call the default method first to check type. if (parent::equals($expr)) { - return $this->_value == $expr->_value and $this->_sign == $this->_sign; + return $this->_value == $expr->_value and $this->_sign == $expr->_sign; } else { return false; } @@ -1280,7 +1280,7 @@ class qtype_algebra_parser_function extends qtype_algebra_parser_term { public function equals($expr) { // Call the default method first to check type. if (parent::equals($expr)) { - return $this->_value == $expr->_value and $this->_sign == $this->_sign; + return $this->_value == $expr->_value and $this->_sign == $expr->_sign; } else { return false; } -- cgit v1.2.3