aboutsummaryrefslogtreecommitdiff
path: root/parser.php
diff options
context:
space:
mode:
Diffstat (limited to 'parser.php')
-rw-r--r--parser.php25
1 files changed, 17 insertions, 8 deletions
diff --git a/parser.php b/parser.php
index 0efc21b..4423c38 100644
--- a/parser.php
+++ b/parser.php
@@ -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;
+ }
}