59 $this->values = array();
60 if (is_array($a_value))
62 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerErrorText.php";
63 if (is_array($a_value[
'key']))
65 foreach ($a_value[
'key'] as $idx => $key)
67 array_push($this->values,
new assAnswerErrorText($key, $a_value[
'value'][$idx], str_replace(
",",
".", $a_value[
'points'][$idx])));
80 $this->key_size = $a_size;
100 $this->value_size = $a_size;
120 $this->key_maxlength = $a_maxlength;
140 $this->value_maxlength = $a_maxlength;
160 $this->value_name = $a_name;
180 $this->key_name = $a_name;
200 $this->values = $a_values;
224 if (is_array($foundvalues))
227 if (is_array($foundvalues[
'key']) && is_array($foundvalues[
'value']))
229 foreach ($foundvalues[
'key'] as $val)
233 $this->
setAlert($lng->txt(
"msg_input_is_required"));
237 foreach ($foundvalues[
'value'] as $val)
241 $this->
setAlert($lng->txt(
"msg_input_is_required"));
245 foreach ($foundvalues[
'points'] as $val)
249 $this->
setAlert($lng->txt(
"msg_input_is_required"));
252 if (!is_numeric(str_replace(
",",
".", $val)))
254 $this->
setAlert($lng->txt(
"form_msg_numeric_value_required"));
263 $this->
setAlert($lng->txt(
"msg_input_is_required"));
272 $this->
setAlert($lng->txt(
"msg_input_is_required"));
288 $tpl =
new ilTemplate(
"tpl.prop_errortextwizardinput.html",
true,
true,
"Modules/TestQuestionPool");
290 foreach ($this->values as
$value)
292 if (is_object($value))
294 if (strlen($value->text_wrong))
296 $tpl->setCurrentBlock(
"prop_key_propval");
298 $tpl->parseCurrentBlock();
300 if (strlen($value->text_correct))
302 $tpl->setCurrentBlock(
"prop_value_propval");
304 $tpl->parseCurrentBlock();
306 if (strlen($value->points))
308 $tpl->setCurrentBlock(
"prop_points_propval");
310 $tpl->parseCurrentBlock();
314 $tpl->setCurrentBlock(
"row");
315 $class = ($i % 2 == 0) ?
"even" :
"odd";
316 if ($i == 0) $class .=
" first";
317 if ($i == count($this->values)-1) $class .=
" last";
318 $tpl->setVariable(
"ROW_CLASS", $class);
319 $tpl->setVariable(
"ROW_NUMBER", $i);
326 $tpl->setVariable(
"VALUE_ID", $this->
getPostVar() .
"[value][$i]");
331 $tpl->parseCurrentBlock();
338 $tpl->setVariable(
"POINTS_TEXT", $lng->txt(
'points'));
340 $a_tpl->setCurrentBlock(
"prop_generic");
341 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
342 $a_tpl->parseCurrentBlock();