ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilQTIResponseVar.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("RESPONSEVAR_EQUAL", "1");
25define("RESPONSEVAR_LT", "2");
26define("RESPONSEVAR_LTE", "3");
27define("RESPONSEVAR_GT", "4");
28define("RESPONSEVAR_GTE", "5");
29define("RESPONSEVAR_SUBSET", "6");
30define("RESPONSEVAR_INSIDE", "7");
31define("RESPONSEVAR_SUBSTRING", "8");
32
33define("CASE_YES", "1");
34define("CASE_NO", "2");
35
36define("SETMATCH_PARTIAL", "1");
37define("SETMATCH_EXACT", "2");
38
39define("AREATYPE_ELLIPSE", "1");
40define("AREATYPE_RECTANGLE", "2");
41define("AREATYPE_BOUNDED", "3");
42
52{
53 public $vartype;
54 public $case;
55 public $respident;
56 public $index;
57 public $setmatch;
58 public $areatype;
59 public $content;
60
61 public function __construct($a_vartype)
62 {
63 $this->setVartype($a_vartype);
64 }
65
66 public function setVartype($a_vartype)
67 {
68 $this->vartype = $a_vartype;
69 }
70
71 public function getVartype()
72 {
73 return $this->vartype;
74 }
75
76 public function setCase($a_case)
77 {
78 switch (strtolower($a_case)) {
79 case "1":
80 case "yes":
81 $this->case = CASE_YES;
82 break;
83 case "2":
84 case "no":
85 $this->case = CASE_NO;
86 break;
87 }
88 }
89
90 public function getCase()
91 {
92 return $this->case;
93 }
94
95 public function setRespident($a_respident)
96 {
97 $this->respident = $a_respident;
98 }
99
100 public function getRespident()
101 {
102 return $this->respident;
103 }
104
105 public function setIndex($a_index)
106 {
107 $this->index = $a_index;
108 }
109
110 public function getIndex()
111 {
112 return $this->index;
113 }
114
115 public function setSetmatch($a_setmatch)
116 {
117 switch (strtolower($a_setmatch)) {
118 case "1":
119 case "partial":
120 $this->setmatch = SETMATCH_PARTIAL;
121 break;
122 case "2":
123 case "exact":
124 $this->setmatch = SETMATCH_EXACT;
125 break;
126 }
127 }
128
129 public function getSetmatch()
130 {
131 return $this->setmatch;
132 }
133
134 public function setAreatype($a_areatype)
135 {
136 switch (strtolower($a_areatype)) {
137 case "1":
138 case "ellipse":
139 $this->areatype = AREATYPE_ELLIPSE;
140 break;
141 case "2":
142 case "rectangle":
143 $this->areatype = AREATYPE_RECTANGLE;
144 break;
145 case "3":
146 case "bounded":
147 $this->areatype = AREATYPE_BOUNDED;
148 break;
149 }
150 }
151
152 public function getAreatype()
153 {
154 return $this->areatype;
155 }
156
157 public function setContent($a_content)
158 {
159 $this->content = $a_content;
160 }
161
162 public function getContent()
163 {
164 return $this->content;
165 }
166}
An exception for terminatinating execution or to throw for unit testing.
const AREATYPE_BOUNDED
const CASE_YES
const AREATYPE_RECTANGLE
const SETMATCH_EXACT
const CASE_NO
const SETMATCH_PARTIAL
const AREATYPE_ELLIPSE
$a_content
Definition: workflow.php:93