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