3require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Expressions/ilAssLacResultOfAnswerOfQuestionExpression.php";
4require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacExpressionNotSupportedByQuestion.php";
5require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacQuestionNotExist.php";
6require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacOperatorNotSupportedByExpression.php";
7require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacUnsupportedExpression.php";
8require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacUnsupportedOperation.php";
9require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacAnswerIndexNotExist.php";
10require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacQuestionNotReachable.php";
11require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacAnswerValueNotExist.php";
12require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacUnableToParseCondition.php";
13require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacDuplicateElement.php";
42 if (count($composite->nodes) > 0) {
43 $this->
validate($composite->nodes[0]);
44 $this->
validate($composite->nodes[1]);
56 $question_expression = $composite->nodes[0];
57 $answer_expression = $composite->nodes[1];
58 $question_index = $composite->nodes[0]->getQuestionIndex();
60 $question = $this->object_loader->getQuestion($question_index);
66 $answer_index = $question_expression->getAnswerIndex() - 1;
79 foreach ($answer_expression->getOrdering() as $order) {
81 foreach ($answer_expression->getOrdering() as $element) {
82 if ($element == $order) {
94 $this->
validateClozeTest($answer_index, $question, $answer_expression, $question_index);
121 private function validateClozeTest($answer_index, $question, $answer_expression, $question_index)
123 if ($answer_index !==
null) {
124 $options = $question->getAvailableAnswerOptions($answer_index);
138 foreach (
$options->getItems($this->getNonShuffler()) as $item) {
139 if ($item->getAnswertext() == $answer_expression->getText()) {
144 foreach (
$options->getItems($question->getShuffler()) as $item) {
145 if ($item->getOrder() == $answer_expression->getNumericValue() - 1) {
176 $answer_options = $question->getAvailableAnswerOptions($answer_index);
177 if ($answer_options ==
null) {
190 if ($question ==
null) {
222 if (!in_array($answer_expression::$identifier, $expressions)) {
236 if (!in_array($pattern, $operators)) {
243 require_once
'Services/Randomization/classes/class.ilArrayElementOrderKeeper.php';
An exception for terminatinating execution or to throw for unit testing.
Class for horizontal ordering questions.
Class for ordering questions.
Class CompositeValidator.
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)
Class EmptyAnswerExpression.
Class NumberOfResultExpression fot the expression +n+.
Class NumericResultExpression for the expression #n#.
Class OrderingResultExpression for the expression $a,..,n,m$.
Class PercentageResultExpression for the expression n%.
Class ResultOfAnswerOfCurrentQuestion for the expression R[m].
Class ResultOfAnswerOfQuestion for the expression Qn[m].
Class StringResultExpression for the expression ~TEXT~.
Class ExpressionInterface.
Class QuestionExpressionInterface.
Class SolutionExpressionInterface.