ILIAS  release_8 Revision v8.25
class.ilLogicalAnswerComparisonExpressionInputGUI.php
Go to the documentation of this file.
1<?php
2
26{
27 public function setValues($modelValues): void
28 {
29 $formValues = array();
30
31 foreach ($modelValues as $modelValue) {
32 $formValues[] = new ASS_AnswerSimple(
33 $modelValue->getExpression(),
34 $modelValue->getPoints(),
35 $modelValue->getOrderIndex() - 1,
36 -1,
37 0
38 );
39 }
40
41 if (!count($formValues)) {
42 $formValues[] = new ASS_AnswerSimple('', 0, 1);
43 }
44
45 parent::setValues($formValues);
46 }
47
48 public function getValues(): array
49 {
50 $formValues = parent::getValues();
51
52 $modelValues = array();
53
54 foreach ($formValues as $formValue) {
56 $expression->setExpression($formValue->getAnswertext());
57 $expression->setPoints($formValue->getPoints());
58 $expression->setOrderIndex($formValue->getOrder() + 1);
59 $modelValues[] = $expression;
60 }
61
62 return $modelValues;
63 }
64
69 protected function getTextInputLabel($lng)
70 {
71 return $lng->txt('tst_sol_comp_expressions');
72 }
73
78 protected function getPointsInputLabel($lng)
79 {
80 return $lng->txt('tst_comp_points');
81 }
82
86 protected function getTemplate(): string
87 {
88 return "tpl.prop_lac_expression_input.html";
89 }
90}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...