31 if (is_array($a_value)) {
32 if (is_array($a_value[
'points'])) {
33 foreach ($this->values as $idx =>
$key) {
34 $this->values[$idx] = $this->values[$idx]->withPoints(
35 str_replace(
",",
".", $a_value[
'points'][$idx])
46 if (!isset($foundvalues[
'points'])
47 || !is_array($foundvalues[
'points'])) {
48 $this->
setAlert($this->
lng->txt(
"msg_input_is_required"));
52 foreach ($foundvalues[
'points'] as $val) {
54 $this->
setAlert($this->
lng->txt(
"msg_input_is_required"));
57 if (!is_numeric(str_replace(
",",
".", $val))) {
58 $this->
setAlert($this->
lng->txt(
"form_msg_numeric_value_required"));
61 if ((
float) $val <= 0) {
62 $this->
setAlert($this->
lng->txt(
"positive_numbers_required"));
75 $tpl =
new ilTemplate(
"tpl.prop_errortextcorrection_input.html",
true,
true,
"Modules/TestQuestionPool");
77 foreach ($this->values as
$value) {
78 $tpl->setCurrentBlock(
"prop_points_propval");
80 $tpl->parseCurrentBlock();
82 $tpl->setCurrentBlock(
"row");
87 $class = ($i % 2 == 0) ?
"even" :
"odd";
91 if ($i == count($this->values) - 1) {
94 $tpl->setVariable(
"ROW_CLASS", $class);
95 $tpl->setVariable(
"ROW_NUMBER", $i);
97 $tpl->setVariable(
"KEY_SIZE", $this->
getKeySize());
98 $tpl->setVariable(
"KEY_ID", $this->
getPostVar() .
"[key][$i]");
102 $tpl->setVariable(
"VALUE_ID", $this->
getPostVar() .
"[value][$i]");
105 $tpl->setVariable(
"POST_VAR", $this->
getPostVar());
107 $tpl->parseCurrentBlock();
111 $tpl->setVariable(
"ELEMENT_ID", $this->
getPostVar());
112 $tpl->setVariable(
"KEY_TEXT", $this->
getKeyName());
114 $tpl->setVariable(
"POINTS_TEXT",
$lng->
txt(
'points'));
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
getKeyName()
Get key name.
insert(ilTemplate $a_tpl)
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...
getKeySize()
Get key size.
setVariable($variable, $value='')
Sets a variable value.
getValueName()
Get value name.
getValueSize()
Get value size.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
getValueMaxlength()
Get value maxlength.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getKeyMaxlength()
Get key maxlength.