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 34/** 35* QTI render fib class 36* 37* @author Helmut Schottmüller <hschottm@gmx.de> 38* @version $Id$ 39* 40* @package assessment 41*/ 42class ilQTIRenderFib 43{ 44 public $minnumber; 45 public $maxnumber; 46 public $response_labels; 47 public $material; 48 public $prompt; 49 public $encoding; 50 public $fibtype; 51 public $rows; 52 public $maxchars; 53 public $columns; 54 public $charset; 55 56 public function __construct() 57 { 58 $this->response_labels = array(); 59 $this->material = array(); 60 $this->encoding = "UTF-8"; 61 } 62 63 public function setPrompt($a_prompt) 64 { 65 switch (strtolower($a_prompt)) { 66 case "1": 67 case "box": 68 $this->prompt = PROMPT_BOX; 69 break; 70 case "2": 71 case "dashline": 72 $this->prompt = PROMPT_DASHLINE; 73 break; 74 case "3": 75 case "asterisk": 76 $this->prompt = PROMPT_ASTERISK; 77 break; 78 case "4": 79 case "underline": 80 $this->prompt = PROMPT_UNDERLINE; 81 break; 82 } 83 } 84 85 public function getPrompt() 86 { 87 return $this->prompt; 88 } 89 90 public function setFibtype($a_fibtype) 91 { 92 switch (strtolower($a_fibtype)) { 93 case "1": 94 case "string": 95 $this->fibtype = FIBTYPE_STRING; 96 break; 97 case "2": 98 case "integer": 99 $this->fibtype = FIBTYPE_INTEGER; 100 break; 101 case "3": 102 case "decimal": 103 $this->fibtype = FIBTYPE_DECIMAL; 104 break; 105 case "4": 106 case "scientific": 107 $this->fibtype = FIBTYPE_SCIENTIFIC; 108 break; 109 } 110 } 111 112 public function getFibtype() 113 { 114 return $this->fibtype; 115 } 116 117 public function setMinnumber($a_minnumber) 118 { 119 $this->minnumber = $a_minnumber; 120 } 121 122 public function getMinnumber() 123 { 124 return $this->minnumber; 125 } 126 127 public function setMaxnumber($a_maxnumber) 128 { 129 $this->maxnumber = $a_maxnumber; 130 } 131 132 public function getMaxnumber() 133 { 134 return $this->maxnumber; 135 } 136 137 public function addResponseLabel($a_response_label) 138 { 139 array_push($this->response_labels, $a_response_label); 140 } 141 142 public function addMaterial($a_material) 143 { 144 array_push($this->material, $a_material); 145 } 146 147 public function setEncoding($a_encoding) 148 { 149 $this->encoding = $a_encoding; 150 } 151 152 public function getEncoding() 153 { 154 return $this->encoding; 155 } 156 157 public function setRows($a_rows) 158 { 159 $this->rows = $a_rows; 160 } 161 162 public function getRows() 163 { 164 return $this->rows; 165 } 166 167 public function setMaxchars($a_maxchars) 168 { 169 $this->maxchars = $a_maxchars; 170 } 171 172 public function getMaxchars() 173 { 174 return $this->maxchars; 175 } 176 177 public function setColumns($a_columns) 178 { 179 $this->columns = $a_columns; 180 } 181 182 public function getColumns() 183 { 184 return $this->columns; 185 } 186 187 public function setCharset($a_charset) 188 { 189 $this->charset = $a_charset; 190 } 191 192 public function getCharset() 193 { 194 return $this->charset; 195 } 196} 197