ILIAS  release_8 Revision v8.24
class.GUIRequest.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\Exercise;
20
22
31{
33
34 public function __construct(
35 \ILIAS\HTTP\Services $http,
36 \ILIAS\Refinery\Factory $refinery,
37 ?array $passed_query_params = null,
38 ?array $passed_post_data = null
39 ) {
40 $this->initRequest(
41 $http,
45 );
46 }
47
51 protected function getIds(): array
52 {
53 // "id" parameter used in team submission gui
54 if ($this->isArray("id")) {
55 return $this->intArray("id");
56 } else {
57 $team_id = $this->int("id");
58 return ($team_id > 0)
59 ? [$this->int("id")]
60 : [];
61 }
62 }
63
68 public function getAssignmentIds(): array
69 {
70 return $this->getIds();
71 }
72
73 public function getRefId(): int
74 {
75 return $this->int("ref_id");
76 }
77
78 public function getAssId(): int
79 {
80 return $this->int("ass_id");
81 }
82
86 public function getAssIds(): array
87 {
88 return $this->intArray("ass");
89 }
90
91 public function getAssIdGoto(): int
92 {
93 return $this->int("ass_id_goto");
94 }
95
99 public function getExercise(): ?\ilObjExercise
100 {
101 if ($this->getRefId() > 0 && \ilObject::_lookupType($this->getRefId(), true) == "exc") {
102 return new \ilObjExercise($this->getRefId());
103 }
104 return null;
105 }
106
110 public function getAssignment(): ?\ilExAssignment
111 {
112 if ($this->getAssId() > 0) {
113 return new \ilExAssignment($this->getAssId());
114 }
115 return null;
116 }
117
118 public function getAssType(): string
119 {
120 return $this->str("ass_type");
121 }
122
123 // also assignment type? see ilExAssignmentEditor
124 public function getType(): int
125 {
126 return $this->int("type");
127 }
128
129 // criteria type
130 public function getCriteriaType(): string
131 {
132 return $this->str("type");
133 }
134
138 public function getSelectedAssignments(): array
139 {
140 return $this->intArray("sel_ass_ids");
141 }
142
146 public function getListedAssignments(): array
147 {
148 return $this->intArray("listed_ass_ids");
149 }
150
151 //
152 // User related
153 //
154
155 public function getMemberId(): int
156 {
157 return $this->int("member_id");
158 }
159
160 public function getMemberIds(): array
161 {
162 return $this->intArray("member_ids");
163 }
164
165 // can me merged with member id?
166 public function getParticipantId(): int
167 {
168 return $this->int("part_id");
169 }
170
171 public function getUserId(): int
172 {
173 return $this->int("user_id");
174 }
175
176 public function getUserLogin(): string
177 {
178 return trim($this->str("user_login"));
179 }
180
184 public function getSelectedParticipants(): array
185 {
186 return $this->intArray("sel_part_ids");
187 }
188
192 public function getListedParticipants(): array
193 {
194 return $this->intArray("listed_part_ids");
195 }
196
200 public function getGroupMembers(): array
201 {
202 return $this->arrayArray("grpt");
203 }
204
205 //
206 // File related
207 //
208
209 public function getOldName(): string
210 {
211 return $this->str("old_name");
212 }
213
214 public function getNewName(): string
215 {
216 return $this->str("new_name");
217 }
218
222 public function getFiles(): array
223 {
224 return $this->arrayArray("file");
225 }
226
230 public function getInstructionFilesToDelete(): array
231 {
232 return $this->strArray("file");
233 }
234
235 public function getFile(): string
236 {
237 return $this->str("file");
238 }
239
240 //
241 // Individual deadline related
242 //
243
244 // sie ilExcIdl.js
245 public function getDone(): bool
246 {
247 return (bool) $this->int("dn");
248 }
249
250 public function getIdlId(): string
251 {
252 return $this->str("idlid"); // may be comma separated
253 }
254
258 public function getListedIdlIDs(): array
259 {
260 return $this->strArray("listed_idl_ids");
261 }
262
263 //
264 // Table / Filter related
265 //
266
267 public function getOffset(): int
268 {
269 return $this->int("offset");
270 }
271
272 public function getSortOrder(): string
273 {
274 return $this->str("sort_order");
275 }
276
277 public function getSortBy(): string
278 {
279 return $this->str("sort_by");
280 }
281
282 public function getFilterStatus(): string
283 {
284 return trim($this->str("filter_status"));
285 }
286
287 public function getFilterFeedback(): string
288 {
289 return trim($this->str("filter_feedback"));
290 }
291
292 //
293 // Workspace related
294 //
295
296 public function getSelectedWspObjId(): int
297 {
298 return $this->int("sel_wsp_obj");
299 }
300
301 //
302 // Peer review related
303 //
304
305 public function getReviewGiverId(): int
306 {
307 $giver_peer_id = $this->str("fu");
308 $parts = explode("__", $giver_peer_id);
309 if (count($parts) > 1) {
310 return (int) $parts[0];
311 }
312 return 0;
313 }
314
315 public function getReviewPeerId(): int
316 {
317 $giver_peer_id = $this->str("fu");
318 $parts = explode("__", $giver_peer_id);
319 if (count($parts) > 1) {
320 return (int) $parts[1];
321 }
322
323 return 0;
324 }
325
326 public function getReviewCritId(): string
327 {
328 $giver_peer_id = $this->str("fu");
329 $parts = explode("__", $giver_peer_id);
330 if (isset($parts[2])) {
331 return (string) $parts[2];
332 }
333 return "";
334 }
335
336 // different from "fu" parameter above!
337 public function getPeerId(): int
338 {
339 return $this->int("peer_id");
340 }
341
342 // different from "fu" parameter above!
343 public function getCritId(): string
344 {
345 return $this->str("crit_id");
346 }
347
348 // peer review files?
349 public function getFileHash(): string
350 {
351 return trim($this->str("fuf"));
352 }
353
357 public function getCatalogueIds(): array
358 {
359 return $this->getIds();
360 }
361
362 public function getCatalogueId(): int
363 {
364 return $this->int("cat_id");
365 }
366
370 public function getCriteriaIds(): array
371 {
372 return $this->getIds();
373 }
374
375
376 //
377 // Team related
378 //
379
383 public function getTeamIds(): array
384 {
385 return $this->getIds();
386 }
387
388 //
389 // Order / positions related
390 //
391
395 public function getOrder(): array
396 {
397 return $this->intArray("order");
398 }
399
403 public function getPositions(): array
404 {
405 return $this->intArray("pos");
406 }
407
408 //
409 // Text related
410 //
411
412 public function getMinCharLimit(): int
413 {
414 return $this->int("min_char_limit");
415 }
416
417 //
418 // Status / LP related
419 //
420
424 public function getLearningComments(): array
425 {
426 return $this->strArray("lcomment");
427 }
428
433 public function getMarks(): array
434 {
435 return $this->strArray("mark");
436 }
437
442 public function getTutorNotices(): array
443 {
444 return $this->strArray("notice");
445 }
446
451 public function getStatus(): array
452 {
453 return $this->strArray("status");
454 }
455
456 public function getComment(): string
457 {
458 return $this->str("comment");
459 }
460
461 public function getRatingValue(): string
462 {
463 return $this->str("value");
464 }
465
469 public function getSubmittedFileIds(): array
470 {
471 return $this->intArray("delivered");
472 }
473
474 public function getSubmittedFileId(): int
475 {
476 return $this->int("delivered");
477 }
478
479 public function getResourceObjectId(): int
480 {
481 return $this->int("item");
482 }
483
484 public function getBlogId(): int
485 {
486 return $this->int("blog_id");
487 }
488
489 public function getPortfolioId(): int
490 {
491 return $this->int("prtf_id");
492 }
493
494 public function getBackView(): int
495 {
496 return $this->int("vw");
497 }
498}
Builds data types.
Definition: Factory.php:21
Exercise gui request wrapper.
getAssignmentIds()
note: shares "id" parameter with team ids
getTutorNotices()
key might be ass_ids or user_ids!
__construct(\ILIAS\HTTP\Services $http, \ILIAS\Refinery\Factory $refinery, ?array $passed_query_params=null, ?array $passed_post_data=null)
getMarks()
key might be ass_ids or user_ids!
getStatus()
key might be ass_ids or user_ids!
Exercise assignment.
Class ilObjExercise.
static _lookupType(int $id, bool $reference=false)
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isArray(string $key)
Check if parameter is an array.
Refinery Factory $refinery
trait BaseGUIRequest
Base gui request wrapper.
initRequest(HTTP\Services $http, Refinery\Factory $refinery, ?array $passed_query_params=null, ?array $passed_post_data=null)
Query params and post data parameters are used for testing.
Class ChatMainBarProvider \MainMenu\Provider.
$http
Definition: raiseError.php:7