ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.InternalGUIService.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Exercise;
22 
23 use ILIAS\Refinery;
32 
39 {
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(
55  InternalDataService $data_service,
56  InternalDomainService $domain_service
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
141  ): \ilExSubmissionGUI {
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 
165  public function getSubmissionFeedbackGUI(
169  return new \ilExerciseSubmissionFeedbackGUI(
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 }
Exercise UI frontend presentation service class.
ILIAS Exercise InternalDomainService $domain_service
Exercise assignment.
initGUIServices(\ILIAS\DI\Container $DIC)
Interface Observer Contains several chained tasks and infos about them.
getSubmissionGUI(?\ilObjExercise $exc=null, ?\ilExAssignment $ass=null, $member_id=null)
Exercise internal service.
request(?array $query_params=null, ?array $post_data=null)
Get request wrapper.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $DIC, InternalDataService $data_service, InternalDomainService $domain_service)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilObjExercise.
$ref_id
Definition: ltiauth.php:65
static http()
Fetches the global http state from ILIAS.
ILIAS Exercise InternalDataService $data_service
UI for random assignment (ui)
global $DIC
Definition: shib_login.php:22
getTeamSubmissionGUI(\ilObjExercise $exc, \ilExSubmission $submission)
getRandomAssignmentGUI(?\ilObjExercise $exc=null)
Internal factory for data objects.
getSubmissionFeedbackGUI(?\ilObjExercise $exercise, \ILIAS\Exercise\Notification\NotificationManager $notification)
Exercise submission //TODO: This class has many static methods related to delivered "files"...
Exercise gui request wrapper.
Class ilExSubmissionGUI.