36 foreach ($this->forms_helper->transformPoints($a_value) as $index =>
$value) {
37 $this->values[$index]->setPoints(
$value);
45 $result = $this->forms_helper->checkPointsInputEnoughPositive(
$data, $this->
getRequired());
46 if (!is_array($result)) {
57 $lng = $DIC->language();
59 $tpl =
new ilTemplate(
'tpl.prop_singlechoicecorrection_input.html',
true,
true,
'components/ILIAS/TestQuestionPool');
61 if ($this->values ===
null) {
65 foreach ($this->values as
$value) {
66 if ($this->qstObject->isSingleline()) {
67 if ($value->hasImage()) {
68 $imagename = $this->qstObject->getImagePathWeb() . $value->getImage();
69 if (($this->
getSingleline()) && ($this->qstObject->getThumbSize())) {
70 if (@file_exists($this->qstObject->getImagePath() . $this->qstObject->getThumbPrefix() . $value->getImage())) {
71 $imagename = $this->qstObject->getImagePathWeb() . $this->qstObject->getThumbPrefix() . $value->getImage();
75 $tpl->setCurrentBlock(
'image');
76 $tpl->setVariable(
'SRC_IMAGE', $imagename);
77 $tpl->setVariable(
'IMAGE_NAME', $value->getImage());
79 $tpl->parseCurrentBlock();
81 $tpl->setCurrentBlock(
'image');
82 $tpl->touchBlock(
'image');
83 $tpl->parseCurrentBlock();
87 $tpl->setCurrentBlock(
'answer');
88 $tpl->setVariable(
'ANSWER', $value->getAnswertext());
89 $tpl->parseCurrentBlock();
91 $tpl->setCurrentBlock(
'prop_points_propval');
92 $tpl->setVariable(
'POINTS_POST_VAR', $this->
getPostVar());
94 $tpl->parseCurrentBlock();
96 $tpl->setCurrentBlock(
'row');
97 $tpl->parseCurrentBlock();
100 if ($this->qstObject->isSingleline()) {
101 $tpl->setCurrentBlock(
'image_heading');
102 $tpl->setVariable(
'ANSWER_IMAGE',
$lng->
txt(
'answer_image'));
104 $tpl->parseCurrentBlock();
107 $tpl->setCurrentBlock(
'points_heading');
108 $tpl->setVariable(
'POINTS_TEXT',
$lng->
txt(
'points'));
109 $tpl->parseCurrentBlock();
111 $tpl->setVariable(
'ELEMENT_ID', $this->
getPostVar());
112 $tpl->setVariable(
'ANSWER_TEXT',
$lng->
txt(
'answer_text'));
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
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...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setVariable($variable, $value='')
Sets a variable value.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)