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) {
108 $this->
validateClozeTest($answer_index, $question, $answer_expression, $question_index);
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()) {
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();
Class for horizontal ordering questions.
Class for ordering questions.
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...
validateSubTree(ilAssLacAbstractComposite $composite)
validateClozeTest($answer_index, $question, $answer_expression, $question_index)
isResultOfAnswerExpression($expression)
__construct($object_loader)
validate(ilAssLacAbstractComposite $composite)
checkQuestionExists($question, $index)
checkAnswerExpressionExist($expressions, $answer_expression, $question_index)
checkOperatorExistForExpression($operators, $answer_expression, $pattern)
checkIfAnswerIndexOfQuestionExists($question, $question_index, $answer_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...
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.