29 parent::__construct($a_title, $a_postvar);
39 $this->values = array();
40 if (is_array($a_value))
42 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerErrorText.php";
43 if (is_array($a_value[
'key']))
45 foreach ($a_value[
'key'] as $idx => $key)
47 array_push($this->values,
new assAnswerErrorText($key, $a_value[
'value'][$idx], str_replace(
",",
".", $a_value[
'points'][$idx])));
60 $this->key_size = $a_size;
80 $this->value_size = $a_size;
100 $this->key_maxlength = $a_maxlength;
120 $this->value_maxlength = $a_maxlength;
140 $this->value_name = $a_name;
160 $this->key_name = $a_name;
180 $this->values = $a_values;
204 if (is_array($foundvalues))
207 if (is_array($foundvalues[
'key']) && is_array($foundvalues[
'value']))
209 foreach ($foundvalues[
'key'] as $val)
213 $this->
setAlert($lng->txt(
"msg_input_is_required"));
217 foreach ($foundvalues[
'value'] as $val)
221 $this->
setAlert($lng->txt(
"msg_input_is_required"));
225 foreach ($foundvalues[
'points'] as $val)
229 $this->
setAlert($lng->txt(
"msg_input_is_required"));
232 if (!is_numeric(str_replace(
",",
".", $val)))
234 $this->
setAlert($lng->txt(
"form_msg_numeric_value_required"));
243 $this->
setAlert($lng->txt(
"msg_input_is_required"));
252 $this->
setAlert($lng->txt(
"msg_input_is_required"));
268 $tpl =
new ilTemplate(
"tpl.prop_errortextwizardinput.html",
true,
true,
"Modules/TestQuestionPool");
270 foreach ($this->values as
$value)
272 if (is_object($value))
274 if (strlen($value->text_wrong))
276 $tpl->setCurrentBlock(
"prop_key_propval");
278 $tpl->parseCurrentBlock();
280 if (strlen($value->text_correct))
282 $tpl->setCurrentBlock(
"prop_value_propval");
284 $tpl->parseCurrentBlock();
286 if (strlen($value->points))
288 $tpl->setCurrentBlock(
"prop_points_propval");
290 $tpl->parseCurrentBlock();
294 $tpl->setCurrentBlock(
"row");
295 $class = ($i % 2 == 0) ?
"even" :
"odd";
296 if ($i == 0) $class .=
" first";
297 if ($i == count($this->values)-1) $class .=
" last";
298 $tpl->setVariable(
"ROW_CLASS", $class);
299 $tpl->setVariable(
"ROW_NUMBER", $i);
306 $tpl->setVariable(
"VALUE_ID", $this->
getPostVar() .
"[value][$i]");
311 $tpl->parseCurrentBlock();
318 $tpl->setVariable(
"POINTS_TEXT", $lng->txt(
'points'));
320 $a_tpl->setCurrentBlock(
"prop_generic");
321 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
322 $a_tpl->parseCurrentBlock();
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
setKeySize($a_size)
Set key size.
getKeyName()
Get key name.
setValue($a_value)
Set Value.
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.
Class for error text answers.
setValueMaxlength($a_maxlength)
Set value maxlength.
setKeyName($a_name)
Set key name.
special template class to simplify handling of ITX/PEAR
getValueName()
Get value name.
insert(&$a_tpl)
Insert property html.
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
This class represents a text property in a property form.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
getValueSize()
Get value size.
getValueMaxlength()
Get value maxlength.
This class represents a key value pair wizard property in a property form.
setValueSize($a_size)
Set value size.
getKeyMaxlength()
Get key maxlength.
setValues($a_values)
Set Values.