ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilExSubmissionFileGUI Class Reference

File-based submissions. More...

+ Inheritance diagram for ilExSubmissionFileGUI:
+ Collaboration diagram for ilExSubmissionFileGUI:

Public Member Functions

 __construct (ilObjExercise $a_exercise, ilExSubmission $a_submission)
 
 executeCommand ()
 
 submissionScreenObject ()
 
 uploadFormObject (ilPropertyFormGUI $a_form=null)
 
 uploadZipFormObject (ilPropertyFormGUI $a_form=null)
 
 addUploadObject ()
 
 uploadFileObject ()
 Upload files. More...
 
 uploadZipObject ()
 Upload zip file. More...
 
 confirmDeleteDeliveredObject ()
 Confirm deletion of delivered files. More...
 
 deleteDeliveredObject ()
 Delete file(s) submitted by user. More...
 
 downloadReturnedObject (bool $a_only_new=false)
 Download submitted files of user. More...
 
 downloadNewReturnedObject ()
 Download newly submitted files of user. More...
 
 downloadObject ()
 User downloads (own) submitted files. More...
 
- Public Member Functions inherited from ilExSubmissionBaseGUI
 __construct (ilObjExercise $a_exercise, ilExSubmission $a_submission)
 
 returnToParentObject ()
 

Static Public Member Functions

static getOverviewContent (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 
- Static Public Member Functions inherited from ilExSubmissionBaseGUI
static getOverviewContent (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 

Protected Member Functions

 initUploadForm ()
 Init upload form form. More...
 
 getUploadForm ()
 
 handleUploadResult (\ILIAS\FileUpload\FileUpload $upload, \ILIAS\FileUpload\DTO\UploadResult $result)
 
 initZipUploadForm ()
 Init upload form form. More...
 
- Protected Member Functions inherited from ilExSubmissionBaseGUI
 handleTabs ()
 
 handleNewUpload (bool $a_no_notifications=false)
 
 handleRemovedUpload ()
 
 triggerAssignmentTool ()
 

Protected Attributes

ilToolbarGUI $toolbar
 
ilHelpGUI $help
 
ilObjUser $user
 
UIServices $ui
 
- Protected Attributes inherited from ilExSubmissionBaseGUI
ILIAS Exercise Notification NotificationManager $notification
 
ILIAS Exercise InternalDomainService $domain
 
ILIAS Exercise InternalGUIService $gui
 
ilCtrl $ctrl
 
ilTabsGUI $tabs_gui
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilObjExercise $exercise
 
ilExSubmission $submission
 
ilExAssignment $assignment
 
MandatoryAssignmentsManager $mandatory_manager
 
ContextServices $tool_context
 
ilExAssignmentTypesGUI $type_guis
 
int $requested_ref_id
 
GUIRequest $request
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilExSubmissionFileGUI::__construct ( ilObjExercise  $a_exercise,
ilExSubmission  $a_submission 
)

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

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\help(), ILIAS\Repository\toolbar(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

39  {
40  global $DIC;
41 
42  parent::__construct($a_exercise, $a_submission);
43 
44  $this->toolbar = $DIC->toolbar();
45  $this->help = $DIC["ilHelp"];
46  $this->user = $DIC->user();
47  $this->ui = $DIC->ui();
48  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ addUploadObject()

ilExSubmissionFileGUI::addUploadObject ( )

Definition at line 292 of file class.ilExSubmissionFileGUI.php.

References ilExSubmissionBaseGUI\$ctrl, $data, getUploadForm(), ilExSubmissionBaseGUI\handleNewUpload(), ILIAS\Repository\lng(), and ilCtrl\redirect().

292  : void
293  {
294  $form = $this->getUploadForm();
295  if ($form->isValid()) {
296  $data = (string) $form->getData("deliver");
297  if ($data !== "") {
298  $this->tpl->setOnScreenMessage('success', $this->lng->txt("file_added"), true);
299  $this->handleNewUpload();
300  } else {
301  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("msg_no_file"), true);
302  }
303  }
304  $ilCtrl = $this->ctrl;
305 
306  $ilCtrl->redirect($this, "submissionScreen");
307  }
handleNewUpload(bool $a_no_notifications=false)
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ confirmDeleteDeliveredObject()

ilExSubmissionFileGUI::confirmDeleteDeliveredObject ( )

Confirm deletion of delivered files.

Definition at line 412 of file class.ilExSubmissionFileGUI.php.

References ilExSubmissionBaseGUI\$ctrl, Vendor\Package\$f, ilExSubmissionBaseGUI\$lng, ilExSubmissionBaseGUI\$tpl, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

412  : void
413  {
414  $ilCtrl = $this->ctrl;
415  $tpl = $this->tpl;
416  $lng = $this->lng;
417 
418  $file_ids = $this->request->getSubmittedFileIds();
419  if (!$this->submission->canSubmit()) {
420  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("exercise_time_over"), true);
421  $ilCtrl->redirect($this, "submissionScreen");
422  }
423 
424  if (count($file_ids) == 0) {
425  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
426  $ilCtrl->redirect($this, "submissionScreen");
427  } else {
428  $this->tabs_gui->clearTargets();
429  $this->tabs_gui->setBackTarget(
430  $this->lng->txt("back"),
431  $this->ctrl->getLinkTarget($this, "submissionScreen")
432  );
433 
434  $cgui = new ilConfirmationGUI();
435  $cgui->setFormAction($ilCtrl->getFormAction($this));
436  $cgui->setHeaderText($lng->txt("info_delete_sure"));
437  $cgui->setCancel($lng->txt("cancel"), "submissionScreen");
438  $cgui->setConfirm($lng->txt("delete"), "deleteDelivered");
439 
440  $files = $this->submission->getFiles();
441 
442  foreach ($file_ids as $i) {
443  reset($files);
444  $title = "";
445  foreach ($files as $f) {
446  if ($f["returned_id"] == $i) {
447  $title = $f["filetitle"];
448  }
449  }
450  $cgui->addItem("delivered[]", $i, $title);
451  }
452 
453  $tpl->setContent($cgui->getHTML());
454  }
455  }
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...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ deleteDeliveredObject()

ilExSubmissionFileGUI::deleteDeliveredObject ( )

Delete file(s) submitted by user.

Definition at line 460 of file class.ilExSubmissionFileGUI.php.

References ilExSubmissionBaseGUI\$ctrl, ilExSubmissionBaseGUI\handleRemovedUpload(), and ILIAS\Repository\lng().

460  : void
461  {
462  $ilCtrl = $this->ctrl;
463 
464  $file_ids = $this->request->getSubmittedFileIds();
465 
466  if (!$this->submission->canSubmit()) {
467  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("exercise_time_over"), true);
468  } elseif (count($file_ids) == 0) {
469  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("please_select_a_delivered_file_to_delete"), true);
470  } else {
471  $this->submission->deleteSelectedFiles($file_ids);
472  $this->handleRemovedUpload();
473 
474  $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_submitted_files_deleted"), true);
475  }
476  $ilCtrl->redirect($this, "submissionScreen");
477  }
+ Here is the call graph for this function:

◆ downloadNewReturnedObject()

ilExSubmissionFileGUI::downloadNewReturnedObject ( )

Download newly submitted files of user.

Definition at line 504 of file class.ilExSubmissionFileGUI.php.

References downloadReturnedObject().

504  : void
505  {
506  $this->downloadReturnedObject(true);
507  }
downloadReturnedObject(bool $a_only_new=false)
Download submitted files of user.
+ Here is the call graph for this function:

◆ downloadObject()

ilExSubmissionFileGUI::downloadObject ( )

User downloads (own) submitted files.

Definition at line 512 of file class.ilExSubmissionFileGUI.php.

References ilExSubmissionBaseGUI\$ctrl, exit, ILIAS\Repository\lng(), and ilExSubmissionBaseGUI\returnToParentObject().

512  : void
513  {
514  $ilCtrl = $this->ctrl;
515 
516  $delivered_id = $this->request->getSubmittedFileId();
517 
518  if (!$this->submission->canView()) {
519  $this->returnToParentObject();
520  }
521 
522  if (!is_array($delivered_id) && $delivered_id > 0) {
523  $delivered_id = [$delivered_id];
524  }
525  if (is_array($delivered_id) && $delivered_id !== []) {
526  $this->submission->downloadFiles($delivered_id);
527  exit;
528  } else {
529  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("please_select_a_delivered_file_to_download"), true);
530  $ilCtrl->redirect($this, "submissionScreen");
531  }
532  }
exit
Definition: login.php:29
+ Here is the call graph for this function:

◆ downloadReturnedObject()

ilExSubmissionFileGUI::downloadReturnedObject ( bool  $a_only_new = false)

Download submitted files of user.

Definition at line 482 of file class.ilExSubmissionFileGUI.php.

References ilExSubmissionBaseGUI\$lng, ilExSubmissionBaseGUI\returnToParentObject(), and ilLanguage\txt().

Referenced by downloadNewReturnedObject().

482  : void
483  {
484  $lng = $this->lng;
485 
486  if ($this->submission->canView()) {
487  $peer_review_mask_filename = $this->submission->hasPeerReviewAccess();
488  } else {
489  // no access
490  return;
491  }
492 
493  $this->submission->downloadFiles(null, $a_only_new, $peer_review_mask_filename);
494  // we only get here, if no files have been found for download
495  if ($a_only_new) {
496  $this->tpl->setOnScreenMessage('info', $lng->txt("exc_all_new_files_offered_already"), true);
497  }
498  $this->returnToParentObject();
499  }
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilExSubmissionFileGUI::executeCommand ( )

Definition at line 50 of file class.ilExSubmissionFileGUI.php.

References ilExSubmissionBaseGUI\$ctrl, ilExSubmissionBaseGUI\$gui, ILIAS\Repository\ctrl(), getUploadForm(), and ilExSubmissionBaseGUI\returnToParentObject().

50  : void
51  {
52  $ilCtrl = $this->ctrl;
53 
54  if (!$this->submission->canView()) {
55  $this->returnToParentObject();
56  }
57 
58  $class = $ilCtrl->getNextClass($this);
59  $cmd = $ilCtrl->getCmd("submissionScreen");
60 
61  switch ($class) {
62  case strtolower(ilRepoStandardUploadHandlerGUI::class):
63  $form = $this->getUploadForm();
64  $gui = $form->getRepoStandardUploadHandlerGUI("deliver");
65  $this->ctrl->forwardCommand($gui);
66  break;
67 
68  default:
69  $this->{$cmd . "Object"}();
70  break;
71  }
72  }
ILIAS Exercise InternalGUIService $gui
+ Here is the call graph for this function:

◆ getOverviewContent()

static ilExSubmissionFileGUI::getOverviewContent ( ilInfoScreenGUI  $a_info,
ilExSubmission  $a_submission 
)
static

Definition at line 74 of file class.ilExSubmissionFileGUI.php.

References $DIC, ilExSubmissionBaseGUI\$gui, ilExSubmissionBaseGUI\$lng, ilInfoScreenGUI\addProperty(), ilExSubmission\canSubmit(), ilExSubmission\getFiles(), ilExSubmission\hasNoTeamYet(), and ilLanguage\txt().

77  : void {
78  global $DIC;
79 
80  $lng = $DIC->language();
81  $ilCtrl = $DIC->ctrl();
82  $gui = $DIC->exercise()->internal()->gui();
83 
84  $titles = array();
85  foreach ($a_submission->getFiles() as $file) {
86  $titles[] = htmlentities($file["filetitle"]);
87  }
88  $files_str = implode("<br>", $titles);
89  if ($files_str == "") {
90  $files_str = $lng->txt("message_no_delivered_files");
91  }
92 
93  // no team == no submission
94  if (!$a_submission->hasNoTeamYet()) {
95  if ($a_submission->canSubmit()) {
96  $title = (count($titles) == 0
97  ? $lng->txt("exc_hand_in")
98  : $lng->txt("exc_edit_submission"));
99 
100  $button = $gui->link(
101  $title,
102  $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionFileGUI"), "submissionScreen")
103  )->primary();
104  $files_str .= "<br><br>" . $button->render();
105  } else {
106  if (count($titles) > 0) {
107  $link = $gui->link(
108  $lng->txt("already_delivered_files"),
109  $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionFileGUI"), "submissionScreen")
110  )->emphasised();
111  $files_str .= "<br><br>" . $link->render();
112  }
113  }
114  }
115 
116  $a_info->addProperty($lng->txt("exc_files_returned"), $files_str);
117  }
getFiles(array $a_file_ids=null, bool $a_only_valid=false, string $a_min_timestamp=null, bool $print_versions=false)
Get submission items (not only files)
ILIAS Exercise InternalGUIService $gui
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...
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ getUploadForm()

ilExSubmissionFileGUI::getUploadForm ( )
protected

Definition at line 244 of file class.ilExSubmissionFileGUI.php.

References ILIAS\Repository\lng().

Referenced by addUploadObject(), executeCommand(), and uploadFormObject().

245  {
246  $max_file = $this->submission->getAssignment()->getMaxFile();
247  if ($max_file > 0) {
248  $max_file = $this->submission->getAssignment()->getMaxFile() - count($this->submission->getFiles());
249  } else {
250  $max_file = 20;
251  }
252 
253  $form_adapter = $this->gui
254  ->form(self::class, 'addUpload')
255  ->section("props", $this->lng->txt('file_add'))
256  ->file(
257  "deliver",
258  $this->lng->txt("files"),
259  \Closure::fromCallable([$this, 'handleUploadResult']),
260  "deliver",
261  "",
262  $max_file
263  );
264  return $form_adapter;
265  }
section(string $key, string $title, string $description="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleUploadResult()

ilExSubmissionFileGUI::handleUploadResult ( \ILIAS\FileUpload\FileUpload  $upload,
\ILIAS\FileUpload\DTO\UploadResult  $result 
)
protected

Definition at line 267 of file class.ilExSubmissionFileGUI.php.

271  $title = $result->getName();
272 
273  $this->submission->addFileUpload($result);
274 
275  if ($result->isOK()) {
276  return new \ILIAS\FileUpload\Handler\BasicHandlerResult(
277  'deliver',
278  \ILIAS\FileUpload\Handler\HandlerResult::STATUS_OK,
279  $title,
280  ''
281  );
282  } else {
283  return new \ILIAS\FileUpload\Handler\BasicHandlerResult(
284  'deliver',
285  \ILIAS\FileUpload\Handler\HandlerResult::STATUS_FAILED,
286  $title,
287  $result->getStatus()->getMessage()
288  );
289  }
290  }
Class ChatMainBarProvider .

◆ initUploadForm()

ilExSubmissionFileGUI::initUploadForm ( )
protected

Init upload form form.

Definition at line 222 of file class.ilExSubmissionFileGUI.php.

References ilExSubmissionBaseGUI\$ctrl, ilExSubmissionBaseGUI\$lng, ilFileWizardInputGUI\setFilenames(), and ilLanguage\txt().

Referenced by uploadFileObject(), and uploadFormObject().

223  {
224  $lng = $this->lng;
225  $ilCtrl = $this->ctrl;
226 
227  $form = new ilPropertyFormGUI();
228 
229  // file input
230  $fi = new ilFileWizardInputGUI($lng->txt("file"), "deliver");
231  $fi->setFilenames(array(0 => ''));
232  $fi->setRequired(true);
233  $form->addItem($fi);
234 
235  $form->addCommandButton("uploadFile", $lng->txt("upload"));
236  $form->addCommandButton("submissionScreen", $lng->txt("cancel"));
237 
238  $form->setTitle($lng->txt("file_add"));
239  $form->setFormAction($ilCtrl->getFormAction($this, "uploadFile"));
240 
241  return $form;
242  }
setFilenames(array $a_filenames)
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 class represents a file wizard property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initZipUploadForm()

ilExSubmissionFileGUI::initZipUploadForm ( )
protected

Init upload form form.

Definition at line 313 of file class.ilExSubmissionFileGUI.php.

References ilExSubmissionBaseGUI\$ctrl, ilExSubmissionBaseGUI\$lng, ilFileInputGUI\setSuffixes(), and ilLanguage\txt().

Referenced by uploadZipFormObject(), and uploadZipObject().

314  {
315  $lng = $this->lng;
316  $ilCtrl = $this->ctrl;
317 
318  $form = new ilPropertyFormGUI();
319 
320  $fi = new ilFileInputGUI($lng->txt("file"), "deliver");
321  $fi->setSuffixes(array("zip"));
322  $fi->setRequired(true);
323  $form->addItem($fi);
324 
325  $form->addCommandButton("uploadZip", $lng->txt("upload"));
326  $form->addCommandButton("submissionScreen", $lng->txt("cancel"));
327 
328  $form->setTitle($lng->txt("header_zip"));
329  $form->setFormAction($ilCtrl->getFormAction($this, "uploadZip"));
330 
331  return $form;
332  }
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 class represents a file property in a property form.
setSuffixes(array $a_suffixes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ submissionScreenObject()

ilExSubmissionFileGUI::submissionScreenObject ( )

Definition at line 120 of file class.ilExSubmissionFileGUI.php.

References Vendor\Package\$b, $help, $toolbar, $user, ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), ilExSubmissionBaseGUI\handleTabs(), IL_CAL_UNIX, ILIAS\Repository\lng(), ilExSubmissionBaseGUI\triggerAssignmentTool(), and ILIAS\Repository\ui().

120  : void
121  {
122  $ilToolbar = $this->toolbar;
123  $ilHelp = $this->help;
124  $ilUser = $this->user;
125 
126  $this->triggerAssignmentTool();
127 
128  $this->handleTabs();
129 
130  $ilHelp->setScreenIdComponent("exc");
131  $ilHelp->setScreenId("submissions");
132 
133  if (!$this->submission->canSubmit()) {
134  $this->tpl->setOnScreenMessage('info', $this->lng->txt("exercise_time_over"));
135  } else {
136  $max_files = $this->submission->getAssignment()->getMaxFile();
137 
138  if ($this->submission->canAddFile()) {
139  // #15883 - extended deadline warning
140  $deadline = $this->assignment->getPersonalDeadline($ilUser->getId());
141  if ($deadline &&
142  time() > $deadline) {
144  $dl = sprintf($this->lng->txt("exc_late_submission_warning"), $dl);
145  $dl = '<span class="warning">' . $dl . '</span>';
146  $ilToolbar->addText($dl);
147  }
148 
149  $b = $this->ui->factory()->button()->standard(
150  $this->lng->txt("file_add"),
151  $this->ctrl->getLinkTarget($this, "uploadForm")
152  );
153  $ilToolbar->addStickyItem($b);
154 
155  if (!$max_files ||
156  $max_files > 1) {
157  $ilToolbar->addButton(
158  $this->lng->txt("header_zip"),
159  $this->ctrl->getLinkTarget($this, "uploadZipForm")
160  );
161  }
162  }
163 
164  if ($max_files) {
165  $this->tpl->setOnScreenMessage('info', sprintf($this->lng->txt("exc_max_file_reached"), $max_files));
166  }
167  }
168 
169  $tab = new ilExcDeliveredFilesTableGUI($this, "submissionScreen", $this->submission);
170  $this->tpl->setContent($tab->getHTML());
171  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
const IL_CAL_UNIX
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ uploadFileObject()

ilExSubmissionFileGUI::uploadFileObject ( )

Upload files.

Definition at line 337 of file class.ilExSubmissionFileGUI.php.

References ilExSubmissionBaseGUI\$ctrl, ilExSubmissionBaseGUI\handleNewUpload(), initUploadForm(), ILIAS\Repository\lng(), and uploadFormObject().

337  : void
338  {
339  $ilCtrl = $this->ctrl;
340 
341  // #15322
342  if (!$this->submission->canSubmit()) {
343  $this->tpl->setOnScreenMessage('info', $this->lng->txt("exercise_time_over"), true);
344  } else {
345  $form = $this->initUploadForm();
346  if (!$form->checkInput()) {
347  $this->uploadFormObject($form);
348  return;
349  }
350 
351  $success = false;
352  foreach ($_FILES["deliver"]["name"] as $k => $v) {
353  $file = array(
354  "name" => $_FILES["deliver"]["name"][$k],
355  "type" => $_FILES["deliver"]["type"][$k],
356  "tmp_name" => $_FILES["deliver"]["tmp_name"][$k],
357  "error" => $_FILES["deliver"]["error"][$k],
358  "size" => $_FILES["deliver"]["size"][$k],
359  );
360  if (!$this->submission->uploadFile($file)) {
361  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("exc_upload_error") . " [Single File]", true);
362  } else {
363  $success = true;
364  }
365  }
366 
367  if ($success) {
368  $this->tpl->setOnScreenMessage('success', $this->lng->txt("file_added"), true);
369  $this->handleNewUpload();
370  }
371  }
372 
373  $ilCtrl->redirect($this, "submissionScreen");
374  }
handleNewUpload(bool $a_no_notifications=false)
uploadFormObject(ilPropertyFormGUI $a_form=null)
initUploadForm()
Init upload form form.
+ Here is the call graph for this function:

◆ uploadFormObject()

ilExSubmissionFileGUI::uploadFormObject ( ilPropertyFormGUI  $a_form = null)

Definition at line 174 of file class.ilExSubmissionFileGUI.php.

References $help, ILIAS\Repository\ctrl(), getUploadForm(), initUploadForm(), ILIAS\Repository\lng(), and ilHelpGUI\setScreenIdComponent().

Referenced by uploadFileObject().

176  : void {
177  if (!$this->submission->canSubmit()) {
178  $this->ctrl->redirect($this, "submissionScreen");
179  }
180 
181  $this->tabs_gui->clearTargets();
182  $this->tabs_gui->setBackTarget(
183  $this->lng->txt("back"),
184  $this->ctrl->getLinkTarget($this, "submissionScreen")
185  );
186 
187  $ilHelp = $this->help;
188  $ilHelp->setScreenIdComponent("exc");
189  $ilHelp->setScreenId("upload_submission");
190 
191  if (!$a_form) {
192  $a_form = $this->initUploadForm();
193  $a_form = $this->getUploadForm();
194  $this->tpl->setContent($a_form->render());
195  return;
196  }
197  $this->tpl->setContent($a_form->getHTML());
198  }
setScreenIdComponent(string $a_comp)
initUploadForm()
Init upload form form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadZipFormObject()

ilExSubmissionFileGUI::uploadZipFormObject ( ilPropertyFormGUI  $a_form = null)

Definition at line 200 of file class.ilExSubmissionFileGUI.php.

References ILIAS\Repository\ctrl(), initZipUploadForm(), and ILIAS\Repository\lng().

Referenced by uploadZipObject().

202  : void {
203  if (!$this->submission->canSubmit()) {
204  $this->ctrl->redirect($this, "submissionScreen");
205  }
206 
207  $this->tabs_gui->clearTargets();
208  $this->tabs_gui->setBackTarget(
209  $this->lng->txt("back"),
210  $this->ctrl->getLinkTarget($this, "submissionScreen")
211  );
212 
213  if (!$a_form) {
214  $a_form = $this->initZipUploadForm();
215  }
216  $this->tpl->setContent($a_form->getHTML());
217  }
initZipUploadForm()
Init upload form form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uploadZipObject()

ilExSubmissionFileGUI::uploadZipObject ( )

Upload zip file.

Definition at line 379 of file class.ilExSubmissionFileGUI.php.

References ilExSubmissionBaseGUI\$ctrl, Vendor\Package\$e, ilExSubmissionBaseGUI\handleNewUpload(), initZipUploadForm(), ILIAS\Repository\lng(), and uploadZipFormObject().

379  : void
380  {
381  $ilCtrl = $this->ctrl;
382 
383  // #15322
384  if (!$this->submission->canSubmit()) {
385  $this->tpl->setOnScreenMessage('info', $this->lng->txt("exercise_time_over"), true);
386  } else {
387  $form = $this->initZipUploadForm();
388  if (!$form->checkInput()) {
389  $this->uploadZipFormObject($form);
390  return;
391  }
392 
393  if (preg_match("/zip/", $_FILES["deliver"]["type"]) == 1) {
394  try {
395  if ($this->submission->processUploadedZipFile($_FILES["deliver"]["tmp_name"])) {
396  $this->tpl->setOnScreenMessage('success', $this->lng->txt("file_added"), true);
397  $this->handleNewUpload();
398  }
399  } catch (ilException $e) {
400  $this->tpl->setOnScreenMessage('failure', $e->getMessage(), true);
401  $ilCtrl->redirect($this, "submissionScreen");
402  }
403  }
404  }
405 
406  $ilCtrl->redirect($this, "submissionScreen");
407  }
handleNewUpload(bool $a_no_notifications=false)
uploadZipFormObject(ilPropertyFormGUI $a_form=null)
initZipUploadForm()
Init upload form form.
+ Here is the call graph for this function:

Field Documentation

◆ $help

ilHelpGUI ilExSubmissionFileGUI::$help
protected

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

Referenced by submissionScreenObject(), and uploadFormObject().

◆ $toolbar

ilToolbarGUI ilExSubmissionFileGUI::$toolbar
protected

Definition at line 31 of file class.ilExSubmissionFileGUI.php.

Referenced by submissionScreenObject().

◆ $ui

UIServices ilExSubmissionFileGUI::$ui
protected

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

◆ $user

ilObjUser ilExSubmissionFileGUI::$user
protected

Definition at line 33 of file class.ilExSubmissionFileGUI.php.

Referenced by submissionScreenObject().


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