47 $this->randomGroup = $DIC->refinery()->random();
52 if (count($composite->nodes) > 0) {
53 $this->
validate($composite->nodes[0]);
54 $this->
validate($composite->nodes[1]);
66 $question_expression = $composite->nodes[0];
67 $answer_expression = $composite->nodes[1];
68 $question_index = $composite->nodes[0]->getQuestionIndex();
70 $question = $this->object_loader->getQuestion($question_index);
76 $answer_index = $question_expression->getAnswerIndex() - 1;
93 foreach ($answer_expression->getOrdering() as $order) {
95 foreach ($answer_expression->getOrdering() as $element) {
96 if ($element == $order) {
107 if ($question instanceof assClozeTest) {
108 $this->
validateClozeTest($answer_index, $question, $answer_expression, $question_index);
121 ($composite->nodes[0] instanceof ilAssLacExpressionInterface &&
123 ($composite->nodes[0] instanceof ilAssLacSolutionExpressionInterface)
137 private function validateClozeTest($answer_index, $question, $answer_expression, $question_index): void
139 if ($answer_index !== null) {
140 $options = $question->getAvailableAnswerOptions($answer_index);
142 switch ($options->getType()) {
153 if ($answer_expression instanceof ilAssLacStringResultExpression) {
154 foreach ($options->getItems($this->getNonShuffler()) as $item) {
155 if ($item->getAnswertext() == $answer_expression->getText()) {
160 foreach ($options->getItems($question->getShuffler()) as $item) {
161 if ($item->getOrder() == $answer_expression->getNumericValue() - 1) {
192 $answer_options = $question->getAvailableAnswerOptions($answer_index);
193 if ($answer_options == null) {
206 if ($question == null) {
240 if (!in_array($answer_expression::$identifier, $expressions)) {
254 if (!in_array($pattern, $operators)) {
261 return $this->randomGroup->dontShuffle();
checkOperatorExistForExpression($operators, $answer_expression, $pattern)
validate(ilAssLacAbstractComposite $composite)
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
validateClozeTest($answer_index, $question, $answer_expression, $question_index)
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
validateSubTree(ilAssLacAbstractComposite $composite)
__construct($object_loader)
checkAnswerExpressionExist($expressions, $answer_expression, $question_index)
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...
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isResultOfAnswerExpression($expression)
checkQuestionExists($question, $index)
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...
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...
checkIfAnswerIndexOfQuestionExists($question, $question_index, $answer_index)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...