ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilQTIResponse.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 define("RT_RESPONSE_LID", "1");
24 define("RT_RESPONSE_XY", "2");
25 define("RT_RESPONSE_STR", "3");
26 define("RT_RESPONSE_NUM", "4");
27 define("RT_RESPONSE_GRP", "5");
28 define("RT_RESPONSE_EXTENSION", "6");
29
30 define("R_CARDINALITY_SINGLE", "1");
31 define("R_CARDINALITY_MULTIPLE", "2");
32 define("R_CARDINALITY_ORDERED", "3");
33
34 define("RTIMING_NO", "1");
35 define("RTIMING_YES", "2");
36
37 define("NUMTYPE_INTEGER", "1");
38 define("NUMTYPE_DECIMAL", "2");
39 define("NUMTYPE_SCIENTIFIC", "3");
40
50{
51 public $flow;
53 public $ident;
56 public $material1;
57 public $material2;
58 public $rtiming;
59 public $numtype;
60
61 public function __construct($a_response_type = 0)
62 {
63 $this->flow = 0;
64 $this->render_type = null;
65 $this->response_type = $a_response_type;
66 }
67
68 public function setResponsetype($a_responsetype)
69 {
70 $this->response_type = $a_responsetype;
71 }
72
73 public function getResponsetype()
74 {
76 }
77
78 public function setIdent($a_ident)
79 {
80 $this->ident = $a_ident;
81 }
82
83 public function getIdent()
84 {
85 return $this->ident;
86 }
87
88 public function setRCardinality($a_rcardinality)
89 {
90 switch (strtolower($a_rcardinality)) {
91 case "single":
92 case "1":
93 $this->rcardinality = R_CARDINALITY_SINGLE;
94 break;
95 case "multiple":
96 case "2":
97 $this->rcardinality = R_CARDINALITY_MULTIPLE;
98 break;
99 case "ordered":
100 case "3":
101 $this->rcardinality = R_CARDINALITY_ORDERED;
102 break;
103 }
104 }
105
106 public function getRCardinality()
107 {
108 return $this->rcardinality;
109 }
110
111 public function setRTiming($a_rtiming)
112 {
113 switch (strtolower($a_rtiming)) {
114 case "no":
115 case "1":
116 $this->rtiming = RTIMING_NO;
117 break;
118 case "yes":
119 case "2":
120 $this->rtiming = RTIMING_YES;
121 break;
122 }
123 }
124
125 public function getRTiming()
126 {
127 return $this->rtiming;
128 }
129
130 public function setNumtype($a_numtype)
131 {
132 switch (strtolower($a_numtype)) {
133 case "integer":
134 case "1":
135 $this->numtype = NUMTYPE_INTEGER;
136 break;
137 case "decimal":
138 case "2":
139 $this->numtype = NUMTYPE_DECIMAL;
140 break;
141 case "scientific":
142 case "3":
143 $this->numtype = NUMTYPE_SCIENTIFIC;
144 break;
145 }
146 }
147
148 public function getNumtype()
149 {
150 return $this->numtype;
151 }
152
153 public function setRenderType($a_render_type)
154 {
155 $this->render_type = $a_render_type;
156 }
157
158 public function getRenderType()
159 {
160 return $this->render_type;
161 }
162
163 public function setFlow($a_flow)
164 {
165 $this->flow = $a_flow;
166 }
167
168 public function getFlow()
169 {
170 return $this->flow;
171 }
172
173 public function setMaterial1($a_material)
174 {
175 $this->material1 = $a_material;
176 }
177
178 public function getMaterial1()
179 {
180 return $this->material1;
181 }
182
183 public function setMaterial2($a_material)
184 {
185 $this->material2 = $a_material;
186 }
187
188 public function getMaterial2()
189 {
190 return $this->material2;
191 }
192
193 public function hasRendering()
194 {
195 if ($this->render_type != null) {
196 return true;
197 } else {
198 return false;
199 }
200 }
201}
An exception for terminatinating execution or to throw for unit testing.
const RTIMING_NO
const NUMTYPE_INTEGER
const RTIMING_YES
const R_CARDINALITY_SINGLE
const R_CARDINALITY_ORDERED
const NUMTYPE_DECIMAL
const NUMTYPE_SCIENTIFIC
const R_CARDINALITY_MULTIPLE
setNumtype($a_numtype)
setMaterial2($a_material)
setMaterial1($a_material)
__construct($a_response_type=0)
setRCardinality($a_rcardinality)
setRTiming($a_rtiming)
setRenderType($a_render_type)
setResponsetype($a_responsetype)