36 $points = $this->forms_helper->transformPoints($a_value,
'points');
37 $points_unchecked = $this->forms_helper->transformPoints($a_value,
'points_unchecked');
39 foreach ($this->values as $index =>
$value) {
44 $this->values[$index]->setPoints($points[$index] ?? 0.0);
45 $this->values[$index]->setPointsUnchecked($points_unchecked[$index] ?? 0.0);
53 $result = $this->forms_helper->checkPointsInputEnoughPositive(
$data, $this->
getRequired(),
'points');
54 if (!is_array($result)) {
59 $result = $this->forms_helper->checkPointsInput(
$data, $this->
getRequired(),
'points_unchecked');
60 if (!is_array($result)) {
70 $tpl =
new ilTemplate(
"tpl.prop_multiplechoicecorrection_input.html",
true,
true,
"components/ILIAS/TestQuestionPool");
73 foreach ($this->values as
$value) {
74 if ($this->qstObject->isSingleline()) {
76 $imagename = $this->qstObject->getImagePathWeb() .
$value->getImage();
77 if (($this->
getSingleline()) && ($this->qstObject->getThumbSize())) {
78 if (file_exists($this->qstObject->getImagePath() . $this->qstObject->getThumbPrefix() .
$value->getImage())) {
79 $imagename = $this->qstObject->getImagePathWeb() . $this->qstObject->getThumbPrefix() .
$value->getImage();
83 $tpl->setCurrentBlock(
'image');
84 $tpl->setVariable(
'SRC_IMAGE', $imagename);
85 $tpl->setVariable(
'IMAGE_NAME',
$value->getImage());
87 $tpl->parseCurrentBlock();
89 $tpl->setCurrentBlock(
'image');
90 $tpl->touchBlock(
'image');
91 $tpl->parseCurrentBlock();
95 $tpl->setCurrentBlock(
"answer");
96 $tpl->setVariable(
"ANSWER",
$value->getAnswertext());
97 $tpl->parseCurrentBlock();
99 $tpl->setCurrentBlock(
"row");
100 $tpl->setVariable(
"POINTS_POST_VAR", $this->
getPostVar());
101 $tpl->setVariable(
"POINTS_ROW_NUMBER", $i);
103 "PROPERTY_VALUE_CHECKED",
107 "PROPERTY_VALUE_UNCHECKED",
110 $tpl->parseCurrentBlock();
115 if ($this->qstObject->isSingleline()) {
116 $tpl->setCurrentBlock(
"image_heading");
117 $tpl->setVariable(
"ANSWER_IMAGE", $this->
lng->txt(
'answer_image'));
119 $tpl->parseCurrentBlock();
122 $tpl->setCurrentBlock(
"points_heading");
123 $tpl->setVariable(
"POINTS_CHECKED_TEXT", $this->
lng->txt(
'points_checked'));
124 $tpl->setVariable(
"POINTS_UNCHECKED_TEXT", $this->
lng->txt(
'points_unchecked'));
125 $tpl->parseCurrentBlock();
127 $tpl->setVariable(
"ELEMENT_ID", $this->
getPostVar());
128 $tpl->setVariable(
"ANSWER_TEXT", $this->
lng->txt(
'answer_text'));
setVariable($variable, $value='')
Sets a variable value.
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)