47 $this->randomGroup =
$DIC->refinery()->random();
55 if ($composite->nodes !== []) {
56 $this->
validate($composite->nodes[0]);
57 $this->
validate($composite->nodes[1]);
67 $question_expression = $composite->nodes[0];
68 $answer_expression = $composite->nodes[1];
69 $question_index = $composite->nodes[0]->getQuestionIndex();
71 $question = $this->object_loader->getQuestion();
77 $answer_index = $question_expression->getAnswerIndex() - 1;
94 foreach ($answer_expression->getOrdering() as $order) {
96 foreach ($answer_expression->getOrdering() as $element) {
97 if ($element == $order) {
109 $this->
validateClozeTest($answer_index, $question, $answer_expression, $question_index);
138 private function validateClozeTest($answer_index, $question, $answer_expression, $question_index): void
140 if ($answer_index !==
null) {
141 $options = $question->getAvailableAnswerOptions($answer_index);
155 foreach (
$options->getItems($this->getNonShuffler()) as $item) {
156 if ($item->getAnswertext() == $answer_expression->getText()) {
161 foreach (
$options->getItems($question->getShuffler()) as $item) {
162 if ($item->getOrder() == $answer_expression->getNumericValue() - 1) {
193 $answer_options = $question->getAvailableAnswerOptions($answer_index);
194 if ($answer_options ==
null) {
207 if ($question ==
null) {
241 if (!in_array($answer_expression::$identifier, $expressions)) {
255 if (!in_array($pattern, $operators)) {
262 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...
Class QuestionExpressionInterface.
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.