35 if (is_array($a_value)) {
36 if (is_array($a_value[
'points']) && is_array($a_value[
'points_unchecked'])) {
38 $this->values[
$index]->setPoints($a_value[
'points'][
$index]);
39 $this->values[
$index]->setPointsUnchecked($a_value[
'points_unchecked'][$index]);
51 if (is_array($foundvalues)) {
54 if (is_array($foundvalues[
'points'])) {
55 foreach ($foundvalues[
'points'] as $points) {
56 $points = str_replace(
',',
'.', $points);
60 if (((strlen($points)) == 0) || (!is_numeric($points))) {
65 foreach ($foundvalues[
'points_unchecked'] as $points) {
69 if (((strlen($points)) == 0) || (!is_numeric($points))) {
90 $lng = $DIC->language();
92 $tpl =
new ilTemplate(
"tpl.prop_multiplechoicecorrection_input.html",
true,
true,
"Modules/TestQuestionPool");
96 foreach ($this->values as
$value) {
97 if ($this->qstObject->isSingleline()) {
98 if (strlen($value->getImage())) {
99 $imagename = $this->qstObject->getImagePathWeb() . $value->getImage();
100 if (($this->
getSingleline()) && ($this->qstObject->getThumbSize())) {
101 if (@file_exists($this->qstObject->getImagePath() . $this->qstObject->getThumbPrefix() . $value->getImage())) {
102 $imagename = $this->qstObject->getImagePathWeb() . $this->qstObject->getThumbPrefix() . $value->getImage();
106 $tpl->setCurrentBlock(
'image');
107 $tpl->setVariable(
'SRC_IMAGE', $imagename);
108 $tpl->setVariable(
'IMAGE_NAME', $value->getImage());
110 $tpl->parseCurrentBlock();
112 $tpl->setCurrentBlock(
'image');
113 $tpl->touchBlock(
'image');
114 $tpl->parseCurrentBlock();
118 $tpl->setCurrentBlock(
"answer");
119 $tpl->setVariable(
"ANSWER", $value->getAnswertext());
120 $tpl->parseCurrentBlock();
122 $tpl->setCurrentBlock(
"row");
124 $tpl->setVariable(
"POINTS_ROW_NUMBER",
$i);
126 "PROPERTY_VALUE_CHECKED",
130 "PROPERTY_VALUE_UNCHECKED",
133 $tpl->parseCurrentBlock();
138 if ($this->qstObject->isSingleline()) {
139 $tpl->setCurrentBlock(
"image_heading");
140 $tpl->setVariable(
"ANSWER_IMAGE",
$lng->
txt(
'answer_image'));
142 $tpl->parseCurrentBlock();
145 $tpl->setCurrentBlock(
"points_heading");
146 $tpl->setVariable(
"POINTS_CHECKED_TEXT",
$lng->
txt(
'points_checked'));
147 $tpl->setVariable(
"POINTS_UNCHECKED_TEXT",
$lng->
txt(
'points_unchecked'));
148 $tpl->parseCurrentBlock();
151 $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...
setVariable($variable, $value='')
Sets a variable value.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl