ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilQTIRenderFib.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 ("PROMPT_BOX", "1");
25define ("PROMPT_DASHLINE", "2");
26define ("PROMPT_ASTERISK", "3");
27define ("PROMPT_UNDERLINE", "4");
28
29define ("FIBTYPE_STRING", "1");
30define ("FIBTYPE_INTEGER", "2");
31define ("FIBTYPE_DECIMAL", "3");
32define ("FIBTYPE_SCIENTIFIC", "4");
33
43{
51 var $rows;
55
56 function ilQTIRenderFib()
57 {
58 $this->showdraw = SHOWDRAW_NO;
59 $this->response_labels = array();
60 $this->material = array();
61 $this->encoding = "UTF-8";
62 }
63
64 function setPrompt($a_prompt)
65 {
66 switch (strtolower($a_prompt))
67 {
68 case "1":
69 case "box":
70 $this->prompt = PROMPT_BOX;
71 break;
72 case "2":
73 case "dashline":
74 $this->prompt = PROMPT_DASHLINE;
75 break;
76 case "3":
77 case "asterisk":
78 $this->prompt = PROMPT_ASTERISK;
79 break;
80 case "4":
81 case "underline":
82 $this->prompt = PROMPT_UNDERLINE;
83 break;
84 }
85 }
86
87 function getPrompt()
88 {
89 return $this->prompt;
90 }
91
92 function setFibtype($a_fibtype)
93 {
94 switch (strtolower($a_fibtype))
95 {
96 case "1":
97 case "string":
98 $this->fibtype = FIBTYPE_STRING;
99 break;
100 case "2":
101 case "integer":
102 $this->fibtype = FIBTYPE_INTEGER;
103 break;
104 case "3":
105 case "decimal":
106 $this->fibtype = FIBTYPE_DECIMAL;
107 break;
108 case "4":
109 case "scientific":
110 $this->fibtype = FIBTYPE_SCIENTIFIC;
111 break;
112 }
113 }
114
115 function getFibtype()
116 {
117 return $this->fibtype;
118 }
119
120 function setMinnumber($a_minnumber)
121 {
122 $this->minnumber = $a_minnumber;
123 }
124
125 function getMinnumber()
126 {
127 return $this->minnumber;
128 }
129
130 function setMaxnumber($a_maxnumber)
131 {
132 $this->maxnumber = $a_maxnumber;
133 }
134
135 function getMaxnumber()
136 {
137 return $this->maxnumber;
138 }
139
140 function addResponseLabel($a_response_label)
141 {
142 array_push($this->response_labels, $a_response_label);
143 }
144
145 function addMaterial($a_material)
146 {
147 array_push($this->material, $a_material);
148 }
149
150 function setEncoding($a_encoding)
151 {
152 $this->encoding = $a_encoding;
153 }
154
155 function getEncoding()
156 {
157 return $this->encoding;
158 }
159
160 function setRows($a_rows)
161 {
162 $this->rows = $a_rows;
163 }
164
165 function getRows()
166 {
167 return $this->rows;
168 }
169
170 function setMaxchars($a_maxchars)
171 {
172 $this->maxchars = $a_maxchars;
173 }
174
175 function getMaxchars()
176 {
177 return $this->maxchars;
178 }
179
180 function setColumns($a_columns)
181 {
182 $this->columns = $a_columns;
183 }
184
185 function getColumns()
186 {
187 return $this->columns;
188 }
189
190 function setCharset($a_charset)
191 {
192 $this->charset = $a_charset;
193 }
194
195 function getCharset()
196 {
197 return $this->charset;
198 }
199}
200?>
const PROMPT_ASTERISK
const FIBTYPE_STRING
const FIBTYPE_INTEGER
const FIBTYPE_SCIENTIFIC
const FIBTYPE_DECIMAL
const PROMPT_BOX
const PROMPT_DASHLINE
const PROMPT_UNDERLINE
const SHOWDRAW_NO
setEncoding($a_encoding)
setMaxnumber($a_maxnumber)
setMinnumber($a_minnumber)
addMaterial($a_material)
setMaxchars($a_maxchars)
addResponseLabel($a_response_label)