4 require_once
'Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php';
31 parent::__construct($a_title, $a_postvar);
33 $this->validationRegexp =
"";
43 $this->values =
array();
44 if (is_array($a_value))
46 if (is_array($a_value[
'answer']))
48 foreach ($a_value[
'answer'] as $index =>
$value)
50 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerBinaryStateImage.php";
52 array_push($this->values, $answer);
65 $this->values = $a_values;
85 $this->singleline = $a_value;
105 $this->qstObject =& $a_value;
125 $this->allowMove = $a_allow_move;
180 $this->minvalue = $a_minvalue;
202 if (is_array($foundvalues))
205 if (is_array($foundvalues[
'answer']))
207 foreach ($foundvalues[
'answer'] as $aidx => $answervalue)
209 if ((strlen($answervalue)) == 0)
211 $this->
setAlert($lng->txt(
"msg_input_is_required"));
218 if (is_array($foundvalues[
'points']))
220 foreach ($foundvalues[
'points'] as $points)
222 if ($points > $max) $max = $points;
223 if (((strlen($points)) == 0) || (!is_numeric($points)))
225 $this->
setAlert($lng->txt(
"form_msg_numeric_value_required"));
230 if (trim($points) !=
"" &&
234 $this->
setAlert($lng->txt(
"form_msg_value_too_low"));
241 if (trim($points) !=
"" &&
245 $this->
setAlert($lng->txt(
"form_msg_value_too_low"));
255 $this->
setAlert($lng->txt(
"enter_enough_positive_points"));
261 $this->
setAlert($lng->txt(
"msg_input_is_required"));
279 foreach ($this->values as
$value)
283 if (is_object($value))
285 $tpl->setCurrentBlock(
"prop_text_propval");
287 $tpl->parseCurrentBlock();
288 $tpl->setCurrentBlock(
"prop_points_propval");
290 $tpl->parseCurrentBlock();
292 $tpl->setCurrentBlock(
'singleline');
294 $tpl->setVariable(
"SINGLELINE_ID", $this->
getPostVar() .
"[answer][$i]");
295 $tpl->setVariable(
"SINGLELINE_ROW_NUMBER", $i);
300 $tpl->setVariable(
"DISABLED_SINGLELINE",
" disabled=\"disabled\"");
302 $tpl->parseCurrentBlock();
306 if (is_object($value))
308 $tpl->setCurrentBlock(
"prop_points_propval");
310 $tpl->parseCurrentBlock();
312 $tpl->setCurrentBlock(
'multiline');
313 $tpl->setVariable(
"PROPERTY_VALUE", $this->qstObject->prepareTextareaOutput($value->getAnswertext()));
314 $tpl->setVariable(
"MULTILINE_ID", $this->
getPostVar() .
"[answer][$i]");
315 $tpl->setVariable(
"MULTILINE_ROW_NUMBER", $i);
319 $tpl->setVariable(
"DISABLED_MULTILINE",
" disabled=\"disabled\"");
321 $tpl->parseCurrentBlock();
325 $tpl->setCurrentBlock(
"move");
326 $tpl->setVariable(
"CMD_UP",
"cmd[up" . $this->
getFieldId() .
"][$i]");
327 $tpl->setVariable(
"CMD_DOWN",
"cmd[down" . $this->
getFieldId() .
"][$i]");
331 $tpl->parseCurrentBlock();
333 $tpl->setCurrentBlock(
"row");
335 $tpl->setVariable(
"ROW_NUMBER", $i);
337 $tpl->setVariable(
"POINTS_ID", $this->
getPostVar() .
"[points][$i]");
341 $tpl->setVariable(
"CMD_ADD",
"cmd[add" . $this->
getFieldId() .
"][$i]");
342 $tpl->setVariable(
"CMD_REMOVE",
"cmd[remove" . $this->
getFieldId() .
"][$i]");
348 $tpl->setVariable(
"DISABLED_POINTS",
" disabled=\"disabled\"");
350 $tpl->parseCurrentBlock();
357 $tpl->setVariable(
"COMMANDS_TEXT", $lng->txt(
'actions'));
359 $a_tpl->setCurrentBlock(
"prop_generic");
360 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
361 $a_tpl->parseCurrentBlock();
364 $tpl->addJavascript(
"./Services/Form/js/ServiceFormWizardInput.js");
365 $tpl->addJavascript(
"./Modules/TestQuestionPool/templates/default/answerwizard.js");
374 return $lng->txt(
'answer_text');
383 return $lng->txt(
'points');
391 return "tpl.prop_answerwizardinput.html";
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getMaxLength()
Get Max Length.
Class for answers with a binary state indicator.
static get($a_glyph, $a_text="")
Get glyph html.
special template class to simplify handling of ITX/PEAR
setSize($a_size)
Set Size.
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.
Create styles array
The data for the language used.