ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilQTIResponseVar.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
24define ("RESPONSEVAR_EQUAL", "1");
25define ("RESPONSEVAR_LT", "2");
26define ("RESPONSEVAR_LTE", "3");
27define ("RESPONSEVAR_GT", "4");
28define ("RESPONSEVAR_GTE", "5");
29define ("RESPONSEVAR_SUBSET", "6");
30define ("RESPONSEVAR_INSIDE", "7");
31define ("RESPONSEVAR_SUBSTRING", "8");
32
33define ("CASE_YES", "1");
34define ("CASE_NO", "2");
35
36define ("SETMATCH_PARTIAL", "1");
37define ("SETMATCH_EXACT", "2");
38
39define ("AREATYPE_ELLIPSE", "1");
40define ("AREATYPE_RECTANGLE", "2");
41define ("AREATYPE_BOUNDED", "3");
42
52{
54 var $case;
56 var $index;
60
61 function ilQTIResponseVar($a_vartype)
62 {
63 $this->setVartype($a_vartype);
64 }
65
66 function setVartype($a_vartype)
67 {
68 $this->vartype = $a_vartype;
69 }
70
71 function getVartype()
72 {
73 return $this->vartype;
74 }
75
76 function setCase($a_case)
77 {
78 switch (strtolower($a_case))
79 {
80 case "1":
81 case "yes":
82 $this->case = CASE_YES;
83 break;
84 case "2":
85 case "no":
86 $this->case = CASE_NO;
87 break;
88 }
89 }
90
91 function getCase()
92 {
93 return $this->case;
94 }
95
96 function setRespident($a_respident)
97 {
98 $this->respident = $a_respident;
99 }
100
101 function getRespident()
102 {
103 return $this->respident;
104 }
105
106 function setIndex($a_index)
107 {
108 $this->index = $a_index;
109 }
110
111 function getIndex()
112 {
113 return $this->index;
114 }
115
116 function setSetmatch($a_setmatch)
117 {
118 switch (strtolower($a_setmatch))
119 {
120 case "1":
121 case "partial":
122 $this->setmatch = SETMATCH_PARTIAL;
123 break;
124 case "2":
125 case "exact":
126 $this->setmatch = SETMATCH_EXACT;
127 break;
128 }
129 }
130
131 function getSetmatch()
132 {
133 return $this->setmatch;
134 }
135
136 function setAreatype($a_areatype)
137 {
138 switch (strtolower($a_areatype))
139 {
140 case "1":
141 case "ellipse":
142 $this->areatype = AREATYPE_ELLIPSE;
143 break;
144 case "2":
145 case "rectangle":
146 $this->areatype = AREATYPE_RECTANGLE;
147 break;
148 case "3":
149 case "bounded":
150 $this->areatype = AREATYPE_BOUNDED;
151 break;
152 }
153 }
154
155 function getAreatype()
156 {
157 return $this->areatype;
158 }
159
160 function setContent($a_content)
161 {
162 $this->content = $a_content;
163 }
164
165 function getContent()
166 {
167 return $this->content;
168 }
169}
170?>
const AREATYPE_BOUNDED
const CASE_YES
const AREATYPE_RECTANGLE
const SETMATCH_EXACT
const CASE_NO
const SETMATCH_PARTIAL
const AREATYPE_ELLIPSE