ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
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  var $flow;
53  var $ident;
58  var $rtiming;
59  var $numtype;
60 
61  function ilQTIResponse($a_response_type = 0)
62  {
63  $this->flow = 0;
64  $this->render_type = NULL;
65  $this->response_type = $a_response_type;
66  }
67 
68  function setResponsetype($a_responsetype)
69  {
70  $this->response_type = $a_responsetype;
71  }
72 
73  function getResponsetype()
74  {
75  return $this->response_type;
76  }
77 
78  function setIdent($a_ident)
79  {
80  $this->ident = $a_ident;
81  }
82 
83  function getIdent()
84  {
85  return $this->ident;
86  }
87 
88  function setRCardinality($a_rcardinality)
89  {
90  switch (strtolower($a_rcardinality))
91  {
92  case "single":
93  case "1":
94  $this->rcardinality = R_CARDINALITY_SINGLE;
95  break;
96  case "multiple":
97  case "2":
98  $this->rcardinality = R_CARDINALITY_MULTIPLE;
99  break;
100  case "ordered":
101  case "3":
102  $this->rcardinality = R_CARDINALITY_ORDERED;
103  break;
104  }
105  }
106 
107  function getRCardinality()
108  {
109  return $this->rcardinality;
110  }
111 
112  function setRTiming($a_rtiming)
113  {
114  switch (strtolower($a_rtiming))
115  {
116  case "no":
117  case "1":
118  $this->rtiming = RTIMING_NO;
119  break;
120  case "yes":
121  case "2":
122  $this->rtiming = RTIMING_YES;
123  break;
124  }
125  }
126 
127  function getRTiming()
128  {
129  return $this->rtiming;
130  }
131 
132  function setNumtype($a_numtype)
133  {
134  switch (strtolower($a_numtype))
135  {
136  case "integer":
137  case "1":
138  $this->numtype = NUMTYPE_INTEGER;
139  break;
140  case "decimal":
141  case "2":
142  $this->numtype = NUMTYPE_DECIMAL;
143  break;
144  case "scientific":
145  case "3":
146  $this->numtype = NUMTYPE_SCIENTIFIC;
147  break;
148  }
149  }
150 
151  function getNumtype()
152  {
153  return $this->numtype;
154  }
155 
156  function setRenderType($a_render_type)
157  {
158  $this->render_type = $a_render_type;
159  }
160 
161  function getRenderType()
162  {
163  return $this->render_type;
164  }
165 
166  function setFlow($a_flow)
167  {
168  $this->flow = $a_flow;
169  }
170 
171  function getFlow()
172  {
173  return $this->flow;
174  }
175 
176  function setMaterial1($a_material)
177  {
178  $this->material1 = $a_material;
179  }
180 
181  function getMaterial1()
182  {
183  return $this->material1;
184  }
185 
186  function setMaterial2($a_material)
187  {
188  $this->material2 = $a_material;
189  }
190 
191  function getMaterial2()
192  {
193  return $this->material2;
194  }
195 
196  function hasRendering()
197  {
198  if ($this->render_type != NULL)
199  {
200  return TRUE;
201  }
202  else
203  {
204  return FALSE;
205  }
206  }
207 }
208 ?>