36 foreach ($this->forms_helper->transformPoints($a_value) as $index =>
$value) {
41 $this->values[$index]->setPoints(
$value);
49 $result = $this->forms_helper->checkPointsInputEnoughPositive(
$data, $this->
getRequired());
50 if (!is_array($result)) {
63 $tpl =
new ilTemplate(
'tpl.prop_singlechoicecorrection_input.html',
true,
true,
'components/ILIAS/TestQuestionPool');
65 if ($this->values ===
null) {
69 foreach ($this->values as
$value) {
70 if ($this->qstObject->isSingleline()) {
72 $imagename = $this->qstObject->getImagePathWeb() .
$value->getImage();
73 if (($this->
getSingleline()) && ($this->qstObject->getThumbSize())) {
74 if (@file_exists($this->qstObject->getImagePath() . $this->qstObject->getThumbPrefix() .
$value->getImage())) {
75 $imagename = $this->qstObject->getImagePathWeb() . $this->qstObject->getThumbPrefix() .
$value->getImage();
79 $tpl->setCurrentBlock(
'image');
80 $tpl->setVariable(
'SRC_IMAGE', $imagename);
81 $tpl->setVariable(
'IMAGE_NAME',
$value->getImage());
83 $tpl->parseCurrentBlock();
85 $tpl->setCurrentBlock(
'image');
86 $tpl->touchBlock(
'image');
87 $tpl->parseCurrentBlock();
91 $tpl->setCurrentBlock(
'answer');
92 $tpl->setVariable(
'ANSWER',
$value->getAnswertext());
93 $tpl->parseCurrentBlock();
95 $tpl->setCurrentBlock(
'prop_points_propval');
96 $tpl->setVariable(
'POINTS_POST_VAR', $this->
getPostVar());
98 $tpl->parseCurrentBlock();
100 $tpl->setCurrentBlock(
'row');
101 $tpl->parseCurrentBlock();
104 if ($this->qstObject->isSingleline()) {
105 $tpl->setCurrentBlock(
'image_heading');
106 $tpl->setVariable(
'ANSWER_IMAGE',
$lng->
txt(
'answer_image'));
108 $tpl->parseCurrentBlock();
111 $tpl->setCurrentBlock(
'points_heading');
112 $tpl->setVariable(
'POINTS_TEXT',
$lng->
txt(
'points'));
113 $tpl->parseCurrentBlock();
115 $tpl->setVariable(
'ELEMENT_ID', $this->
getPostVar());
116 $tpl->setVariable(
'ANSWER_TEXT',
$lng->
txt(
'answer_text'));
setVariable($variable, $value='')
Sets a variable value.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)