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;
200 if (is_array($foundvalues)) {
202 if (is_array($foundvalues[
'answer'])) {
203 foreach ($foundvalues[
'answer'] as $aidx => $answervalue) {
204 if ((strlen($answervalue)) == 0) {
212 if (is_array($foundvalues[
'points'])) {
213 foreach ($foundvalues[
'points'] as $points) {
214 if ($points > $max) {
217 if (((strlen($points)) == 0) || (!is_numeric($points))) {
218 $this->
setAlert(
$lng->txt(
"form_msg_numeric_value_required"));
222 if (trim($points) !=
"" &&
230 if (trim($points) !=
"" &&
241 $this->
setAlert(
$lng->txt(
"enter_enough_positive_points"));
264 foreach ($this->values as
$value) {
266 if (is_object($value)) {
267 $tpl->setCurrentBlock(
"prop_text_propval");
269 $tpl->parseCurrentBlock();
270 $tpl->setCurrentBlock(
"prop_points_propval");
272 $tpl->parseCurrentBlock();
274 $tpl->setCurrentBlock(
'singleline');
276 $tpl->setVariable(
"SINGLELINE_ID", $this->
getPostVar() .
"[answer][$i]");
277 $tpl->setVariable(
"SINGLELINE_ROW_NUMBER",
$i);
281 $tpl->setVariable(
"DISABLED_SINGLELINE",
" disabled=\"disabled\"");
283 $tpl->parseCurrentBlock();
285 if (is_object($value)) {
286 $tpl->setCurrentBlock(
"prop_points_propval");
288 $tpl->parseCurrentBlock();
290 $tpl->setCurrentBlock(
'multiline');
291 $tpl->setVariable(
"PROPERTY_VALUE", $this->qstObject->prepareTextareaOutput($value->getAnswertext()));
292 $tpl->setVariable(
"MULTILINE_ID", $this->
getPostVar() .
"[answer][$i]");
293 $tpl->setVariable(
"MULTILINE_ROW_NUMBER",
$i);
296 $tpl->setVariable(
"DISABLED_MULTILINE",
" disabled=\"disabled\"");
298 $tpl->parseCurrentBlock();
301 $tpl->setCurrentBlock(
"move");
302 $tpl->setVariable(
"CMD_UP",
"cmd[up" . $this->
getFieldId() .
"][$i]");
303 $tpl->setVariable(
"CMD_DOWN",
"cmd[down" . $this->
getFieldId() .
"][$i]");
307 $tpl->parseCurrentBlock();
309 $tpl->setCurrentBlock(
"row");
311 $tpl->setVariable(
"ROW_NUMBER",
$i);
313 $tpl->setVariable(
"POINTS_ID", $this->
getPostVar() .
"[points][$i]");
316 $tpl->setVariable(
"CMD_ADD",
"cmd[add" . $this->
getFieldId() .
"][$i]");
317 $tpl->setVariable(
"CMD_REMOVE",
"cmd[remove" . $this->
getFieldId() .
"][$i]");
322 $tpl->setVariable(
"DISABLED_POINTS",
" disabled=\"disabled\"");
324 $tpl->parseCurrentBlock();
331 $tpl->setVariable(
"COMMANDS_TEXT",
$lng->txt(
'actions'));
333 $a_tpl->setCurrentBlock(
"prop_generic");
334 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
335 $a_tpl->parseCurrentBlock();
339 $tpl->addJavascript(
"./Services/Form/js/ServiceFormWizardInput.js");
340 $tpl->addJavascript(
"./Modules/TestQuestionPool/templates/default/answerwizard.js");
349 return $lng->txt(
'answer_text');
358 return $lng->txt(
'points');
366 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.