ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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  var $arr_not;
35  var $arr_and;
36  var $arr_or;
38  var $other;
39  var $varequal;
40  var $varlt;
41  var $varlte;
42  var $vargt;
43  var $vargte;
47  var $durequal;
48  var $durlt;
49  var $durlte;
50  var $durgt;
51  var $durgte;
53  var $order;
54 
55  function ilQTIConditionvar()
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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  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  function addResponseVar($a_responsevar)
194  {
195  switch ($a_responsevar->getVartype())
196  {
197  case RESPONSEVAR_EQUAL:
198  $this->addVarequal($a_responsevar);
199  break;
200  case RESPONSEVAR_LT:
201  $this->addVarlt($a_responsevar);
202  break;
203  case RESPONSEVAR_LTE:
204  $this->addVarlte($a_responsevar);
205  break;
206  case RESPONSEVAR_GT:
207  $this->addVargt($a_responsevar);
208  break;
209  case RESPONSEVAR_GTE:
210  $this->addVargte($a_responsevar);
211  break;
212  case RESPONSEVAR_SUBSET:
213  $this->addVarsubset($a_responsevar);
214  break;
215  case RESPONSEVAR_INSIDE:
216  $this->addVarinside($a_responsevar);
217  break;
219  $this->addVarsubstring($a_responsevar);
220  break;
221  }
222  }
223 }
224 ?>