36 if (is_array($a_areas[
'points'])) {
37 foreach ($this->areas as $idx => $name) {
39 $this->areas[$idx]->setPointsUnchecked($a_areas[
'points_unchecked'][$idx]);
41 $this->areas[$idx]->setPointsUnchecked(0);
44 $this->areas[$idx]->setPoints($a_areas[
'points'][$idx]);
59 if (is_array($_POST[$this->
getPostVar()][
'coords'][
'points'])) {
60 foreach ($_POST[$this->
getPostVar()][
'coords'][
'points'] as $idx => $name) {
65 if ((!is_numeric($_POST[$this->
getPostVar()][
'coords'][
'points'][$idx]))) {
69 if ($_POST[$this->
getPostVar()][
'coords'][
'points'][$idx] > 0) {
70 $max = $_POST[$this->
getPostVar()][
'coords'][
'points'][$idx];
87 $template =
new ilTemplate(
"tpl.prop_imagemapquestioncorrection_input.html",
true,
true,
"Modules/TestQuestionPool");
90 $template->setCurrentBlock(
"image");
93 foreach ($this->
getAreas() as $index => $area) {
94 $preview->addArea($index, $area->getArea(), $area->getCoords(), $area->getAnswertext(),
"",
"",
true, $this->
getLineColor());
96 $preview->createPreview();
98 $template->setVariable(
"SRC_IMAGE", $imagepath);
100 $template->setVariable(
"SRC_IMAGE", $this->
getImage());
102 $template->setVariable(
"ALT_IMAGE", $this->
getAlt());
103 $template->setVariable(
"POST_VAR_D", $this->
getPostVar());
104 $template->parseCurrentBlock();
109 foreach ($this->
getAreas() as $area) {
110 if (strlen($area->getPoints())) {
111 $template->setCurrentBlock(
'area_points_value');
112 $template->setVariable(
'VALUE_POINTS', $area->getPoints());
113 $template->parseCurrentBlock();
116 if (strlen($area->getPointsUnchecked())) {
117 $template->setCurrentBlock(
'area_points_unchecked_value');
118 $template->setVariable(
'VALUE_POINTS_UNCHECKED', $area->getPointsUnchecked());
119 $template->parseCurrentBlock();
122 $template->setCurrentBlock(
'area_points_unchecked_field');
123 $template->parseCurrentBlock();
125 $template->setCurrentBlock(
'row');
126 if (strlen($area->getAnswertext())) {
127 $template->setVariable(
'ANSWER_AREA', $area->getAnswertext());
129 $template->setVariable(
'POST_VAR_R', $this->
getPostVar());
130 $template->setVariable(
'TEXT_SHAPE', strtoupper($area->getArea()));
131 $template->setVariable(
'VALUE_SHAPE', $area->getArea());
132 $coords = preg_replace(
"/(\d+,\d+,)/",
"\$1 ", $area->getCoords());
133 $template->setVariable(
'VALUE_COORDINATES', $area->getCoords());
134 $template->setVariable(
'TEXT_COORDINATES', $coords);
135 $template->setVariable(
'COUNTER', $counter);
136 $template->parseCurrentBlock();
139 $template->setCurrentBlock(
"areas");
140 $template->setVariable(
"TEXT_NAME",
$lng->
txt(
"ass_imap_hint"));
142 $template->setVariable(
"TEXT_POINTS",
$lng->
txt(
"points_checked"));
144 $template->setCurrentBlock(
'area_points_unchecked_head');
145 $template->setVariable(
"TEXT_POINTS_UNCHECKED",
$lng->
txt(
"points_unchecked"));
146 $template->parseCurrentBlock();
148 $template->setVariable(
"TEXT_POINTS",
$lng->
txt(
"points"));
150 $template->setVariable(
"TEXT_SHAPE",
$lng->
txt(
"shape"));
151 $template->setVariable(
"TEXT_COORDINATES",
$lng->
txt(
"coordinates"));
152 $template->setVariable(
"TEXT_COMMANDS",
$lng->
txt(
"actions"));
153 $template->parseCurrentBlock();
156 $template->setVariable(
"POST_VAR", $this->
getPostVar());
157 $template->setVariable(
"ID", $this->
getFieldId());
158 $template->setVariable(
"TXT_BROWSE",
$lng->
txt(
"select_file"));
159 $template->setVariable(
"TXT_MAX_SIZE",
$lng->
txt(
"file_notice") .
" " .
163 $a_tpl->
setVariable(
"PROP_GENERIC", $template->get());
168 #$tpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js"); 169 #$tpl->addJavascript("./Modules/TestQuestionPool/templates/default/imagemap.js"); parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
static stripSlashesRecursive($a_data, bool $a_strip_html=true, string $a_allow="")
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setVariable($variable, $value='')
Sets a variable value.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)