ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilQTIResponse.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
30{
31 public const RT_RESPONSE_LID = "1";
32 public const RT_RESPONSE_XY = "2";
33 public const RT_RESPONSE_STR = "3";
34 public const RT_RESPONSE_NUM = "4";
35 public const RT_RESPONSE_GRP = "5";
36
37 public const R_CARDINALITY_SINGLE = "1";
38 public const R_CARDINALITY_MULTIPLE = "2";
39 public const R_CARDINALITY_ORDERED = "3";
40
41 public const RTIMING_NO = "1";
42 public const RTIMING_YES = "2";
43
44 public const NUMTYPE_INTEGER = "1";
45 public const NUMTYPE_DECIMAL = "2";
46 public const NUMTYPE_SCIENTIFIC = "3";
47
48 public int $flow = 0;
51 public ?string $ident = null;
52 public string $rcardinality = '';
53
57 public $render_type = null;
58 public ?ilQTIMaterial $material1 = null;
59 public ?ilQTIMaterial $material2 = null;
60 public ?string $rtiming = null;
61 public ?string $numtype = null;
62
66 public function __construct($a_response_type = 0)
67 {
68 $this->response_type = $a_response_type;
69 }
70
74 public function setResponsetype($a_responsetype): void
75 {
76 $this->response_type = $a_responsetype;
77 }
78
82 public function getResponsetype()
83 {
85 }
86
87 public function setIdent(string $a_ident): void
88 {
89 $this->ident = $a_ident;
90 }
91
92 public function getIdent(): ?string
93 {
94 return $this->ident;
95 }
96
97 public function setRCardinality(string $a_rcardinality): void
98 {
99 switch (strtolower($a_rcardinality)) {
100 case "single":
101 case "1":
102 $this->rcardinality = self::R_CARDINALITY_SINGLE;
103 break;
104 case "multiple":
105 case "2":
106 $this->rcardinality = self::R_CARDINALITY_MULTIPLE;
107 break;
108 case "ordered":
109 case "3":
110 $this->rcardinality = self::R_CARDINALITY_ORDERED;
111 break;
112 }
113 }
114
115 public function getRCardinality(): string
116 {
117 return $this->rcardinality;
118 }
119
120 public function setRTiming(string $a_rtiming): void
121 {
122 switch (strtolower($a_rtiming)) {
123 case "no":
124 case "1":
125 $this->rtiming = self::RTIMING_NO;
126 break;
127 case "yes":
128 case "2":
129 $this->rtiming = self::RTIMING_YES;
130 break;
131 }
132 }
133
134 public function getRTiming(): ?string
135 {
136 return $this->rtiming;
137 }
138
139 public function setNumtype(string $a_numtype): void
140 {
141 switch (strtolower($a_numtype)) {
142 case "integer":
143 case "1":
144 $this->numtype = self::NUMTYPE_INTEGER;
145 break;
146 case "decimal":
147 case "2":
148 $this->numtype = self::NUMTYPE_DECIMAL;
149 break;
150 case "scientific":
151 case "3":
152 $this->numtype = self::NUMTYPE_SCIENTIFIC;
153 break;
154 }
155 }
156
157 public function getNumtype(): ?string
158 {
159 return $this->numtype;
160 }
161
165 public function setRenderType($a_render_type): void
166 {
167 $this->render_type = $a_render_type;
168 }
169
173 public function getRenderType()
174 {
175 return $this->render_type;
176 }
177
178 public function setFlow(int $a_flow): void
179 {
180 $this->flow = $a_flow;
181 }
182
183 public function getFlow(): int
184 {
185 return $this->flow;
186 }
187
188 public function setMaterial1(ilQTIMaterial $a_material): void
189 {
190 $this->material1 = $a_material;
191 }
192
193 public function getMaterial1(): ?ilQTIMaterial
194 {
195 return $this->material1;
196 }
197
198 public function setMaterial2(ilQTIMaterial $a_material): void
199 {
200 $this->material2 = $a_material;
201 }
202
203 public function getMaterial2(): ?ilQTIMaterial
204 {
205 return $this->material2;
206 }
207
208 public function hasRendering(): bool
209 {
210 return $this->render_type != null;
211 }
212}
setMaterial1(ilQTIMaterial $a_material)
setRTiming(string $a_rtiming)
setIdent(string $a_ident)
__construct($a_response_type=0)
ilQTIMaterial $material2
setFlow(int $a_flow)
ilQTIMaterial $material1
setRCardinality(string $a_rcardinality)
setRenderType($a_render_type)
setMaterial2(ilQTIMaterial $a_material)
setNumtype(string $a_numtype)
setResponsetype($a_responsetype)