ILIAS  release_8 Revision v8.24
class.InternalGUIService.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\Exercise;
20
22use ILIAS\HTTP;
26
33{
37 protected \ilLanguage $lng;
38 protected \ilCtrl $ctrl;
39 protected \ilToolbarGUI $toolbar;
41 protected Refinery\Factory $refinery;
42
44
45 protected ?GUIRequest $request = null;
46 protected \ilExSubmissionGUI $submission_gui;
47 protected \ilObjExercise $exc;
48
49 public function __construct(
53 ) {
54 $this->data_service = $data_service;
55 $this->domain_service = $domain_service;
56 $this->initGUIServices($DIC);
57 }
58
64 public function request(
65 ?array $query_params = null,
66 ?array $post_data = null
67 ): GUIRequest {
68 if (is_null($query_params) && is_null($post_data) && !is_null($this->request)) {
69 return $this->request;
70 }
71 $request = new GUIRequest(
72 $this->http(),
73 $this->domain_service->refinery(),
74 $query_params,
75 $post_data
76 );
77 if (is_null($query_params) && is_null($post_data)) {
78 $this->request = $request;
79 }
80 return $request;
81 }
82
86 public function getExerciseGUI(?int $ref_id = null): \ilObjExerciseGUI
87 {
88 if ($ref_id === null) {
89 $ref_id = $this->request()->getRefId();
90 }
91 return new \ilObjExerciseGUI([], $ref_id, true);
92 }
93
95 {
96 if ($exc === null) {
97 $exc = $this->request()->getExercise();
98 }
99 return new \ilExcRandomAssignmentGUI(
100 $this->ui(),
101 $this->toolbar(),
102 $this->domain_service->lng(),
103 $this->ctrl(),
104 $this->domain_service->assignment()->randomAssignments($exc)
105 );
106 }
107
108 public function getSubmissionGUI(
109 \ilObjExercise $exc = null,
110 \ilExAssignment $ass = null,
111 $member_id = null
113 if ($exc === null) {
114 $exc = $this->request()->getExercise();
115 }
116 if ($ass === null) {
117 $ass = $this->request()->getAssignment();
118 }
119 if ($member_id === null) {
120 $member_id = $this->request()->getMemberId();
121 }
122 return new \ilExSubmissionGUI(
123 $exc,
124 $ass,
125 $member_id
126 );
127 }
128}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
Provides fluid interface to RBAC services.
Definition: UIServices.php:24
Exercise gui request wrapper.
Internal factory for data objects.
Exercise domain service (business logic)
Exercise UI frontend presentation service class.
request(?array $query_params=null, ?array $post_data=null)
Get request wrapper.
__construct(Container $DIC, InternalDataService $data_service, InternalDomainService $domain_service)
getSubmissionGUI(\ilObjExercise $exc=null, \ilExAssignment $ass=null, $member_id=null)
getRandomAssignmentGUI(\ilObjExercise $exc=null)
Exercise assignment.
Class ilExSubmissionGUI.
UI for random assignment (ui)
Class ilObjExercise.
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: confirmReg.php:20
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
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...
static http()
Fetches the global http state from ILIAS.
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...
Definition: ByTrying.php:21
initGUIServices(\ILIAS\DI\Container $DIC)