From 29005a5418894b76e62e44bbc2c9e4ddee8f5ce6 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 26 Jun 2014 10:51:28 +0100 Subject: [PATCH] MDL-46148 qtype_calculated: Remove unused function. --- question/type/calculated/question.php | 101 +------------------------- 1 file changed, 2 insertions(+), 99 deletions(-) diff --git a/question/type/calculated/question.php b/question/type/calculated/question.php index 71b25a6790b..942f0e0b76b 100644 --- a/question/type/calculated/question.php +++ b/question/type/calculated/question.php @@ -465,108 +465,11 @@ class qtype_calculated_variable_substituter { * @return string the text with values substituted. */ public function replace_expressions_in_text($text, $length = null, $format = null) { - $vs = $this; // Can't see to use $this in a PHP closure. + $vs = $this; // Can't use $this in a PHP closure. $text = preg_replace_callback('~\{=([^{}]*(?:\{[^{}]+}[^{}]*)*)}~', function ($matches) use ($vs, $format, $length) { return $vs->format_float($vs->calculate($matches[1]), $length, $format); }, $text); return $this->substitute_values_pretty($text); } - - /** - * Return an array describing any problems there are with an expression. - * Returns false if the expression is fine. - * @param string $formula an expression. - * @return array|false list of problems, or false if the exression is OK. - */ - public function get_formula_errors($formula) { - // Validates the formula submitted from the question edit page. - // Returns false if everything is alright - // otherwise it constructs an error message. - // Strip away dataset names. - while (preg_match('~\\{[[:alpha:]][^>} <{"\']*\\}~', $formula, $regs)) { - $formula = str_replace($regs[0], '1', $formula); - } - - // Strip away empty space and lowercase it. - $formula = strtolower(str_replace(' ', '', $formula)); - - $safeoperatorchar = '-+/*%>:^\~