ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilQTIDecvar.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 
24 define ("VARTYPE_INTEGER", "1");
25 define ("VARTYPE_STRING", "2");
26 define ("VARTYPE_DECIMAL", "3");
27 define ("VARTYPE_SCIENTIFIC", "4");
28 define ("VARTYPE_BOOLEAN", "5");
29 define ("VARTYPE_ENUMERATED", "6");
30 define ("VARTYPE_SET", "7");
31 
41 {
42  var $varname;
43  var $vartype;
45  var $minvalue;
46  var $maxvalue;
47  var $members;
48  var $cutvalue;
49  var $content;
51 
52  function ilQTIDecvar()
53  {
54  $this->interpretvar = array();
55  }
56 
57  function setVarname($a_varname)
58  {
59  $this->varname = $a_varname;
60  }
61 
62  function getVarname()
63  {
64  return $this->varname;
65  }
66 
67  function setVartype($a_vartype)
68  {
69  switch (strtolower($a_vartype))
70  {
71  case "integer":
72  case "1":
73  $this->vartype = VARTYPE_INTEGER;
74  break;
75  case "string":
76  case "2":
77  $this->vartype = VARTYPE_STRING;
78  break;
79  case "decimal":
80  case "3":
81  $this->vartype = VARTYPE_DECIMAL;
82  break;
83  case "scientific":
84  case "4":
85  $this->vartype = VARTYPE_SCIENTIFIC;
86  break;
87  case "boolean":
88  case "5":
89  $this->vartype = VARTYPE_BOOLEAN;
90  break;
91  case "enumerated":
92  case "6":
93  $this->vartype = VARTYPE_ENUMERATED;
94  break;
95  case "set":
96  case "7":
97  $this->vartype = VARTYPE_SET;
98  break;
99  }
100  }
101 
102  function getVartype()
103  {
104  return $this->vartype;
105  }
106 
107  function setDefaultval($a_defaultval)
108  {
109  $this->defaultval = $a_defaultval;
110  }
111 
112  function getDefaultval()
113  {
114  return $this->defaultval;
115  }
116 
117  function setMinvalue($a_minvalue)
118  {
119  $this->minvalue = $a_minvalue;
120  }
121 
122  function getMinvalue()
123  {
124  return $this->minvalue;
125  }
126 
127  function setMaxvalue($a_maxvalue)
128  {
129  $this->maxvalue = $a_maxvalue;
130  }
131 
132  function getMaxvalue()
133  {
134  return $this->maxvalue;
135  }
136 
137  function setMembers($a_members)
138  {
139  $this->members = $a_members;
140  }
141 
142  function getMembers()
143  {
144  return $this->members;
145  }
146 
147  function setCutvalue($a_cutvalue)
148  {
149  $this->cutvalue = $a_cutvalue;
150  }
151 
152  function getCutvalue()
153  {
154  return $this->cutvalue;
155  }
156 
157  function setContent($a_content)
158  {
159  $this->content = $a_content;
160  }
161 
162  function getContent()
163  {
164  return $this->content;
165  }
166 
167  function addInterpretvar($a_interpretvar)
168  {
169  array_push($this->interpretvar, $a_interpretvar);
170  }
171 }
172 ?>