ILIAS  release_7 Revision v7.30-3-g800a261c036
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 $formValues[] = new ASS_AnswerSimple(
22 $modelValue->getExpression(),
23 $modelValue->getPoints(),
24 $modelValue->getOrderIndex() - 1
25 );
26 }
27
28 if (!count($formValues)) {
29 $formValues[] = new ASS_AnswerSimple('', 0, 1);
30 }
31
32 parent::setValues($formValues);
33 }
34
35 public function getValues()
36 {
37 $formValues = parent::getValues();
38
39 $modelValues = array();
40
41 foreach ($formValues as $formValue) {
43 $expression->setExpression($formValue->getAnswertext());
44 $expression->setPoints($formValue->getPoints());
45 $expression->setOrderIndex($formValue->getOrder() + 1);
46 $modelValues[] = $expression;
47 }
48
49 return $modelValues;
50 }
51
56 protected function getTextInputLabel($lng)
57 {
58 return $lng->txt('tst_sol_comp_expressions');
59 }
60
65 protected function getPointsInputLabel($lng)
66 {
67 return $lng->txt('tst_comp_points');
68 }
69
73 protected function getTemplate()
74 {
75 return "tpl.prop_lac_expression_input.html";
76 }
77
78 protected function sanitizeSuperGlobalSubmitValue()
79 {
80 if (isset($_POST[$this->getPostVar()]) && is_array($_POST[$this->getPostVar()])) {
82 }
83 }
84}
$_POST["username"]
Class for simple answers.
An exception for terminatinating execution or to throw for unit testing.
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.