ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilLogicalAnswerComparisonExpressionInputGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Modules/TestQuestionPool/classes/class.ilAnswerWizardInputGUI.php';
5require_once 'Modules/TestQuestionPool/classes/class.assAnswerSimple.php';
6require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSolutionComparisonExpression.php';
7
15{
16 public function setValues($modelValues)
17 {
18 $formValues = array();
19
20 foreach($modelValues as $modelValue)
21 {
22 $formValues[] = new ASS_AnswerSimple(
23 $modelValue->getExpression(),
24 $modelValue->getPoints(),
25 $modelValue->getOrderIndex() - 1
26 );
27 }
28
29 if( !count($formValues) )
30 {
31 $formValues[] = new ASS_AnswerSimple('', 0, 1);
32 }
33
34 parent::setValues($formValues);
35 }
36
37 public function getValues()
38 {
39 $formValues = parent::getValues();
40
41 $modelValues = array();
42
43 foreach($formValues as $formValue)
44 {
46 $expression->setExpression($formValue->getAnswertext());
47 $expression->setPoints($formValue->getPoints());
48 $expression->setOrderIndex($formValue->getOrder() + 1);
49 $modelValues[] = $expression;
50 }
51
52 return $modelValues;
53 }
54
59 protected function getTextInputLabel($lng)
60 {
61 return $lng->txt('tst_sol_comp_expressions');
62 }
63
68 protected function getPointsInputLabel($lng)
69 {
70 return $lng->txt('tst_comp_points');
71 }
72
76 protected function getTemplate()
77 {
78 return "tpl.prop_lac_expression_input.html";
79 }
80
81 protected function sanitizeSuperGlobalSubmitValue()
82 {
83 if( isset($_POST[$this->getPostVar()]) && is_array($_POST[$this->getPostVar()]) )
84 {
86 }
87 }
88}
Class for simple answers.
This class represents a single choice wizard property in a property form.
getPostVar()
Get Post Variable.
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
$_POST['username']
Definition: cron.php:12
global $lng
Definition: privfeed.php:40