diff options
Diffstat (limited to 'parser.php')
-rw-r--r-- | parser.php | 25 |
1 files changed, 17 insertions, 8 deletions
@@ -1378,15 +1378,24 @@ class qtype_algebra_parser_bracket extends qtype_algebra_parser_term { // Static class properties. const NARGS = 1; private static $formats = array( - '(' => array('str' => '(%s)', - 'tex' => '\\left( %s \\right)'), - '[' => array('str' => '[%s]', - 'tex' => '\\left[ %s \\right]'), - '{' => array('str' => '{%s}', - 'tex' => '\\left\\lbrace %s \\right\\rbrace'), - '<' => array('str' => '(%s)', - 'tex' => '{%s}') + '(' => array('str' => '%s(%s)', + 'tex' => '%s\\left( %s \\right)'), + '[' => array('str' => '%s[%s]', + 'tex' => '%s\\left[ %s \\right]'), + '{' => array('str' => '%s{%s}', + 'tex' => '%s\\left\\lbrace %s \\right\\rbrace'), + '<' => array('str' => '%s(%s)', + 'tex' => '%s{%s}') ); + + public function print_args($method) { + $args = array($this->_sign); + foreach ($this->_arguments as $arg) { + $args[] = $arg->$method(); + } + // Return the array of arguments. + return $args; + } } |