61 if (count($composite->nodes) > 0) {
62 $composite->nodes[0] = $this->
evaluate($composite->nodes[0]);
63 $composite->nodes[1] = $this->
evaluate($composite->nodes[1]);
64 $composite = $this->evaluateSubTree($composite);
80 $question = $this->object_loader->getQuestion($composite->nodes[0]->getQuestionIndex());
81 $rightNode = $composite->nodes[1];
85 $solutions = $question->getUserQuestionResult($this->activeId, $this->pass);
93 $result = $solutions->getSolutionForKey(
$index);
94 $gap = $question->getAvailableAnswerOptions(
$index - 1);
97 if ($gap->getType() == 1) {
98 $answer = $gap->getItem($result[
'value'] - 1);
100 $solutions->removeByKey(
$index);
101 $solutions->addKeyValue(
$index, $answer->getAnswertext());
111 $answers = $gap->getItems($question->getShuffler());
113 foreach ($answers as $answer) {
114 if ($max_points < $answer->getPoints()) {
115 $max_points = $answer->getPoints();
120 $reached_points = null;
122 switch ($gap->getType()) {
124 for ($order = 0; $order < $gap->getItemCount(); $order++) {
125 $answer = $gap->getItem($order);
126 $item_points = $question->getTextgapPoints($answer->getAnswertext(), $result[
'value'], $answer->getPoints());
127 if ($item_points > $reached_points) {
128 $reached_points = $item_points;
134 for ($order = 0; $order < $gap->getItemCount(); $order++) {
135 $answer = $gap->getItem($order);
136 $item_points = $question->getNumericgapPoints($answer->getAnswertext(), $result[
"value"], $answer->getPoints(), $answer->getLowerBound(), $answer->getUpperBound());
137 if ($item_points > $reached_points) {
138 $reached_points = $item_points;
144 if ($result[
'value'] != null) {
145 $answer = $gap->getItem($result[
'value'] - 1);
146 $reached_points = $answer->getPoints();
152 if ($max_points != 0 && $reached_points !== null) {
153 $percentage = (
int) (($reached_points / $max_points) * 100);
155 $solutions->setReachedPercentage($percentage);
165 $result = $solutions->getSolutionForKey(
$index);
166 $answer = $question->getAvailableAnswerOptions(
$index - 1);
168 $unit = $solutions->getSolutionForKey(
$index .
"_unit");
170 if (is_array($unit)) {
171 $key = $unit[
'value'];
174 $max_points = $answer->getPoints();
180 $points = $answer->getReachedPoints($question->getVariables(), $question->getResults(), $result[
"value"],
$key, $question->getUnitrepository()->getUnits());
183 if ($max_points != 0) {
184 $percentage = (
int) (($points / $max_points) * 100);
186 $solutions->setReachedPercentage($percentage);
189 $result = $rightNode->checkResult($solutions, $composite->getPattern(),
$index);
191 switch ($composite->getPattern()) {
193 $result = $composite->nodes[0] && $composite->nodes[1];
196 $result = $composite->nodes[0] || $composite->nodes[1];
203 if ($composite->isNegated()) {
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...
const CLOZE_TEXT
Cloze question constants.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct($object_loader, $activeId, $pass)
evaluate(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...
isInstanceOfAnswerIndexProvidingExpression(ilAssLacAbstractComposite $composite)