37 protected \ILIAS\DI\UIServices
$ui;
45 $this->main_tpl =
$DIC->ui()->mainTemplate();
47 $this->
ctrl = $DIC->ctrl();
48 $this->
lng = $DIC->language();
49 $this->user_id = $a_user_id;
50 $this->obj_id = $a_obj_id;
52 $this->port_request =
$DIC->portfolio()
57 $this->ass_id = $this->port_request->getExcAssId();
58 $this->file = $this->port_request->getExcFile();
59 $this->
ui = $DIC->ui();
68 $this->
ctrl->returnToParent($this);
71 $next_class = $ilCtrl->getNextClass($this);
72 $cmd = $ilCtrl->getCmd();
74 switch ($next_class) {
88 bool $a_add_submit =
false,
89 bool $as_array =
false
100 if (count($info) && !$as_array) {
101 return implode(
"<br />", $info);
118 int $a_assignment_id,
119 bool $a_add_submit =
false,
120 bool $as_array =
false
131 $ilCtrl =
$DIC->ctrl();
135 $exercise_id = $ass->getExerciseId();
141 $times_up = $ass->afterDeadlineStrict();
145 $exc_ref_id = array_shift($ref_ids);
148 $info_arr[
"ass_title"] = $ass->getTitle();
150 $lng->
txt(
"prtf_exercise_info"),
158 if ($a_add_submit && !$times_up && !$as_array) {
159 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass", $a_assignment_id);
160 $submit_link = $ilCtrl->getLinkTargetByClass(
"ilportfolioexercisegui",
"finalize");
161 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass",
"");
163 $buttons[] =
$ui->factory()->button()->primary(
$lng->
txt(
"prtf_finalize_portfolio"), $submit_link);
168 $info_arr[
"submitted"] =
false;
169 if ($submission->hasSubmitted()) {
171 $submitted = $submission->getSelectedObject();
174 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass", $a_assignment_id);
175 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilportfolioexercisegui",
"downloadExcSubFile");
176 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass",
"");
181 $text .=
"<p>" . sprintf(
182 $lng->
txt(
"prtf_exercise_submitted_info"),
186 $buttons[] =
$ui->factory()->button()->standard(
$lng->
txt(
"prtf_download_submission"), $dl_link);
191 $info_arr[
"submitted"] =
true;
192 if ($submitted[
"ts"] ==
"") {
193 $info_arr[
"submitted"] =
false;
201 $inst = $ass->getInstruction();
203 $tooltip .= nl2br($inst);
206 $ass_files = $ass->getFiles();
207 if (!$as_array && count($ass_files) > 0) {
209 $tooltip .=
"<br /><br />";
214 foreach ($ass_files as
$file) {
215 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass", $a_assignment_id);
216 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"file", urlencode(
$file[
"name"]));
217 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilportfolioexercisegui",
"downloadExcAssFile");
218 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"file",
"");
219 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass",
"");
221 $items[] =
$ui->renderer()->render(
$ui->factory()->button()->shy(
$file[
"name"], $dl_link));
223 $list =
$ui->factory()->listing()->unordered($items);
224 $tooltip .=
$ui->renderer()->render($list);
228 $modal =
$ui->factory()->modal()->roundtrip(
$lng->
txt(
"exc_instruction"),
$ui->factory()->legacy($tooltip))
229 ->withCancelButtonLabel(
"close");
230 $elements[] = $modal;
231 $buttons[] =
$ui->factory()->button()->standard(
$lng->
txt(
"exc_instruction"),
'#')
232 ->withOnClick($modal->getShowSignal());
239 $elements[] =
$ui->factory()->messageBox()->info($text)
241 ->withButtons($buttons);
243 return $ui->renderer()->render($elements);
250 $ass_files = $ass->getFiles();
251 if (count($ass_files) > 0) {
252 foreach ($ass_files as
$file) {
253 if (
$file[
"name"] == $this->file) {
265 $submitted = $submission->getFiles();
266 if (count($submitted) > 0) {
267 $submitted = array_pop($submitted);
271 $ass->getTitle() .
" - " .
272 $user_data[
"firstname"] .
" " .
273 $user_data[
"lastname"] .
" (" .
274 $user_data[
"login"] .
").zip";
289 $exc_gui->submitPortfolio($this->obj_id);
291 $this->main_tpl->setOnScreenMessage(
'success',
$lng->
txt(
"prtf_finalized"),
true);
292 $ilCtrl->returnToParent($this);
302 $ilCtrl = $this->
ctrl;
308 if ($state->isSubmissionAllowed()) {
309 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass",
$ass_id);
310 $submit_link = $ilCtrl->getLinkTargetByClass(
"ilportfolioexercisegui",
"finalize");
311 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass",
"");
312 $button =
$ui->factory()->button()->primary(
$lng->
txt(
"prtf_finalize_portfolio"), $submit_link);
321 $ilCtrl = $this->
ctrl;
327 if ($submission->hasSubmitted()) {
329 $submitted = $submission->getSelectedObject();
330 if ($submitted[
"ts"] !=
"") {
331 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass", $ass_id);
332 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilportfolioexercisegui",
"downloadExcSubFile");
333 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass",
"");
334 $button = $ui->factory()->button()->standard(
$lng->txt(
"prtf_download_submission"), $dl_link);
352 $buttons[$ass_id] = [];
353 $submit_button = $this->getSubmitButton($ass_id);
354 if ($submit_button) {
355 $buttons[$ass_id][] = $submit_button;
357 $download_button = $this->getDownloadSubmissionButton($ass_id);
358 if ($download_button) {
359 $buttons[$ass_id][] = $download_button;
Class ilCtrl provides processing control methods.
static useRelativeDates()
static setUseRelativeDates(bool $a_status)
set use relative dates
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
static initGUIForSubmit(int $a_ass_id, int $a_user_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByIds(int $a_ass_id, int $a_user_id=0)
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
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...
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
Get static link.
static _lookupName(int $a_user_id)
lookup user name
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupTitle(int $obj_id)
Class ilPortfolioExerciseGUI.
ilGlobalTemplateInterface $main_tpl
static getExerciseInfo(int $a_user_id, int $a_assignment_id, bool $a_add_submit=false, bool $as_array=false)
getSubmitButton(int $ass_id)
Get submit link.
static checkExercise(int $a_user_id, int $a_obj_id, bool $a_add_submit=false, bool $as_array=false)
getDownloadSubmissionButton(int $ass_id)
__construct(int $a_user_id, int $a_obj_id)
StandardGUIRequest $port_request
getActionButtons()
Get action buttons.
finalize()
Finalize and submit portfolio to exercise.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getAssignmentsOfPortfolio()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.