26 include_once
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Factory/ilAssLacOperationManufacturer.php';
27 include_once
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Factory/ilAssLacExpressionManufacturer.php';
37 if ($nodes[
'type'] ==
'group') {
38 foreach ($nodes[
'nodes'] as
$key => $child) {
42 foreach ($this->operators as $next_operator) {
45 for (
$i = 0;
$i < count($nodes[
'nodes']);
$i++) {
46 if (!is_object($nodes[
'nodes'][
$i]) && $nodes[
'nodes'][
$i][
'type'] ==
'operator' && $nodes[
'nodes'][
$i][
'value'] == $next_operator) {
53 $operator = $operation_manufacture->manufacture($nodes[
'nodes'][
$index][
'value']);
55 $operator->setNegated($nodes[
"negated"]);
59 $new_nodes = array_slice($nodes[
'nodes'], 0, $index - 1);
60 $new_nodes[] = $operator;
61 $nodes[
'nodes'] = array_merge($new_nodes, array_slice($nodes[
'nodes'], $index + 2));
65 return $nodes[
'nodes'][0];
83 $expression = $node[
'nodes'][
$index];
85 $expression = $manufacturer->manufacture($node[
'nodes'][
$index][
'value']);
__construct()
Construct requirements.
static _getInstance()
Get an Instance of ExpressionManufacturer.
Create styles array
The data for the language used.
static _getInstance()
Get an Instance of OperationManufacturer.
getExpression(array $node, $index)
Manufacure an expression from the delivered node and the index.