Skip to content
Snippets Groups Projects
Commit b1fe6fdc authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

fix term parser, fixes #69

parent f076ef3b
No related branches found
No related tags found
No related merge requests found
...@@ -1627,6 +1627,7 @@ class qtype_algebra_parser { ...@@ -1627,6 +1627,7 @@ class qtype_algebra_parser {
// Check whether the precedding argument (if there is one) is a number or // Check whether the precedding argument (if there is one) is a number or
// a variable. In either case this is a addition/subtraction operation so we continue // a variable. In either case this is a addition/subtraction operation so we continue
if($i>0 and (is_a($tree[$i-1],'qtype_algebra_parser_variable') or if($i>0 and (is_a($tree[$i-1],'qtype_algebra_parser_variable') or
is_a($tree[$i-1],'qtype_algebra_parser_special') or
is_a($tree[$i-1],'qtype_algebra_parser_number') or is_a($tree[$i-1],'qtype_algebra_parser_number') or
is_a($tree[$i-1],'qtype_algebra_parser_bracket'))) { is_a($tree[$i-1],'qtype_algebra_parser_bracket'))) {
continue; continue;
......
...@@ -50,7 +50,7 @@ class me_exercise extends Exercise ...@@ -50,7 +50,7 @@ class me_exercise extends Exercise
$this->task['variables'] = []; $this->task['variables'] = [];
foreach ($request['var'] as $i => $var) { foreach ($request['var'] ?: [] as $i => $var) {
if (trim($var) != '') { if (trim($var) != '') {
$this->task['variables'][] = [ $this->task['variables'][] = [
'name' => trim($var), 'name' => trim($var),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment