ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilAssQuestionSolutionComparisonExpression.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 
12 {
16  protected $db;
17 
21  private $questionId;
22 
26  private $skillBaseId;
27 
31  private $skillTrefId;
32 
36  private $orderIndex;
37 
41  private $expression;
42 
46  private $points;
47 
51  public function __construct()
52  {
53  $this->questionId = null;
54  $this->skillBaseId = null;
55  $this->skillTrefId = null;
56  $this->orderIndex = null;
57  $this->expression = null;
58  $this->points = null;
59  }
60 
61  public function save()
62  {
63  $this->db->replace(
64  'qpl_qst_skl_sol_expr',
65  array(
66  'question_fi' => array('integer', $this->getQuestionId()),
67  'skill_base_fi' => array('integer', $this->getSkillBaseId()),
68  'skill_tref_fi' => array('integer', $this->getSkillTrefId()),
69  'order_index' => array('integer', $this->getOrderIndex())
70  ),
71  array(
72  'expression' => array('text', $this->getExpression()),
73  'points' => array('integer', $this->getPoints())
74  )
75  );
76  }
77 
81  public function getDb()
82  {
83  return $this->db;
84  }
85 
89  public function setDb($db)
90  {
91  $this->db = $db;
92  }
93 
97  public function getQuestionId()
98  {
99  return $this->questionId;
100  }
101 
105  public function setQuestionId($questionId)
106  {
107  $this->questionId = $questionId;
108  }
109 
113  public function getSkillBaseId()
114  {
115  return $this->skillBaseId;
116  }
117 
121  public function setSkillBaseId($skillBaseId)
122  {
123  $this->skillBaseId = $skillBaseId;
124  }
125 
129  public function getSkillTrefId()
130  {
131  return $this->skillTrefId;
132  }
133 
137  public function setSkillTrefId($skillTrefId)
138  {
139  $this->skillTrefId = $skillTrefId;
140  }
141 
145  public function getOrderIndex()
146  {
147  return $this->orderIndex;
148  }
149 
153  public function setOrderIndex($orderIndex)
154  {
155  $this->orderIndex = $orderIndex;
156  }
157 
161  public function getExpression()
162  {
163  return $this->expression;
164  }
165 
169  public function setExpression($expression)
170  {
171  $this->expression = $expression;
172  }
173 
177  public function getPoints()
178  {
179  return $this->points;
180  }
181 
185  public function setPoints($points)
186  {
187  $this->points = $points;
188  }
189 
193  public function initInstanceFromArray($data)
194  {
195  $this->setQuestionId($data['question_fi']);
196  $this->setSkillBaseId($data['skill_base_fi']);
197  $this->setSkillTrefId($data['skill_tref_fi']);
198 
199  $this->setOrderIndex($data['order_index']);
200  $this->setExpression($data['expression']);
201  $this->setPoints($data['points']);
202  }
203 }
$data
Definition: bench.php:6