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)) {
45 if (is_array($a_value[
'answer'])) {
47 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerBinaryStateImage.php";
49 array_push($this->values, $answer);
62 $this->values = $a_values;
82 $this->singleline = $a_value;
102 $this->qstObject =&$a_value;
122 $this->allowMove = $a_allow_move;
177 $this->minvalue = $a_minvalue;
199 if (is_array($foundvalues)) {
201 if (is_array($foundvalues[
'answer'])) {
202 foreach ($foundvalues[
'answer'] as $aidx => $answervalue) {
203 if ((strlen($answervalue)) == 0) {
204 $this->
setAlert($lng->txt(
"msg_input_is_required"));
211 if (is_array($foundvalues[
'points'])) {
212 foreach ($foundvalues[
'points'] as $points) {
213 if ($points > $max) {
216 if (((strlen($points)) == 0) || (!is_numeric($points))) {
217 $this->
setAlert($lng->txt(
"form_msg_numeric_value_required"));
221 if (trim($points) !=
"" &&
224 $this->
setAlert($lng->txt(
"form_msg_value_too_low"));
229 if (trim($points) !=
"" &&
232 $this->
setAlert($lng->txt(
"form_msg_value_too_low"));
240 $this->
setAlert($lng->txt(
"enter_enough_positive_points"));
244 $this->
setAlert($lng->txt(
"msg_input_is_required"));
262 foreach ($this->values as
$value) {
264 if (is_object($value)) {
265 $tpl->setCurrentBlock(
"prop_text_propval");
267 $tpl->parseCurrentBlock();
268 $tpl->setCurrentBlock(
"prop_points_propval");
270 $tpl->parseCurrentBlock();
272 $tpl->setCurrentBlock(
'singleline');
274 $tpl->setVariable(
"SINGLELINE_ID", $this->
getPostVar() .
"[answer][$i]");
275 $tpl->setVariable(
"SINGLELINE_ROW_NUMBER",
$i);
279 $tpl->setVariable(
"DISABLED_SINGLELINE",
" disabled=\"disabled\"");
281 $tpl->parseCurrentBlock();
283 if (is_object($value)) {
284 $tpl->setCurrentBlock(
"prop_points_propval");
286 $tpl->parseCurrentBlock();
288 $tpl->setCurrentBlock(
'multiline');
289 $tpl->setVariable(
"PROPERTY_VALUE", $this->qstObject->prepareTextareaOutput($value->getAnswertext()));
290 $tpl->setVariable(
"MULTILINE_ID", $this->
getPostVar() .
"[answer][$i]");
291 $tpl->setVariable(
"MULTILINE_ROW_NUMBER",
$i);
294 $tpl->setVariable(
"DISABLED_MULTILINE",
" disabled=\"disabled\"");
296 $tpl->parseCurrentBlock();
299 $tpl->setCurrentBlock(
"move");
300 $tpl->setVariable(
"CMD_UP",
"cmd[up" . $this->
getFieldId() .
"][$i]");
301 $tpl->setVariable(
"CMD_DOWN",
"cmd[down" . $this->
getFieldId() .
"][$i]");
305 $tpl->parseCurrentBlock();
307 $tpl->setCurrentBlock(
"row");
309 $tpl->setVariable(
"ROW_NUMBER",
$i);
311 $tpl->setVariable(
"POINTS_ID", $this->
getPostVar() .
"[points][$i]");
314 $tpl->setVariable(
"CMD_ADD",
"cmd[add" . $this->
getFieldId() .
"][$i]");
315 $tpl->setVariable(
"CMD_REMOVE",
"cmd[remove" . $this->
getFieldId() .
"][$i]");
320 $tpl->setVariable(
"DISABLED_POINTS",
" disabled=\"disabled\"");
322 $tpl->parseCurrentBlock();
329 $tpl->setVariable(
"COMMANDS_TEXT", $lng->txt(
'actions'));
331 $a_tpl->setCurrentBlock(
"prop_generic");
332 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
333 $a_tpl->parseCurrentBlock();
336 $tpl->addJavascript(
"./Services/Form/js/ServiceFormWizardInput.js");
337 $tpl->addJavascript(
"./Modules/TestQuestionPool/templates/default/answerwizard.js");
346 return $lng->txt(
'answer_text');
355 return $lng->txt(
'points');
363 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.