ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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{
38 var $other;
40 var $varlt;
42 var $vargt;
48 var $durlt;
50 var $durgt;
53 var $order;
54
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 {
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;
213 $this->addVarsubset($a_responsevar);
214 break;
216 $this->addVarinside($a_responsevar);
217 break;
219 $this->addVarsubstring($a_responsevar);
220 break;
221 }
222 }
223}
224?>
const RESPONSEVAR_GTE
const RESPONSEVAR_LT
const RESPONSEVAR_EQUAL
const RESPONSEVAR_LTE
const RESPONSEVAR_INSIDE
const RESPONSEVAR_SUBSTRING
const RESPONSEVAR_SUBSET
const RESPONSEVAR_GT
addResponseVar($a_responsevar)
addVarsubstring($a_varsubstring)
addVarextension($a_varextension)