ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.GUIRequest.php
Go to the documentation of this file.
1 <?php
2 
19 namespace ILIAS\Exercise;
20 
22 
31 {
33 
34  public function __construct(
37  ?array $passed_query_params = null,
38  ?array $passed_post_data = null
39  ) {
40  $this->initRequest(
41  $http,
42  $refinery,
43  $passed_query_params,
44  $passed_post_data
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  public function getGiverId(): int
343  {
344  return $this->int("giver_id");
345  }
346 
347  // different from "fu" parameter above!
348  public function getCritId(): string
349  {
350  return $this->str("crit_id");
351  }
352 
353  // peer review files?
354  public function getFileHash(): string
355  {
356  return trim($this->str("fuf"));
357  }
358 
362  public function getCatalogueIds(): array
363  {
364  return $this->getIds();
365  }
366 
367  public function getCatalogueId(): int
368  {
369  return $this->int("cat_id");
370  }
371 
375  public function getCriteriaIds(): array
376  {
377  return $this->getIds();
378  }
379 
380 
381  //
382  // Team related
383  //
384 
388  public function getTeamIds(): array
389  {
390  return $this->getIds();
391  }
392 
393  //
394  // Order / positions related
395  //
396 
400  public function getOrder(): array
401  {
402  return $this->intArray("order");
403  }
404 
408  public function getPositions(): array
409  {
410  return $this->intArray("pos");
411  }
412 
413  //
414  // Text related
415  //
416 
417  public function getMinCharLimit(): int
418  {
419  return $this->int("min_char_limit");
420  }
421 
422  //
423  // Status / LP related
424  //
425 
429  public function getLearningComments(): array
430  {
431  return $this->strArray("lcomment");
432  }
433 
438  public function getMarks(): array
439  {
440  return $this->strArray("mark");
441  }
442 
447  public function getTutorNotices(): array
448  {
449  return $this->strArray("notice");
450  }
451 
456  public function getStatus(): array
457  {
458  return $this->strArray("status");
459  }
460 
461  public function getComment(): string
462  {
463  return $this->str("comment");
464  }
465 
466  public function getRatingValue(): string
467  {
468  return $this->str("value");
469  }
470 
474  public function getSubmittedFileIds(): array
475  {
476  return $this->intArray("delivered");
477  }
478 
479  public function getSubmittedFileId(): int
480  {
481  return $this->int("delivered");
482  }
483 
484  public function getResourceObjectId(): int
485  {
486  return $this->int("item");
487  }
488 
489  public function getBlogId(): int
490  {
491  return $this->int("blog_id");
492  }
493 
494  public function getPortfolioId(): int
495  {
496  return $this->int("prtf_id");
497  }
498 
499  public function getBackView(): int
500  {
501  return $this->int("vw");
502  }
503 
504  public function getMode(): string
505  {
506  return $this->str("mode");
507  }
508 
509  public function getFromOverview(): bool
510  {
511  return (bool) $this->int("from_overview");
512  }
513 
514  public function getZip(): bool
515  {
516  return (bool) $this->int("zip");
517  }
518 
519 }
Exercise assignment.
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
Interface Observer Contains several chained tasks and infos about them.
getTutorNotices()
key might be ass_ids or user_ids!
getStatus()
key might be ass_ids or user_ids!
isArray(string $key)
Check if parameter is an array.
getMarks()
key might be ass_ids or user_ids!
$http
Definition: deliver.php:30
__construct(\ILIAS\HTTP\Services $http, \ILIAS\Refinery\Factory $refinery, ?array $passed_query_params=null, ?array $passed_post_data=null)
trait BaseGUIRequest
Base gui request wrapper.
getAssignmentIds()
note: shares "id" parameter with team ids
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 ilObjExercise.
Builds data types.
Definition: Factory.php:35
static _lookupType(int $id, bool $reference=false)
Exercise gui request wrapper.