49 $this->values = array();
50 if (is_array($a_value)) {
51 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerErrorText.php";
52 if (is_array($a_value[
'key'])) {
53 foreach ($a_value[
'key'] as $idx =>
$key) {
54 $this->values[] =
new assAnswerErrorText(
$key, $a_value[
'value'][$idx], (
float) str_replace(
",",
".", $a_value[
'points'][$idx]));
67 $this->key_size = $a_size;
87 $this->value_size = $a_size;
107 $this->key_maxlength = $a_maxlength;
127 $this->value_maxlength = $a_maxlength;
147 $this->value_name = $a_name;
167 $this->key_name = $a_name;
187 $this->values = $a_values;
212 $foundvalues = $_POST[$this->
getPostVar()] ?? null;
216 if (is_array($foundvalues) && count($foundvalues) > 0) {
218 if (is_array($foundvalues[
'key']) && is_array($foundvalues[
'value'])) {
219 foreach ($foundvalues[
'key'] as $val) {
225 foreach ($foundvalues[
'value'] as $val) {
231 foreach ($foundvalues[
'points'] as $val) {
232 $val_num = str_replace(
",",
".", $val);
237 if (!is_numeric($val_num)) {
269 $tpl =
new ilTemplate(
"tpl.prop_errortextwizardinput.html",
true,
true,
"Modules/TestQuestionPool");
271 foreach ($this->values as
$value) {
272 if (is_object($value)) {
273 if (strlen($value->getTextWrong())) {
274 $tpl->setCurrentBlock(
"prop_key_propval");
276 $tpl->parseCurrentBlock();
278 if (strlen($value->getTextCorrect())) {
279 $tpl->setCurrentBlock(
"prop_value_propval");
284 $tpl->parseCurrentBlock();
286 if (strlen($value->getPoints())) {
287 $tpl->setCurrentBlock(
"prop_points_propval");
289 $tpl->parseCurrentBlock();
293 $tpl->setCurrentBlock(
"row");
294 $class = (
$i % 2 == 0) ?
"even" :
"odd";
298 if (
$i == count($this->values) - 1) {
301 $tpl->setVariable(
"ROW_CLASS", $class);
302 $tpl->setVariable(
"ROW_NUMBER",
$i);
309 $tpl->setVariable(
"VALUE_ID", $this->
getPostVar() .
"[value][$i]");
314 $tpl->parseCurrentBlock();
321 $tpl->setVariable(
"POINTS_TEXT",
$lng->
txt(
'points'));
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setKeySize($a_size)
Set key size.
getKeyName()
Get key name.
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...
setValueName($a_name)
Set value name.
__construct($a_title="", $a_postvar="")
Constructor.
checkInput()
Check input, strip slashes etc.
getKeySize()
Get key size.
setKeyMaxlength($a_maxlength)
Set key maxlength.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setValueMaxlength($a_maxlength)
Set value maxlength.
setKeyName($a_name)
Set key name.
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.
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
setValueSize($a_size)
Set value size.
getKeyMaxlength()
Get key maxlength.
setValues($a_values)
Set Values.
insert(ilTemplate $a_tpl)
Insert property html.