3 require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Expressions/ilAssLacResultOfAnswerOfQuestionExpression.php";
4 require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacExpressionNotSupportedByQuestion.php";
5 require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacQuestionNotExist.php";
6 require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacOperatorNotSupportedByExpression.php";
7 require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacUnsupportedExpression.php";
8 require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacUnsupportedOperation.php";
9 require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacAnswerIndexNotExist.php";
10 require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacQuestionNotReachable.php";
11 require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacAnswerValueNotExist.php";
12 require_once
"Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacUnableToParseCondition.php";
13 require_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) {
93 if ($question instanceof assClozeTest) {
94 $this->
validateClozeTest($answer_index, $question, $answer_expression, $question_index);
105 ($composite->nodes[0] instanceof ilAssLacExpressionInterface &&
107 ($composite->nodes[0] instanceof ilAssLacSolutionExpressionInterface)
121 private function validateClozeTest($answer_index, $question, $answer_expression, $question_index)
123 if ($answer_index !== null) {
124 $options = $question->getAvailableAnswerOptions($answer_index);
137 if ($answer_expression instanceof ilAssLacStringResultExpression) {
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';
checkOperatorExistForExpression($operators, $answer_expression, $pattern)
validate(ilAssLacAbstractComposite $composite)
Class for horizontal ordering questions.
Class ResultOfAnswerOfCurrentQuestion for the expression R[m].
Class ResultOfAnswerOfQuestion for the expression Qn[m].
validateClozeTest($answer_index, $question, $answer_expression, $question_index)
Class EmptyAnswerExpression.
Class StringResultExpression for the expression ~TEXT~.
validateSubTree(ilAssLacAbstractComposite $composite)
__construct($object_loader)
checkAnswerExpressionExist($expressions, $answer_expression, $question_index)
Class NumericResultExpression for the expression n#.
Class CompositeValidator.
Class QuestionExpressionInterface.
Class SolutionExpressionInterface.
Class NumberOfResultExpression fot the expression +n+.
isResultOfAnswerExpression($expression)
checkQuestionExists($question, $index)
Class for ordering questions.
Class PercentageResultExpression for the expression n%.
Class ExpressionInterface.
checkIfAnswerIndexOfQuestionExists($question, $question_index, $answer_index)
Class OrderingResultExpression for the expression $a,..,n,m$.