34 protected $operators = array(
'<=',
'<',
'=',
'>=',
'>',
'<>',
'&',
'|');
41 include_once
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Factory/ilAssLacOperationManufacturer.php';
42 include_once
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Factory/ilAssLacExpressionManufacturer.php';
64 if ($nodes[
'type'] ==
'group') {
65 foreach ($nodes[
'nodes'] as
$key => $child) {
66 if ($child[
'type'] ==
'group') {
71 foreach ($this->operators as $next_operator) {
74 for (
$i = 0;
$i < count($nodes[
'nodes']);
$i++) {
75 if (!is_object($nodes[
'nodes'][
$i]) && $nodes[
'nodes'][
$i][
'type'] ==
'operator' && $nodes[
'nodes'][
$i][
'value'] == $next_operator) {
82 $operator = $operation_manufacture->manufacture($nodes[
'nodes'][
$index][
'value']);
84 $operator->setNegated($nodes[
"negated"]);
88 $new_nodes = array_slice($nodes[
'nodes'], 0, $index - 1);
89 $new_nodes[] = $operator;
90 $nodes[
'nodes'] = array_merge($new_nodes, array_slice($nodes[
'nodes'], $index + 2));
94 return $nodes[
'nodes'][0];
97 'need node structure with type group as input');
113 $expression = $node[
'nodes'][
$index];
115 $expression = $manufacturer->manufacture($node[
'nodes'][
$index][
'value']);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct()
Construct requirements.
create(array $nodes)
Creates a composite tree structure from a nodes tree.
static _getInstance()
Get an Instance of ExpressionManufacturer.
static _getInstance()
Get an Instance of OperationManufacturer.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getExpression(array $node, $index)
Manufacure an expression from the delivered node and the index.