22 $this->values = array();
23 if (is_array($a_value)) {
24 if (is_array($a_value[
'answer'])) {
25 foreach ($a_value[
'answer'] as $index =>
$value) {
26 if (isset($a_value[
'points'])) {
27 $pvalue = $a_value[
'points'][$index];
31 if (isset($a_value[
'points_unchecked'])) {
32 $value_unchecked = $a_value[
'points_unchecked'][$index];
34 $value_unchecked = 0.0;
37 $this->values[] = $answer;
63 if (is_array($foundvalues)) {
65 if (is_array($foundvalues[
'answer'])) {
66 foreach ($foundvalues[
'answer'] as $aidx => $answervalue) {
67 if (((strlen($answervalue)) == 0) && (!isset($foundvalues[
'imagename']) || strlen($foundvalues[
'imagename'][$aidx]) == 0)) {
80 if (is_array($foundvalues[
'points'])) {
81 foreach ($foundvalues[
'points'] as $points) {
85 if (((strlen($points)) == 0) || (!is_numeric($points))) {
112 $tpl =
new ilTemplate(
"tpl.prop_essaykeywordswizardinput.html",
true,
true,
"Modules/TestQuestionPool");
114 foreach ($this->values as
$value) {
116 if (is_object($value)) {
117 $tpl->setCurrentBlock(
"prop_text_propval");
122 $tpl->parseCurrentBlock();
123 $tpl->setCurrentBlock(
"prop_points_propval");
128 $tpl->parseCurrentBlock();
130 $tpl->setCurrentBlock(
'singleline');
131 $tpl->setVariable(
"SIZE", $this->
getSize());
132 $tpl->setVariable(
"SINGLELINE_ID", $this->
getPostVar() .
"[answer][$i]");
133 $tpl->setVariable(
"SINGLELINE_ROW_NUMBER", $i);
134 $tpl->setVariable(
"SINGLELINE_POST_VAR", $this->
getPostVar());
137 $tpl->setVariable(
"DISABLED_SINGLELINE",
" disabled=\"disabled\"");
139 $tpl->parseCurrentBlock();
142 if (is_object($value)) {
143 $tpl->setCurrentBlock(
"prop_points_propval");
148 $tpl->parseCurrentBlock();
153 $tpl->setCurrentBlock(
"row");
154 $tpl->setVariable(
"POST_VAR", $this->
getPostVar());
155 $tpl->setVariable(
"ROW_NUMBER", $i);
156 $tpl->setVariable(
"ID", $this->
getPostVar() .
"[answer][$i]");
157 $tpl->setVariable(
"POINTS_ID", $this->
getPostVar() .
"[points][$i]");
159 $tpl->setVariable(
"DISABLED_POINTS",
" disabled=\"disabled\"");
161 $tpl->setVariable(
"ADD_BUTTON", $this->renderer->render(
162 $this->glyph_factory->add()->withAction(
'#')
164 $tpl->setVariable(
"REMOVE_BUTTON", $this->renderer->render(
165 $this->glyph_factory->remove()->withAction(
'#')
167 $tpl->parseCurrentBlock();
171 $tpl->setVariable(
"ELEMENT_ID", $this->
getPostVar());
172 $tpl->setVariable(
"TEXT_YES",
$lng->
txt(
'yes'));
173 $tpl->setVariable(
"TEXT_NO",
$lng->
txt(
'no'));
174 $tpl->setVariable(
"DELETE_IMAGE_HEADER",
$lng->
txt(
'delete_image_header'));
175 $tpl->setVariable(
"DELETE_IMAGE_QUESTION",
$lng->
txt(
'delete_image_question'));
176 $tpl->setVariable(
"ANSWER_TEXT",
$lng->
txt(
'answer_text'));
177 $tpl->setVariable(
"POINTS_TEXT",
$lng->
txt(
'points'));
178 $tpl->setVariable(
"COMMANDS_TEXT",
$lng->
txt(
'actions'));
179 $tpl->setVariable(
"POINTS_CHECKED_TEXT",
$lng->
txt(
'checkbox_checked'));
187 $tpl->addJavascript(
"./Modules/TestQuestionPool/templates/default/answerwizardinput.js");
188 $tpl->addJavascript(
"./Modules/TestQuestionPool/templates/default/essaykeywordwizard.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...
ASS_AnswerBinaryStateImage is a class for answers with a binary state indicator (checked/unchecked, set/unset) and an image file.
setVariable($variable, $value='')
Sets a variable value.
static _getUsedHTMLTagsAsString(string $a_module="")
Returns a string of all allowed HTML tags for text editing.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)