18 if(!$this->submission->canView())
23 $class = $ilCtrl->getNextClass($this);
24 $cmd = $ilCtrl->getCmd(
"submissionScreen");
29 $this->{
$cmd.
"Object"}();
41 $titles[] =
$file[
"filetitle"];
43 $files_str = implode($titles,
", ");
46 $files_str = $lng->txt(
"message_no_delivered_files");
54 $title = (count($titles) == 0
55 ? $lng->txt(
"exc_hand_in")
56 : $lng->txt(
"exc_edit_submission"));
59 $button->setPrimary(
true);
60 $button->setCaption(
$title,
false);
61 $button->setUrl($ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionFileGUI"),
"submissionScreen"));
62 $files_str.=
" ".$button->render();
66 if (count($titles) > 0)
69 $button->setCaption(
"already_delivered_files");
70 $button->setUrl($ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionFileGUI"),
"submissionScreen"));
71 $files_str.=
" ".$button->render();
76 $a_info->
addProperty($lng->txt(
"exc_files_returned"), $files_str);
86 global $ilToolbar, $ilHelp,
$ilUser;
91 $ilHelp->setScreenIdComponent(
"exc");
92 $ilHelp->setScreenId(
"submissions");
94 if (!$this->submission->canSubmit())
100 $max_files = $this->submission->getAssignment()->getMaxFile();
102 if($this->submission->canAddFile())
105 $deadline = $this->assignment->getPersonalDeadline($ilUser->getId());
110 $dl = sprintf($this->lng->txt(
"exc_late_submission_warning"), $dl);
111 $dl =
'<span class="warning">'.$dl.
'</span>';
112 $ilToolbar->addText($dl);
115 $ilToolbar->addButton($this->lng->txt(
"file_add"),
116 $this->ctrl->getLinkTarget($this,
"uploadForm"));
121 $ilToolbar->addButton($this->lng->txt(
"header_zip"),
122 $this->ctrl->getLinkTarget($this,
"uploadZipForm"));
128 ilUtil::sendInfo(sprintf($this->lng->txt(
"exc_max_file_reached"), $max_files));
132 include_once(
"./Modules/Exercise/classes/class.ilExcDeliveredFilesTableGUI.php");
134 $this->tpl->setContent(
$tab->getHTML());
142 if (!$this->submission->canSubmit())
144 $this->ctrl->redirect($this,
"submissionScreen");
147 $this->tabs_gui->clearTargets();
148 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
149 $this->ctrl->getLinkTarget($this,
"submissionScreen"));
152 $ilHelp->setScreenIdComponent(
"exc");
153 $ilHelp->setScreenId(
"upload_submission");
159 $this->tpl->setContent($a_form->getHTML());
167 if (!$this->submission->canSubmit())
169 $this->ctrl->redirect($this,
"submissionScreen");
172 $this->tabs_gui->clearTargets();
173 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
174 $this->ctrl->getLinkTarget($this,
"submissionScreen"));
180 $this->tpl->setContent($a_form->getHTML());
190 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
194 include_once(
"./Services/Form/classes/class.ilFileWizardInputGUI.php");
197 $fi->setRequired(
true);
200 $form->addCommandButton(
"uploadFile", $lng->txt(
"upload"));
201 $form->addCommandButton(
"submissionScreen", $lng->txt(
"cancel"));
203 $form->setTitle($lng->txt(
"file_add"));
204 $form->setFormAction($ilCtrl->getFormAction($this,
"uploadFile"));
216 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
219 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
222 $fi->setRequired(
true);
225 $form->addCommandButton(
"uploadZip", $lng->txt(
"upload"));
226 $form->addCommandButton(
"submissionScreen", $lng->txt(
"cancel"));
228 $form->setTitle($lng->txt(
"header_zip"));
229 $form->setFormAction($ilCtrl->getFormAction($this,
"uploadZip"));
242 if (!$this->submission->canSubmit())
249 if(!$form->checkInput())
255 foreach ($_FILES[
"deliver"][
"name"] as $k => $v)
258 "name" => $_FILES[
"deliver"][
"name"][$k],
259 "type" => $_FILES[
"deliver"][
"type"][$k],
260 "tmp_name" => $_FILES[
"deliver"][
"tmp_name"][$k],
261 "error" => $_FILES[
"deliver"][
"error"][$k],
262 "size" => $_FILES[
"deliver"][
"size"][$k],
264 if(!$this->submission->uploadFile(
$file))
281 $ilCtrl->redirect($this,
"submissionScreen");
292 if (!$this->submission->canSubmit())
299 if(!$form->checkInput())
304 if (preg_match(
"/zip/",$_FILES[
"deliver"][
"type"]) == 1)
306 if($this->submission->processUploadedZipFile($_FILES[
"deliver"][
"tmp_name"]))
314 $ilCtrl->redirect($this,
"submissionScreen");
324 if (!$this->submission->canSubmit())
327 $ilCtrl->redirect($this,
"submissionScreen");
330 if (!is_array(
$_POST[
"delivered"]) || count(
$_POST[
"delivered"]) == 0)
333 $ilCtrl->redirect($this,
"submissionScreen");
337 $this->tabs_gui->clearTargets();
338 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
339 $this->ctrl->getLinkTarget($this,
"submissionScreen"));
341 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
343 $cgui->setFormAction($ilCtrl->getFormAction($this));
344 $cgui->setHeaderText($lng->txt(
"info_delete_sure"));
345 $cgui->setCancel($lng->txt(
"cancel"),
"submissionScreen");
346 $cgui->setConfirm($lng->txt(
"delete"),
"deleteDelivered");
348 $files = $this->submission->getFiles();
350 foreach (
$_POST[
"delivered"] as $i)
356 if ($f[
"returned_id"] == $i)
361 $cgui->addItem(
"delivered[]", $i,
$title);
364 $tpl->setContent($cgui->getHTML());
378 if (!$this->submission->canSubmit())
382 else if (!count(
$_POST[
"delivered"]))
388 $this->submission->deleteSelectedFiles(
$_POST[
"delivered"]);
393 $ilCtrl->redirect($this,
"submissionScreen");
401 $peer_review_mask_filename =
false;
403 if($this->submission->canView())
405 $peer_review_mask_filename = $this->submission->hasPeerReviewAccess();
413 $this->submission->downloadFiles(null, $a_only_new, $peer_review_mask_filename);
435 if(!$this->submission->canView())
440 if (count($_REQUEST[
"delivered"]))
442 if(!is_array($_REQUEST[
"delivered"]))
444 $_REQUEST[
"delivered"] =
array($_REQUEST[
"delivered"]);
446 $this->submission->downloadFiles($_REQUEST[
"delivered"]);
452 $ilCtrl->redirect($this,
"submissionScreen");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
submissionScreenObject()
Displays a form which allows members to deliver their solutions.
downloadReturnedObject($a_only_new=false)
Download submitted files of user.
uploadZipObject()
Upload zip file.
downloadNewReturnedObject()
Download newly submitted files of user.
Exercise submission base gui.
uploadFormObject(ilPropertyFormGUI $a_form=null)
Display form for single file upload.
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
downloadObject()
User downloads (own) submitted files.
handleNewUpload($a_no_notifications=false)
static formatDate(ilDateTime $date)
Format a date public.
initUploadForm()
Init upload form form.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
uploadFileObject()
Upload files.
confirmDeleteDeliveredObject()
Confirm deletion of delivered files.
addProperty($a_name, $a_value, $a_link="")
add a property to current section
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
uploadZipFormObject(ilPropertyFormGUI $a_form=null)
Display form for zip file upload.
getFiles(array $a_file_ids=null, $a_only_valid=false, $a_min_timestamp=null)
Confirmation screen class.
initZipUploadForm()
Init upload form form.
deleteDeliveredObject()
Delete file(s) submitted by user.