ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAssQuestionSolutionComparisonExpression.php
Go to the documentation of this file.
1<?php
2
26{
30 protected $db;
31
35 private $questionId;
36
40 private $skillBaseId;
41
45 private $skillTrefId;
46
50 private $orderIndex;
51
55 private $expression;
56
60 private $points;
61
65 public function __construct()
66 {
67 $this->questionId = null;
68 $this->skillBaseId = null;
69 $this->skillTrefId = null;
70 $this->orderIndex = null;
71 $this->expression = null;
72 $this->points = null;
73 }
74
75 public function save(): void
76 {
77 $this->db->replace(
78 'qpl_qst_skl_sol_expr',
79 [
80 'question_fi' => ['integer', $this->getQuestionId()],
81 'skill_base_fi' => ['integer', $this->getSkillBaseId()],
82 'skill_tref_fi' => ['integer', $this->getSkillTrefId()],
83 'order_index' => ['integer', $this->getOrderIndex()]
84 ],
85 [
86 'expression' => ['text', $this->getExpression()],
87 'points' => ['integer', $this->getPoints()]
88 ]
89 );
90 }
91
95 public function getDb(): ilDBInterface
96 {
97 return $this->db;
98 }
99
103 public function setDb($db): void
104 {
105 $this->db = $db;
106 }
107
111 public function getQuestionId(): ?int
112 {
113 return $this->questionId;
114 }
115
119 public function setQuestionId($questionId): void
120 {
121 $this->questionId = $questionId;
122 }
123
127 public function getSkillBaseId(): ?int
128 {
129 return $this->skillBaseId;
130 }
131
135 public function setSkillBaseId($skillBaseId): void
136 {
137 $this->skillBaseId = $skillBaseId;
138 }
139
143 public function getSkillTrefId(): ?int
144 {
145 return $this->skillTrefId;
146 }
147
151 public function setSkillTrefId($skillTrefId): void
152 {
153 $this->skillTrefId = $skillTrefId;
154 }
155
159 public function getOrderIndex(): ?int
160 {
161 return $this->orderIndex;
162 }
163
167 public function setOrderIndex($orderIndex): void
168 {
169 $this->orderIndex = $orderIndex;
170 }
171
175 public function getExpression(): ?string
176 {
177 return $this->expression;
178 }
179
183 public function setExpression($expression): void
184 {
185 $this->expression = $expression;
186 }
187
191 public function getPoints(): ?int
192 {
193 return $this->points;
194 }
195
199 public function setPoints($points): void
200 {
201 $this->points = $points;
202 }
203
207 public function initInstanceFromArray($data): void
208 {
209 $this->setQuestionId($data['question_fi']);
210 $this->setSkillBaseId($data['skill_base_fi']);
211 $this->setSkillTrefId($data['skill_tref_fi']);
212
213 $this->setOrderIndex($data['order_index']);
214 $this->setExpression($data['expression']);
215 $this->setPoints($data['points']);
216 }
217}
Interface ilDBInterface.