ILIAS  release_8 Revision v8.24
ilExSubmissionGUI Class Reference

Class ilExSubmissionGUI. More...

+ Collaboration diagram for ilExSubmissionGUI:

Public Member Functions

 executeCommand ()
 
 getHTML (array $par)
 
 listPublicSubmissionsObject ()
 
 downloadFeedbackFileObject ()
 Download feedback file. More...
 
 downloadGlobalFeedbackFileObject ()
 
 downloadFileObject ()
 
 returnToParentObject ()
 

Data Fields

const MODE_OVERVIEW_CONTENT = 1
 

Protected Attributes

ilCtrl $ctrl
 
ilTabsGUI $tabs_gui
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilObjUser $user
 
ilObjExercise $exercise
 
ilExSubmission $submission
 
ilExAssignment $assignment
 
ilExAssignmentTypesGUI $type_guis
 
int $user_id
 
GUIRequest $request
 

Detailed Description

Member Function Documentation

◆ downloadFeedbackFileObject()

ilExSubmissionGUI::downloadFeedbackFileObject ( )

Download feedback file.

Definition at line 249 of file class.ilExSubmissionGUI.php.

249 : bool
250 {
251 $file = $this->request->getFile();
252
253 if (!isset($file)) {
254 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("exc_select_one_file"), true);
255 $this->ctrl->redirect($this, "view");
256 }
257
258 // check, whether file belongs to assignment
259 $storage = new ilFSStorageExercise($this->exercise->getId(), $this->assignment->getId());
260 $files = $storage->getFeedbackFiles($this->submission->getFeedbackId());
261 $file_exist = false;
262 foreach ($files as $fb_file) {
263 if ($fb_file == $file) {
264 $file_exist = true;
265 break;
266 }
267 }
268
269 if (!$file_exist) {
270 return false;
271 }
272
273 // check whether assignment has already started
274 if (!$this->assignment->notStartedYet()) {
275 // deliver file
276 $p = $storage->getFeedbackFilePath($this->submission->getFeedbackId(), $file);
278 }
279
280 return true;
281 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)

References ILIAS\Repository\ctrl(), ilFileDelivery\deliverFileLegacy(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ downloadFileObject()

ilExSubmissionGUI::downloadFileObject ( )

Definition at line 303 of file class.ilExSubmissionGUI.php.

303 : bool
304 {
305 $file = $this->request->getFile();
306
307 if (!isset($file)) {
308 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("exc_select_one_file"), true);
309 $this->ctrl->redirect($this, "view");
310 }
311
312 // check whether assignment as already started
313 $state = ilExcAssMemberState::getInstanceByIds($this->assignment->getId(), $this->user_id);
314 if ($state->areInstructionsVisible()) {
315 // check, whether file belongs to assignment
316 $files = $this->assignment->getFiles();
317 $file_exist = false;
318 foreach ($files as $lfile) {
319 if ($lfile["name"] == $file) {
320 // deliver file
321 ilFileDelivery::deliverFileLegacy($lfile["fullpath"], $file);
322 exit();
323 }
324 }
325 if (!$file_exist) {
326 return false;
327 }
328 }
329
330 return true;
331 }
static getInstanceByIds(int $a_ass_id, int $a_user_id=0)
exit
Definition: login.php:28

References ILIAS\Repository\ctrl(), ilFileDelivery\deliverFileLegacy(), exit, ilExcAssMemberState\getInstanceByIds(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ downloadGlobalFeedbackFileObject()

ilExSubmissionGUI::downloadGlobalFeedbackFileObject ( )

Definition at line 283 of file class.ilExSubmissionGUI.php.

283 : void
284 {
285 $ilCtrl = $this->ctrl;
286
287 $state = ilExcAssMemberState::getInstanceByIds($this->assignment->getId(), $this->user_id);
288
289 // fix bug 28466, this code should be streamlined with the if above and
290 // the presentation of the download link in the ilExAssignmentGUI->addSubmission
291 if (!$state->isGlobalFeedbackFileAccessible($this->submission)) {
292 $ilCtrl->redirect($this, "returnToParent");
293 }
294
295 // this is due to temporary bug in handleGlobalFeedbackFileUpload that missed the last "/"
296 $file = (is_file($this->assignment->getGlobalFeedbackFilePath()))
297 ? $this->assignment->getGlobalFeedbackFilePath()
298 : $this->assignment->getGlobalFeedbackFileStoragePath() . $this->assignment->getFeedbackFile();
299
300 ilFileDelivery::deliverFileLegacy($file, $this->assignment->getFeedbackFile());
301 }

References ilFileDelivery\deliverFileLegacy(), and ilExcAssMemberState\getInstanceByIds().

+ Here is the call graph for this function:

◆ executeCommand()

ilExSubmissionGUI::executeCommand ( )
Exceptions
ilCtrlException

Definition at line 95 of file class.ilExSubmissionGUI.php.

95 : void
96 {
97 $ilCtrl = $this->ctrl;
98
99 $class = $ilCtrl->getNextClass($this);
100 $cmd = $ilCtrl->getCmd("listPublicSubmissions");
101
102 switch ($class) {
103 case "ilexsubmissionteamgui":
104 // team gui has no base gui - see we have to handle tabs here
105
106 $this->tabs_gui->clearTargets();
107 $this->tabs_gui->setBackTarget(
108 $this->lng->txt("back"),
109 $this->ctrl->getLinkTarget($this, "returnToParent")
110 );
111
112 // forward to type gui
113 if ($this->submission->getSubmissionType() != ilExSubmission::TYPE_REPO_OBJECT) {
114 $this->tabs_gui->addTab(
115 "submission",
116 $this->lng->txt("exc_submission"),
117 $this->ctrl->getLinkTargetByClass("ilexsubmission" . $this->submission->getSubmissionType() . "gui", "")
118 );
119 }
120
121 $gui = new ilExSubmissionTeamGUI($this->exercise, $this->submission);
122 $ilCtrl->forwardCommand($gui);
123 break;
124
125 case "ilexsubmissiontextgui":
126 $gui = new ilExSubmissionTextGUI($this->exercise, $this->submission);
127 $ilCtrl->forwardCommand($gui);
128 break;
129
130 case "ilexsubmissionfilegui":
131 $gui = new ilExSubmissionFileGUI($this->exercise, $this->submission);
132 $ilCtrl->forwardCommand($gui);
133 break;
134
135 case "ilexsubmissionobjectgui":
136 $gui = new ilExSubmissionObjectGUI($this->exercise, $this->submission);
137 $ilCtrl->forwardCommand($gui);
138 break;
139
140 case "ilexpeerreviewgui":
141 $this->tabs_gui->clearTargets();
142 $this->tabs_gui->setBackTarget(
143 $this->lng->txt("back"),
144 $this->ctrl->getLinkTarget($this, "returnToParent")
145 );
146
147 $peer_gui = new ilExPeerReviewGUI($this->assignment, $this->submission);
148 $this->ctrl->forwardCommand($peer_gui);
149 break;
150
151 default:
152
153
154 // forward to type gui
155 if ($this->type_guis->isExAssTypeGUIClass($class)) {
156 $type_gui = $this->type_guis->getByClassName($class);
157 $type_gui->setSubmission($this->submission);
158 $type_gui->setExercise($this->exercise);
159 $ilCtrl->forwardCommand($type_gui);
160 }
161
162 $this->{$cmd . "Object"}();
163 break;
164 }
165 }
getNextClass($a_gui_class=null)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Object-based submissions (ends up as static file)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $ctrl, ILIAS\Repository\ctrl(), ilCtrl\getNextClass(), ILIAS\Repository\lng(), and ilExSubmission\TYPE_REPO_OBJECT.

+ Here is the call graph for this function:

◆ getHTML()

ilExSubmissionGUI::getHTML ( array  $par)
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 208 of file class.ilExSubmissionGUI.php.

208 : string
209 {
210 switch ($par["mode"]) {
211 // get overview content from ass type gui
213 $type_gui = $this->type_guis->getById($par["submission"]->getAssignment()->getType());
214 $type_gui->getOverviewContent($par["info"], $par["submission"]);
215 break;
216 }
217 return "";
218 }

◆ listPublicSubmissionsObject()

ilExSubmissionGUI::listPublicSubmissionsObject ( )

Definition at line 220 of file class.ilExSubmissionGUI.php.

220 : void
221 {
222 $ilTabs = $this->tabs_gui;
223 $ilCtrl = $this->ctrl;
225
226 if (!$this->exercise->getShowSubmissions()) {
227 $this->returnToParentObject();
228 }
229
230 $ilTabs->clearTargets();
231 $ilTabs->setBackTarget(
232 $lng->txt("back"),
233 $ilCtrl->getLinkTarget($this, "returnToParent")
234 );
235
236 if ($this->assignment->getType() != ilExAssignment::TYPE_TEXT) {
237 $tab = new ilPublicSubmissionsTableGUI($this, "listPublicSubmissions", $this->assignment);
238 $this->tpl->setContent($tab->getHTML());
239 } else {
240 // #13271
241 $tbl = new ilExAssignmentListTextTableGUI($this, "listPublicSubmissions", $this->assignment, false, true);
242 $this->tpl->setContent($tbl->getHTML());
243 }
244 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $lng, and ilExAssignment\TYPE_TEXT.

◆ returnToParentObject()

ilExSubmissionGUI::returnToParentObject ( )

Definition at line 333 of file class.ilExSubmissionGUI.php.

333 : void
334 {
335 $this->ctrl->returnToParent($this);
336 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

Field Documentation

◆ $assignment

ilExAssignment ilExSubmissionGUI::$assignment
protected

Definition at line 41 of file class.ilExSubmissionGUI.php.

◆ $ctrl

ilCtrl ilExSubmissionGUI::$ctrl
protected

Definition at line 34 of file class.ilExSubmissionGUI.php.

Referenced by executeCommand().

◆ $exercise

ilObjExercise ilExSubmissionGUI::$exercise
protected

Definition at line 39 of file class.ilExSubmissionGUI.php.

◆ $lng

ilLanguage ilExSubmissionGUI::$lng
protected

Definition at line 36 of file class.ilExSubmissionGUI.php.

◆ $request

GUIRequest ilExSubmissionGUI::$request
protected

Definition at line 44 of file class.ilExSubmissionGUI.php.

◆ $submission

ilExSubmission ilExSubmissionGUI::$submission
protected

Definition at line 40 of file class.ilExSubmissionGUI.php.

◆ $tabs_gui

ilTabsGUI ilExSubmissionGUI::$tabs_gui
protected

Definition at line 35 of file class.ilExSubmissionGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilExSubmissionGUI::$tpl
protected

Definition at line 37 of file class.ilExSubmissionGUI.php.

◆ $type_guis

ilExAssignmentTypesGUI ilExSubmissionGUI::$type_guis
protected

Definition at line 42 of file class.ilExSubmissionGUI.php.

◆ $user

ilObjUser ilExSubmissionGUI::$user
protected

Definition at line 38 of file class.ilExSubmissionGUI.php.

◆ $user_id

int ilExSubmissionGUI::$user_id
protected

Definition at line 43 of file class.ilExSubmissionGUI.php.

◆ MODE_OVERVIEW_CONTENT

const ilExSubmissionGUI::MODE_OVERVIEW_CONTENT = 1

Definition at line 32 of file class.ilExSubmissionGUI.php.


The documentation for this class was generated from the following file: