ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilQTIConditionvar.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
33 {
34  public $arr_not;
35  public $arr_and;
36  public $arr_or;
37  public $unanswered;
38  public $other;
39  public $varequal;
40  public $varlt;
41  public $varlte;
42  public $vargt;
43  public $vargte;
44  public $varsubset;
45  public $varinside;
46  public $varsubstring;
47  public $durequal;
48  public $durlt;
49  public $durlte;
50  public $durgt;
51  public $durgte;
52  public $varextension;
53  public $order;
54 
55  public function __construct()
56  {
57  $this->arr_not = array();
58  $this->arr_and = array();
59  $this->arr_or = array();
60  $this->unanswered = array();
61  $this->other = array();
62  $this->varequal = array();
63  $this->varlt = array();
64  $this->varlte = array();
65  $this->vargt = array();
66  $this->vargte = array();
67  $this->varsubset = array();
68  $this->varinside = array();
69  $this->varsubstring = array();
70  $this->durequal = array();
71  $this->durlt = array();
72  $this->durlte = array();
73  $this->durgt = array();
74  $this->durgte = array();
75  $this->varextension = array();
76  $this->order = array();
77  }
78 
79  public function addNot()
80  {
81  array_push($this->arr_not, 1);
82  array_push($this->order, array("field" => "arr_not", "index" => count($this->arr_not) - 1));
83  }
84 
85  public function addAnd()
86  {
87  array_push($this->arr_and, 1);
88  array_push($this->order, array("field" => "arr_and", "index" => count($this->arr_and) - 1));
89  }
90 
91  public function addOr()
92  {
93  array_push($this->arr_or, 1);
94  array_push($this->order, array("field" => "arr_or", "index" => count($this->arr_or) - 1));
95  }
96 
97  public function addUnanswered($a_unanswered)
98  {
99  array_push($this->unanswered, $a_unanswered);
100  array_push($this->order, array("field" => "unanswered", "index" => count($this->unanswered) - 1));
101  }
102 
103  public function addOther($a_other)
104  {
105  array_push($this->other, $a_other);
106  array_push($this->order, array("field" => "other", "index" => count($this->other) - 1));
107  }
108 
109  public function addVarequal($a_varequal)
110  {
111  array_push($this->varequal, $a_varequal);
112  array_push($this->order, array("field" => "varequal", "index" => count($this->varequal) - 1));
113  }
114 
115  public function addVarlt($a_varlt)
116  {
117  array_push($this->varlt, $a_varlt);
118  array_push($this->order, array("field" => "varlt", "index" => count($this->varlt) - 1));
119  }
120 
121  public function addVarlte($a_varlte)
122  {
123  array_push($this->varlte, $a_varlte);
124  array_push($this->order, array("field" => "varlte", "index" => count($this->varlte) - 1));
125  }
126 
127  public function addVargt($a_vargt)
128  {
129  array_push($this->vargt, $a_vargt);
130  array_push($this->order, array("field" => "vargt", "index" => count($this->vargt) - 1));
131  }
132 
133  public function addVargte($a_vargte)
134  {
135  array_push($this->vargte, $a_vargte);
136  array_push($this->order, array("field" => "vargte", "index" => count($this->vargte) - 1));
137  }
138 
139  public function addVarsubset($a_varsubset)
140  {
141  array_push($this->varsubset, $a_varsubset);
142  array_push($this->order, array("field" => "varsubset", "index" => count($this->varsubset) - 1));
143  }
144 
145  public function addVarinside($a_varinside)
146  {
147  array_push($this->varinside, $a_varinside);
148  array_push($this->order, array("field" => "varinside", "index" => count($this->varinside) - 1));
149  }
150 
151  public function addVarsubstring($a_varsubstring)
152  {
153  array_push($this->varsubstring, $a_varsubstring);
154  array_push($this->order, array("field" => "varsubstring", "index" => count($this->varsubstring) - 1));
155  }
156 
157  public function addDurequal($a_durequal)
158  {
159  array_push($this->durequal, $a_durequal);
160  array_push($this->order, array("field" => "durequal", "index" => count($this->durequal) - 1));
161  }
162 
163  public function addDurlt($a_durlt)
164  {
165  array_push($this->durlt, $a_durlt);
166  array_push($this->order, array("field" => "durlt", "index" => count($this->durlt) - 1));
167  }
168 
169  public function addDurlte($a_durlte)
170  {
171  array_push($this->durlte, $a_durlte);
172  array_push($this->order, array("field" => "durlte", "index" => count($this->durlte) - 1));
173  }
174 
175  public function addDurgt($a_durgt)
176  {
177  array_push($this->durgt, $a_durgt);
178  array_push($this->order, array("field" => "durgt", "index" => count($this->durgt) - 1));
179  }
180 
181  public function addDurgte($a_durgte)
182  {
183  array_push($this->durgte, $a_durgte);
184  array_push($this->order, array("field" => "durgte", "index" => count($this->durgte) - 1));
185  }
186 
187  public function addVarextension($a_varextension)
188  {
189  array_push($this->varextension, $a_varextension);
190  array_push($this->order, array("field" => "varextension", "index" => count($this->varextension) - 1));
191  }
192 
193  public function addResponseVar($a_responsevar)
194  {
195  switch ($a_responsevar->getVartype()) {
196  case RESPONSEVAR_EQUAL:
197  $this->addVarequal($a_responsevar);
198  break;
199  case RESPONSEVAR_LT:
200  $this->addVarlt($a_responsevar);
201  break;
202  case RESPONSEVAR_LTE:
203  $this->addVarlte($a_responsevar);
204  break;
205  case RESPONSEVAR_GT:
206  $this->addVargt($a_responsevar);
207  break;
208  case RESPONSEVAR_GTE:
209  $this->addVargte($a_responsevar);
210  break;
211  case RESPONSEVAR_SUBSET:
212  $this->addVarsubset($a_responsevar);
213  break;
214  case RESPONSEVAR_INSIDE:
215  $this->addVarinside($a_responsevar);
216  break;
218  $this->addVarsubstring($a_responsevar);
219  break;
220  }
221  }
222 }
const RESPONSEVAR_LTE
const RESPONSEVAR_INSIDE
const RESPONSEVAR_SUBSTRING
addVarextension($a_varextension)
const RESPONSEVAR_LT
const RESPONSEVAR_GT
addResponseVar($a_responsevar)
const RESPONSEVAR_GTE
const RESPONSEVAR_EQUAL
addVarsubstring($a_varsubstring)
const RESPONSEVAR_SUBSET