ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.InternalGUIService.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Exercise;
22
32
39{
40 use GlobalDICGUIServices;
41
42 protected \ILIAS\Exercise\InternalDataService $data_service;
43 protected \ILIAS\Exercise\InternalDomainService $domain_service;
44 protected \ilLanguage $lng;
45 protected Refinery\Factory $refinery;
46
48
49 protected ?GUIRequest $request = null;
50 protected \ilExSubmissionGUI $submission_gui;
51 protected \ilObjExercise $exc;
52
53 public function __construct(
57 ) {
58 $this->data_service = $data_service;
59 $this->domain_service = $domain_service;
60 $this->initGUIServices($DIC);
61 }
62
63 public function assignment(): Assignment\GUIService
64 {
65 return new Assignment\GUIService(
66 $this->domain_service,
67 $this
68 );
69 }
70
71 public function peerReview(): PeerReview\GUIService
72 {
73 return new PeerReview\GUIService(
74 $this->domain_service,
75 $this
76 );
77 }
78
80 {
81 return new PermanentLinkManager(
82 $this->domain_service,
83 $this
84 );
85 }
86
87
93 public function request(
94 ?array $query_params = null,
95 ?array $post_data = null
96 ): GUIRequest {
97 if (is_null($query_params) && is_null($post_data) && !is_null($this->request)) {
98 return $this->request;
99 }
100 $request = new GUIRequest(
101 $this->http(),
102 $this->domain_service->refinery(),
103 $query_params,
104 $post_data
105 );
106 if (is_null($query_params) && is_null($post_data)) {
107 $this->request = $request;
108 }
109 return $request;
110 }
111
115 public function getExerciseGUI(?int $ref_id = null): \ilObjExerciseGUI
116 {
117 if ($ref_id === null) {
118 $ref_id = $this->request()->getRefId();
119 }
120 return new \ilObjExerciseGUI([], $ref_id, true);
121 }
122
124 {
125 if ($exc === null) {
126 $exc = $this->request()->getExercise();
127 }
128 return new \ilExcRandomAssignmentGUI(
129 $this->ui(),
130 $this->toolbar(),
131 $this->domain_service->lng(),
132 $this->ctrl(),
133 $this->domain_service->assignment()->randomAssignments($exc)
134 );
135 }
136
137 public function getSubmissionGUI(
138 ?\ilObjExercise $exc = null,
139 ?\ilExAssignment $ass = null,
140 $member_id = null
142 if ($exc === null) {
143 $exc = $this->request()->getExercise();
144 }
145 if ($ass === null) {
146 $ass = $this->request()->getAssignment();
147 }
148 if ($member_id === null) {
149 $member_id = $this->request()->getMemberId();
150 }
151 return new \ilExSubmissionGUI(
152 $exc,
153 $ass,
154 $member_id
155 );
156 }
157
158 public function getTeamSubmissionGUI(
159 \ilObjExercise $exc,
160 \ilExSubmission $submission
162 return new \ilExSubmissionTeamGUI($exc, $submission);
163 }
164
170 $this->domain_service,
171 $this,
172 $exercise,
173 $notification
174 );
175 }
176
177 public function settings(
178 ): GUIService {
179 return new GUIService(
180 $this->data_service,
181 $this->domain_service,
182 $this
183 );
184 }
185
186}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
Exercise gui request wrapper.
Internal factory for data objects.
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)
getSubmissionFeedbackGUI(?\ilObjExercise $exercise, \ILIAS\Exercise\Notification\NotificationManager $notification)
getRandomAssignmentGUI(?\ilObjExercise $exc=null)
ILIAS Exercise InternalDataService $data_service
getTeamSubmissionGUI(\ilObjExercise $exc, \ilExSubmission $submission)
ILIAS Exercise InternalDomainService $domain_service
getSubmissionGUI(?\ilObjExercise $exc=null, ?\ilExAssignment $ass=null, $member_id=null)
Exercise assignment.
Class ilExSubmissionGUI.
Exercise submission //TODO: This class has many static methods related to delivered "files".
UI for random assignment (ui)
Class ilObjExercise.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:66
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.
initGUIServices(\ILIAS\DI\Container $DIC)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
if(!file_exists('../ilias.ini.php'))
global $DIC
Definition: shib_login.php:26