ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilExSubmissionBaseGUI.php
Go to the documentation of this file.
1<?php
2
22
32{
33 protected \ILIAS\Exercise\Notification\NotificationManager $notification;
34 protected \ILIAS\Exercise\InternalDomainService $domain;
35 protected \ILIAS\Exercise\InternalGUIService $gui;
36 protected ilObjUser $user;
37 protected ilCtrl $ctrl;
39 protected ilLanguage $lng;
47 protected int $requested_ref_id;
49
53 public function __construct(
54 ilObjExercise $a_exercise,
55 ilExSubmission $a_submission
56 ) {
57 global $DIC;
58
59 $service = $DIC->exercise()->internal();
60 $this->gui = $service->gui();
61 $this->domain = $service->domain();
62
63 $this->user = $this->domain->user();
64 $this->ctrl = $this->gui->ctrl();
65 $this->tabs_gui = $this->gui->tabs();
66 $this->lng = $this->domain->lng();
67 $this->tpl = $this->gui->ui()->mainTemplate();
68
69 $this->exercise = $a_exercise;
70 $this->submission = $a_submission;
71 $this->assignment = $a_submission->getAssignment();
72
73 $this->mandatory_manager = $this->domain
74 ->assignment()
75 ->mandatoryAssignments($this->exercise);
76
77 $this->request = $this->gui->request();
78 $this->requested_ref_id = $this->request->getRefId();
79 $this->notification = $this->domain->notification($this->requested_ref_id);
80
81 $this->type_guis = $this->gui->assignment()->types();
82 $this->tool_context = $DIC->globalScreen()->tool()->context();
83 $this->gui = $DIC->exercise()
84 ->internal()
85 ->gui();
86 }
87
88 abstract public static function getOverviewContent(
89 ilInfoScreenGUI $a_info,
90 ilExSubmission $a_submission
91 ): void;
92
93 protected function handleTabs(): void
94 {
95 return;
96 $this->tabs_gui->clearTargets();
97 $this->tabs_gui->setBackTarget(
98 $this->lng->txt("back"),
99 $this->ctrl->getLinkTarget($this, "returnToParent")
100 );
101
102 $this->tabs_gui->addTab(
103 "submission",
104 $this->lng->txt("exc_submission"),
105 $this->ctrl->getLinkTarget($this, "")
106 );
107 $this->tabs_gui->activateTab("submission");
108
109 if ($this->assignment->hasTeam()) {
111 }
112 }
113
114 public function returnToParentObject(): void
115 {
116 if ($this->request->getFromOverview()) {
117 $this->ctrl->redirectByClass(ilObjExerciseGUI::class, "showOverview");
118 }
119 $this->ctrl->returnToParent($this);
120 }
121
122
123 //
124 // RETURNED/EXERCISE STATUS
125 //
126
127 protected function handleNewUpload(
128 bool $a_no_notifications = false
129 ): void {
130 $has_submitted = $this->submission->hasSubmitted();
131
132 $this->exercise->processExerciseStatus(
133 $this->assignment,
134 $this->submission->getUserIds(),
135 $has_submitted,
136 $this->submission->validatePeerReviews()
137 );
138
139 if ($has_submitted &&
140 !$a_no_notifications) {
141 $this->notification->sendUploadNotification($this->assignment->getId());
142 }
143 }
144
145 protected function handleRemovedUpload(): void
146 {
147 // #16532 - always send notifications
148 $this->handleNewUpload();
149 }
150
151 protected function triggerAssignmentTool(): void
152 {
153 $ass_ids = [$this->assignment->getId()];
154 $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::SHOW_EXC_ASSIGNMENT_INFO, true);
155 $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_IDS, $ass_ids);
156 }
157}
Exercise gui request wrapper.
Class ilCtrl provides processing control methods.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Exercise assignment.
Exercise submission base gui.
MandatoryAssignmentsManager $mandatory_manager
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
ilGlobalTemplateInterface $tpl
ILIAS Exercise InternalGUIService $gui
ilExAssignmentTypesGUI $type_guis
ILIAS Exercise InternalDomainService $domain
handleNewUpload(bool $a_no_notifications=false)
__construct(ilObjExercise $a_exercise, ilExSubmission $a_submission)
ILIAS Exercise Notification NotificationManager $notification
Exercise submission //TODO: This class has many static methods related to delivered "files".
Class ilInfoScreenGUI.
language handling
Class ilObjExercise.
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$service
Definition: ltiresult.php:36
global $DIC
Definition: shib_login.php:26