ILIAS  release_8 Revision v8.24
ilExSubmissionObjectGUI Class Reference

Object-based submissions (ends up as static file) More...

+ Inheritance diagram for ilExSubmissionObjectGUI:
+ Collaboration diagram for ilExSubmissionObjectGUI:

Public Member Functions

 __construct (ilObjExercise $a_exercise, ilExSubmission $a_submission)
 
 executeCommand ()
 
 submitBlog (int $a_blog_id)
 Submit blog for assignment. More...
 
 submitPortfolio (int $a_portfolio_id)
 Submit portfolio for assignment. More...
 
- Public Member Functions inherited from ilExSubmissionBaseGUI
 returnToParentObject ()
 

Static Public Member Functions

static getOverviewContent (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 
static initGUIForSubmit (int $a_ass_id, int $a_user_id=null)
 
static getOverviewContent (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 

Protected Member Functions

 renderResourceSelection (string $a_title, string $a_info, string $a_cmd, string $a_explorer_cmd, array $a_items=null)
 
 createBlogObject ()
 
 selectBlogObject ()
 
 saveBlogObject ()
 
 setSelectedBlogObject ()
 
 renderWorkspaceExplorer (string $a_cmd)
 
 selectPortfolioObject ()
 
 initPortfolioTemplateForm (array $a_templates)
 
 createPortfolioFromAssignmentObject ()
 
 createPortfolioTemplateObject (ilPropertyFormGUI $a_form=null)
 
 setSelectedPortfolioTemplateObject ()
 
 createPortfolioObject ()
 
 setSelectedPortfolioObject ()
 
 askUnlinkPortfolioObject ()
 
 unlinkPortfolioObject ()
 
 askDirectSubmissionObject ()
 
 directSubmitObject ()
 
- Protected Member Functions inherited from ilExSubmissionBaseGUI
 handleTabs ()
 
 handleNewUpload (bool $a_no_notifications=false)
 
 handleRemovedUpload ()
 
 triggerAssignmentTool ()
 

Static Protected Member Functions

static getOverviewContentBlog (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 

Protected Attributes

 $selected_wsp_obj_id
 
- Protected Attributes inherited from ilExSubmissionBaseGUI
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

Object-based submissions (ends up as static file)

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

@ilCtrl_Calls ilExSubmissionObjectGUI:

Definition at line 29 of file class.ilExSubmissionObjectGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilExSubmissionObjectGUI::__construct ( ilObjExercise  $a_exercise,
ilExSubmission  $a_submission 
)
Exceptions
ilExcUnknownAssignmentTypeException

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

39 {
40 parent::__construct($a_exercise, $a_submission);
41 $this->selected_wsp_obj_id = $this->request->getSelectedWspObjId();
42 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ askDirectSubmissionObject()

ilExSubmissionObjectGUI::askDirectSubmissionObject ( )
protected

Definition at line 639 of file class.ilExSubmissionObjectGUI.php.

639 : void
640 {
642
643 if (!$this->submission->canSubmit()) {
644 $this->tpl->setOnScreenMessage('info', $this->lng->txt("exercise_time_over"), true);
645 $this->returnToParentObject();
646 }
647
648 $conf = new ilConfirmationGUI();
649
650 if ($this->request->getBlogId() > 0) {
651 $this->ctrl->setParameter($this, "blog_id", $this->request->getBlogId());
652 $txt = $this->lng->txt("exc_direct_submit_blog");
653 } else {
654 $this->ctrl->setParameter($this, "prtf_id", $this->request->getPortfolioId());
655 $txt = $this->lng->txt("exc_direct_submit_portfolio");
656 }
657 $conf->setFormAction($this->ctrl->getFormAction($this, "directSubmit"));
658
659 $conf->setHeaderText($txt);
660 $conf->setConfirm($this->lng->txt("exc_direct_submit"), "directSubmit");
661 $conf->setCancel($this->lng->txt("exc_direct_no_submit"), "returnToParent");
662
663 $tpl->setContent($conf->getHTML());
664 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
$txt
Definition: error.php:13
setContent(string $a_html)
Sets content for standard template.
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.

References $tpl, $txt, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ askUnlinkPortfolioObject()

ilExSubmissionObjectGUI::askUnlinkPortfolioObject ( )
protected

Definition at line 600 of file class.ilExSubmissionObjectGUI.php.

600 : void
601 {
603
604 $conf = new ilConfirmationGUI();
605 $conf->setFormAction($this->ctrl->getFormAction($this, "unlinkPortfolio"));
606 $conf->setHeaderText($this->lng->txt("exc_sure_unlink_portfolio", "sure_unlink_portfolio"));
607 $conf->setConfirm($this->lng->txt("confirm"), "unlinkPortfolio");
608 $conf->setCancel($this->lng->txt("cancel"), "returnToParent");
609
610 $submission = $this->submission->getSelectedObject();
611 $port = new ilObjPortfolio((int) $submission["filetitle"], false);
612
613 $conf->addItem("id[]", "", $port->getTitle(), ilUtil::getImagePath("icon_prtf.svg"));
614
615 $tpl->setContent($conf->getHTML());
616 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References $tpl, ILIAS\Repository\ctrl(), ilUtil\getImagePath(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ createBlogObject()

ilExSubmissionObjectGUI::createBlogObject ( )
protected

Definition at line 299 of file class.ilExSubmissionObjectGUI.php.

299 : void
300 {
301 $this->handleTabs();
302
304 "exc_create_blog",
305 "exc_create_blog_select_info",
306 "saveBlog",
307 "createBlog"
308 );
309 }
renderResourceSelection(string $a_title, string $a_info, string $a_cmd, string $a_explorer_cmd, array $a_items=null)

◆ createPortfolioFromAssignmentObject()

ilExSubmissionObjectGUI::createPortfolioFromAssignmentObject ( )
protected

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

460 : void
461 {
462 global $DIC;
463
464 $ctrl = $DIC->ctrl();
465
467
468 //template id is stored in the DB with the ref_id.
469 $template_id = $this->assignment->getPortfolioTemplateId();
470 //get the object id to compare with a list of template objects.
471 $template_object_id = ilObject::_lookupObjectId($template_id);
472
473 // select a template, if available
474 if ($templates !== [] && $template_object_id == 0) {
476 return;
477 }
478
479 $title = $this->exercise->getTitle() . " - " . $this->assignment->getTitle();
480 $ctrl->setParameterByClass("ilObjPortfolioGUI", "exc_id", $this->exercise->getRefId());
481 $ctrl->setParameterByClass("ilObjPortfolioGUI", "ass_id", $this->assignment->getId());
482 $ctrl->setParameterByClass("ilObjPortfolioGUI", "pt", $title);
483
484 if ($template_object_id > 0) {
485 $ctrl->setParameterByClass("ilObjPortfolioGUI", "prtt", $template_object_id);
486 }
487 $ctrl->setParameterByClass("ilobjportfoliogui", "exc_back_ref_id", $this->requested_ref_id);
488 $ctrl->redirectByClass(array("ildashboardgui", "ilPortfolioRepositoryGUI", "ilObjPortfolioGUI"), "createPortfolioFromAssignment");
489 }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
createPortfolioTemplateObject(ilPropertyFormGUI $a_form=null)
static getAvailablePortfolioTemplates(string $a_permission="read")
static _lookupObjectId(int $ref_id)
global $DIC
Definition: feed.php:28

References $DIC, ilObject\_lookupObjectId(), and ilObjPortfolioTemplate\getAvailablePortfolioTemplates().

+ Here is the call graph for this function:

◆ createPortfolioObject()

ilExSubmissionObjectGUI::createPortfolioObject ( )
protected
Exceptions
ilExcUnknownAssignmentTypeException
ilExerciseException

Definition at line 553 of file class.ilExSubmissionObjectGUI.php.

553 : void
554 {
555 if (!$this->submission->canSubmit()) {
556 $this->tpl->setOnScreenMessage('info', $this->lng->txt("exercise_time_over"), true);
557 $this->returnToParentObject();
558 }
559
560 $portfolio = new ilObjPortfolio();
561 $portfolio->setTitle($this->exercise->getTitle() . " - " . $this->assignment->getTitle());
562 $portfolio->create();
563
564 $this->submission->deleteAllFiles();
565 $this->handleRemovedUpload();
566
567 $this->submission->addResourceObject($portfolio->getId());
568
569 $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_portfolio_created"), true);
570 $this->returnToParentObject();
571 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ createPortfolioTemplateObject()

ilExSubmissionObjectGUI::createPortfolioTemplateObject ( ilPropertyFormGUI  $a_form = null)
protected

Definition at line 491 of file class.ilExSubmissionObjectGUI.php.

493 : void {
494 if (!$this->submission->canSubmit()) {
495 $this->tpl->setOnScreenMessage('info', $this->lng->txt("exercise_time_over"), true);
496 $this->returnToParentObject();
497 }
498
500 if ($templates === []) {
501 $this->returnToParentObject();
502 }
503
504 if ($a_form === null) {
505 $a_form = $this->initPortfolioTemplateForm($templates);
506 }
507
508 $this->tpl->setContent($a_form->getHTML());
509 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ directSubmitObject()

ilExSubmissionObjectGUI::directSubmitObject ( )
protected
Exceptions
ilException
ilFileUtilsException

Definition at line 670 of file class.ilExSubmissionObjectGUI.php.

670 : void
671 {
672 if (!$this->submission->canSubmit()) {
673 $this->tpl->setOnScreenMessage('info', $this->lng->txt("exercise_time_over"), true);
674 $this->returnToParentObject();
675 }
676
677 $success = false;
678
679 // submit current version of blog
680 if ($this->request->getBlogId() > 0) {
681 $success = $this->submitBlog($this->request->getBlogId());
682 $this->ctrl->setParameter($this, "blog_id", "");
683 }
684 // submit current version of portfolio
685 elseif ($this->request->getPortfolioId() > 0) {
686 $success = $this->submitPortfolio($this->request->getPortfolioId());
687 $this->ctrl->setParameter($this, "prtf_id", "");
688 }
689
690 if ($success) {
691 $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
692 } else {
693 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("msg_failed"), true);
694 }
695 $this->ctrl->redirectByClass([ilExerciseHandlerGUI::class, ilObjExerciseGUI::class, ilExSubmissionGUI::class, ilExSubmissionObjectGUI::class], "returnToParent");
696 }
submitPortfolio(int $a_portfolio_id)
Submit portfolio for assignment.
submitBlog(int $a_blog_id)
Submit blog for assignment.

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

+ Here is the call graph for this function:

◆ executeCommand()

ilExSubmissionObjectGUI::executeCommand ( )

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

44 : void
45 {
46 $ilCtrl = $this->ctrl;
47
48 if (!$this->submission->canView()) {
49 $this->returnToParentObject();
50 }
51
52 $class = $ilCtrl->getNextClass($this);
53 $cmd = $ilCtrl->getCmd();
54
55 switch ($class) {
56 default:
57 $this->{$cmd . "Object"}();
58 break;
59 }
60 }

References ilExSubmissionBaseGUI\$ctrl, and ilExSubmissionBaseGUI\returnToParentObject().

+ Here is the call graph for this function:

◆ getOverviewContent()

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

Reimplemented from ilExSubmissionBaseGUI.

Definition at line 62 of file class.ilExSubmissionObjectGUI.php.

65 : void {
66 switch ($a_submission->getAssignment()->getType()) {
68 self::getOverviewContentBlog($a_info, $a_submission);
69 break;
70
72 self::getOverviewContentPortfolio($a_info, $a_submission);
73 break;
74 }
75 }
static getOverviewContentBlog(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)

References getOverviewContentBlog(), ilExAssignment\TYPE_BLOG, and ilExAssignment\TYPE_PORTFOLIO.

+ Here is the call graph for this function:

◆ getOverviewContentBlog()

static ilExSubmissionObjectGUI::getOverviewContentBlog ( ilInfoScreenGUI  $a_info,
ilExSubmission  $a_submission 
)
staticprotected

Definition at line 77 of file class.ilExSubmissionObjectGUI.php.

80 : void {
81 global $DIC;
82
83 $lng = $DIC->language();
84 $ilCtrl = $DIC->ctrl();
85
86 $wsp_tree = new ilWorkspaceTree($a_submission->getUserId());
87
88 // #12939
89 if (!$wsp_tree->getRootId()) {
90 $wsp_tree->createTreeForUser($a_submission->getUserId());
91 }
92
93 $files_str = "";
94 $buttons_str = "";
95 $valid_blog = false;
96 $selected_blog = $a_submission->getSelectedObject();
97 if ($selected_blog) {
98 $blog_id = (int) $selected_blog["filetitle"];
99 $node = $wsp_tree->getNodeData($blog_id);
100 if ($node["title"]) {
101 // #10116
102 $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", $blog_id);
103 $blog_link = $ilCtrl->getLinkTargetByClass(array("ildashboardgui", "ilpersonalworkspacegui", "ilobjbloggui"), "");
104 $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", "");
105 $files_str = '<a href="' . $blog_link . '">' .
106 $node["title"] . '</a>';
107 $valid_blog = true;
108 }
109 // remove invalid resource if no upload yet (see download below)
110 elseif (substr($selected_blog["filename"], -1) == "/") {
111 // #16887
112 $a_submission->deleteResourceObject();
113 }
114 }
115 if ($a_submission->canSubmit()) {
116 if (!$valid_blog) {
117 $button = ilLinkButton::getInstance();
118 $button->setCaption("exc_create_blog");
119 $button->setUrl($ilCtrl->getLinkTargetByClass(array("ilExSubmissionGUI", "ilExSubmissionObjectGUI"), "createBlog"));
120 $buttons_str .= $button->render();
121 }
122 // #10462
123 $blogs = count($wsp_tree->getObjectsFromType("blog"));
124 if ((!$valid_blog && $blogs)
125 || ($valid_blog && $blogs > 1)) {
126 $button = ilLinkButton::getInstance();
127 $button->setCaption("exc_select_blog" . ($valid_blog ? "_change" : ""));
128 $button->setUrl($ilCtrl->getLinkTargetByClass(array("ilExSubmissionGUI", "ilExSubmissionObjectGUI"), "selectBlog"));
129 $buttons_str .= " " . $button->render();
130 }
131 }
132
133 // todo: move this to ks somehow
134 if ($buttons_str != "") {
135 $files_str .= "<p>" . $buttons_str . "</p>";
136 }
137
138
139 if ($files_str) {
140 $a_info->addProperty($lng->txt("exc_blog_returned"), $files_str);
141 }
142 if ($a_submission->hasSubmitted()) {
143 $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "delivered", $selected_blog["returned_id"]);
144 $dl_link = $ilCtrl->getLinkTargetByClass(array("ilExSubmissionGUI", "ilExSubmissionFileGUI"), "download");
145 $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "delivered", "");
146
147 $button = ilLinkButton::getInstance();
148 $button->setCaption("download");
149 $button->setUrl($dl_link);
150
151 $a_info->addProperty($lng->txt("exc_files_returned"), $button->render());
152 }
153 }
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section
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...

Referenced by getOverviewContent().

+ Here is the caller graph for this function:

◆ initGUIForSubmit()

static ilExSubmissionObjectGUI::initGUIForSubmit ( int  $a_ass_id,
int  $a_user_id = null 
)
static
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 798 of file class.ilExSubmissionObjectGUI.php.

802 global $DIC;
803
804 $ilUser = $DIC->user();
805
806 if (!$a_user_id) {
807 $a_user_id = $ilUser->getId();
808 }
809
810 $ass = new ilExAssignment($a_ass_id);
811 $sub = new ilExSubmission($ass, $a_user_id);
812 $exc_id = $ass->getExerciseId();
813
814 // #11173 - ref_id is needed for notifications
815 $ref_ids = ilObject::_getAllReferences($exc_id);
816 $exc_ref_id = current($ref_ids);
817 $exc = new ilObjExercise($exc_ref_id, true);
818
819 return new self($exc, $sub);
820 }
Exercise assignment.
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...
Class ilObjExercise.
static _getAllReferences(int $id)
get all reference ids for object ID
$ilUser
Definition: imgupload.php:34

References $ilUser.

Referenced by ilBlogExerciseGUI\finalize(), and ilPortfolioExerciseGUI\finalize().

+ Here is the caller graph for this function:

◆ initPortfolioTemplateForm()

ilExSubmissionObjectGUI::initPortfolioTemplateForm ( array  $a_templates)
protected

Definition at line 438 of file class.ilExSubmissionObjectGUI.php.

441 $form = new ilPropertyFormGUI();
442 $form->setTitle($this->lng->txt("exc_create_portfolio") . ": " . $this->assignment->getTitle());
443 $form->setFormAction($this->ctrl->getFormAction($this, "setSelectedPortfolioTemplate"));
444
445 $prtt = new ilRadioGroupInputGUI($this->lng->txt("obj_prtt"), "prtt");
446 $prtt->setRequired(true);
447 $prtt->addOption(new ilRadioOption($this->lng->txt("exc_create_portfolio_no_template"), -1));
448 foreach ($a_templates as $id => $title) {
449 $prtt->addOption(new ilRadioOption('"' . $title . '"', $id));
450 }
451 $prtt->setValue(-1);
452 $form->addItem($prtt);
453
454 $form->addCommandButton("setSelectedPortfolioTemplate", $this->lng->txt("save"));
455 $form->addCommandButton("returnToParent", $this->lng->txt("cancel"));
456
457 return $form;
458 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This class represents a property form user interface.
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ renderResourceSelection()

ilExSubmissionObjectGUI::renderResourceSelection ( string  $a_title,
string  $a_info,
string  $a_cmd,
string  $a_explorer_cmd,
array  $a_items = null 
)
protected

Definition at line 250 of file class.ilExSubmissionObjectGUI.php.

256 : void {
257 if (!$this->submission->canSubmit()) {
258 $this->tpl->setOnScreenMessage('info', $this->lng->txt("exercise_time_over"), true);
259 $this->returnToParentObject();
260 }
261
262 $html = "";
263 $tpl = new ilTemplate("tpl.exc_select_resource.html", true, true, "Modules/Exercise");
264
265 if (is_array($a_items)) {
266 $tpl->setCurrentBlock("item");
267 foreach ($a_items as $item_id => $item_title) {
268 $tpl->setVariable("ITEM_ID", $item_id);
269 $tpl->setVariable("ITEM_TITLE", $item_title);
271 }
272 $tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
273 $tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
274 $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
275 $tpl->setVariable("CMD_SUBMIT", $a_cmd);
276 $tpl->setVariable("CMD_CANCEL", "returnToParent");
277 $html = $tpl->get();
278 } elseif ($a_explorer_cmd) {
279 $html = $this->renderWorkspaceExplorer($a_explorer_cmd);
280 }
281
282
283 $this->tpl->setOnScreenMessage('info', $this->lng->txt($a_info));
284
285 $title = $this->lng->txt($a_title) . ": " . $this->assignment->getTitle();
286
288 $panel->setBody($html);
289 $panel->setHeading($title);
290
291 $this->tpl->setContent($panel->getHTML());
292 }
static getInstance()
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:198
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ renderWorkspaceExplorer()

ilExSubmissionObjectGUI::renderWorkspaceExplorer ( string  $a_cmd)
protected

Definition at line 391 of file class.ilExSubmissionObjectGUI.php.

393 : string {
394 $exp2 = null;
395 switch ($a_cmd) {
396 case "selectBlog":
397 $exp2 = new ilWorkspaceExplorerGUI($this->submission->getUserId(), $this, $a_cmd, $this, "setSelectedBlog");
398 $exp2->setTypeWhiteList(array("blog", "wsrt", "wfld"));
399 $exp2->setSelectableTypes(array("blog"));
400 break;
401
402 case "createBlog":
403 $exp2 = new ilWorkspaceExplorerGUI($this->submission->getUserId(), $this, $a_cmd, $this, "saveBlog");
404 $exp2->setTypeWhiteList(array("wsrt", "wfld"));
405 $exp2->setSelectableTypes(array("wsrt", "wfld"));
406 break;
407 }
408 if (!$exp2->handleCommand()) {
409 return $exp2->getHTML();
410 }
411 exit;
412 }
Explorer for selecting a personal workspace item.
exit
Definition: login.php:28

◆ saveBlogObject()

ilExSubmissionObjectGUI::saveBlogObject ( )
protected
Exceptions
ilExcUnknownAssignmentTypeException
ilExerciseException

Definition at line 327 of file class.ilExSubmissionObjectGUI.php.

327 : void
328 {
329 if (!$this->submission->canSubmit()) {
330 $this->tpl->setOnScreenMessage('info', $this->lng->txt("exercise_time_over"), true);
331 $this->returnToParentObject();
332 }
333
334 if ($this->selected_wsp_obj_id == 0) {
335 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("select_one"));
336 $this->createBlogObject();
337 return;
338 }
339
340 $parent_node = $this->selected_wsp_obj_id;
341
342 $blog = new ilObjBlog();
343 $blog->setTitle($this->exercise->getTitle() . " - " . $this->assignment->getTitle());
344 $blog->create();
345
346 $tree = new ilWorkspaceTree($this->submission->getUserId()); // #15993
347
348 $node_id = $tree->insertObject($parent_node, $blog->getId());
349
350 $access_handler = new ilWorkspaceAccessHandler($tree);
351 $access_handler->setPermissions($parent_node, $node_id);
352
353 $this->submission->deleteAllFiles();
354 $this->handleRemovedUpload();
355
356 $this->submission->addResourceObject($node_id);
357
358 $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_blog_created"), true);
359 $this->returnToParentObject();
360 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ selectBlogObject()

ilExSubmissionObjectGUI::selectBlogObject ( )
protected

Definition at line 311 of file class.ilExSubmissionObjectGUI.php.

311 : void
312 {
313 $this->handleTabs();
314
316 "exc_select_blog",
317 "exc_select_blog_info",
318 "setSelectedBlog",
319 "selectBlog"
320 );
321 }

◆ selectPortfolioObject()

ilExSubmissionObjectGUI::selectPortfolioObject ( )
protected

Definition at line 419 of file class.ilExSubmissionObjectGUI.php.

419 : void
420 {
421 $this->handleTabs();
422
423 $items = array();
424 $portfolios = ilObjPortfolio::getPortfoliosOfUser($this->submission->getUserId());
425 foreach ($portfolios as $portfolio) {
426 $items[$portfolio["id"]] = $portfolio["title"];
427 }
428
430 "exc_select_portfolio",
431 "exc_select_portfolio_info",
432 "setSelectedPortfolio",
433 "",
434 $items
435 );
436 }
static getPortfoliosOfUser(int $a_user_id)
Get portfolios of user.

References ilObjPortfolio\getPortfoliosOfUser().

+ Here is the call graph for this function:

◆ setSelectedBlogObject()

ilExSubmissionObjectGUI::setSelectedBlogObject ( )
protected
Exceptions
ilExcUnknownAssignmentTypeException
ilExerciseException

Definition at line 366 of file class.ilExSubmissionObjectGUI.php.

366 : void
367 {
368 if (!$this->submission->canSubmit()) {
369 $this->tpl->setOnScreenMessage('info', $this->lng->txt("exercise_time_over"), true);
370 $this->returnToParentObject();
371 }
372
373 if ($this->selected_wsp_obj_id > 0) {
374 $tree = new ilWorkspaceTree($this->submission->getUserId());
375 $node = $tree->getNodeData($this->selected_wsp_obj_id);
376 if ($node && $node["type"] == "blog") {
377 $this->submission->deleteAllFiles();
378 $this->handleRemovedUpload();
379
380 $this->submission->addResourceObject($node["wsp_id"]);
381
382 $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_blog_selected"), true);
383 $this->ctrl->setParameter($this, "blog_id", $node["wsp_id"]);
384 $this->ctrl->redirect($this, "askDirectSubmission");
385 }
386 }
387
388 $this->selectBlogObject();
389 }

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

+ Here is the call graph for this function:

◆ setSelectedPortfolioObject()

ilExSubmissionObjectGUI::setSelectedPortfolioObject ( )
protected
Exceptions
ilExcUnknownAssignmentTypeException
ilExerciseException

Definition at line 577 of file class.ilExSubmissionObjectGUI.php.

577 : void
578 {
579 if (!$this->submission->canSubmit()) {
580 $this->tpl->setOnScreenMessage('info', $this->lng->txt("exercise_time_over"), true);
581 $this->returnToParentObject();
582 }
583
584 $prtf_id = $this->request->getResourceObjectId();
585 if ($prtf_id > 0) {
586 $this->submission->deleteAllFiles();
587 $this->handleRemovedUpload();
588
589 $this->submission->addResourceObject($prtf_id);
590
591 $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_portfolio_selected"), true);
592 $this->ctrl->setParameter($this, "prtf_id", $prtf_id);
593 $this->ctrl->redirect($this, "askDirectSubmission");
594 }
595
596 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("select_one"));
597 $this->selectPortfolioObject();
598 }

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

+ Here is the call graph for this function:

◆ setSelectedPortfolioTemplateObject()

ilExSubmissionObjectGUI::setSelectedPortfolioTemplateObject ( )
protected
Exceptions
ilExcUnknownAssignmentTypeException
ilExerciseException

Definition at line 515 of file class.ilExSubmissionObjectGUI.php.

515 : void
516 {
517 if (!$this->submission->canSubmit()) {
518 $this->tpl->setOnScreenMessage('info', $this->lng->txt("exercise_time_over"), true);
519 $this->returnToParentObject();
520 }
521
523 if ($templates === []) {
524 $this->ctrl->redirect($this, "returnToParent");
525 }
526
527 $form = $this->initPortfolioTemplateForm($templates);
528 if ($form->checkInput()) {
529 $prtt = $form->getInput("prtt");
530 if ($prtt > 0 && array_key_exists($prtt, $templates)) {
531 $title = $this->exercise->getTitle() . " - " . $this->assignment->getTitle();
532 $this->ctrl->setParameterByClass("ilObjPortfolioGUI", "exc_id", $this->exercise->getRefId());
533 $this->ctrl->setParameterByClass("ilObjPortfolioGUI", "ass_id", $this->assignment->getId());
534 $this->ctrl->setParameterByClass("ilObjPortfolioGUI", "pt", $title);
535 $this->ctrl->setParameterByClass("ilObjPortfolioGUI", "prtt", $prtt);
536 $this->ctrl->setParameterByClass("ilobjportfoliogui", "exc_back_ref_id", $this->requested_ref_id);
537 $this->ctrl->redirectByClass(array("ildashboardgui", "ilPortfolioRepositoryGUI", "ilObjPortfolioGUI"), "createPortfolioFromTemplate");
538 } else {
539 // do not use template
540 $this->createPortfolioObject();
541 return;
542 }
543 }
544
545 $form->setValuesByPost();
546 $this->createPortfolioTemplateObject($form);
547 }

References ILIAS\Repository\ctrl(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ submitBlog()

ilExSubmissionObjectGUI::submitBlog ( int  $a_blog_id)

Submit blog for assignment.

Exceptions
ilFileUtilsException
ilException

Definition at line 703 of file class.ilExSubmissionObjectGUI.php.

705 : bool {
706 if (!$this->submission->canSubmit()) {
707 return false;
708 }
709
710 $blog_id = $a_blog_id;
711
712 $blog_gui = new ilObjBlogGUI($blog_id, ilObject2GUI::WORKSPACE_NODE_ID);
713 if ($blog_gui->getObject()) {
714 $file = $blog_gui->buildExportFile();
715 $size = filesize($file);
716 if ($size) {
717 $this->submission->deleteAllFiles();
718
719 $meta = array(
720 "name" => $blog_id . ".zip",
721 "tmp_name" => $file,
722 "size" => $size
723 );
724 $this->submission->uploadFile($meta, true);
725
726 // print version
727 $file = $file = $blog_gui->buildExportFile(false, true);
728 $size = filesize($file);
729 if ($size) {
730 $meta = array(
731 "name" => $blog_id . "print.zip",
732 "tmp_name" => $file,
733 "size" => $size
734 );
735 $this->submission->uploadFile($meta, true);
736 }
737
738 $this->handleNewUpload();
739 return true;
740 }
741 }
742 return false;
743 }
handleNewUpload(bool $a_no_notifications=false)
Class ilObjBlogGUI.

◆ submitPortfolio()

ilExSubmissionObjectGUI::submitPortfolio ( int  $a_portfolio_id)

Submit portfolio for assignment.

Exceptions
ilFileUtilsException

Definition at line 749 of file class.ilExSubmissionObjectGUI.php.

751 : bool {
752 if (!$this->submission->canSubmit()) {
753 return false;
754 }
755
756 $prtf_id = $a_portfolio_id;
757
758 $prtf = new ilObjPortfolio($prtf_id, false);
759 if ($prtf->getTitle()) {
760 $port_gui = new ilObjPortfolioGUI($prtf_id);
761 $port_export = new PortfolioHtmlExport($port_gui);
762 $file = $port_export->exportHtml();
763
764 $size = filesize($file);
765 if ($size) {
766 $this->submission->deleteAllFiles();
767
768 $meta = array(
769 "name" => $prtf_id . ".zip",
770 "tmp_name" => $file,
771 "size" => $size
772 );
773 $this->submission->uploadFile($meta, true);
774
775 // print version
776 $port_export->setPrintVersion(true);
777 $file = $port_export->exportHtml();
778 $size = filesize($file);
779 if ($size) {
780 $meta = array(
781 "name" => $prtf_id . "print.zip",
782 "tmp_name" => $file,
783 "size" => $size
784 );
785 $this->submission->uploadFile($meta, true);
786 }
787
788 $this->handleNewUpload();
789 return true;
790 }
791 }
792 return false;
793 }
Portfolio view gui class.

◆ unlinkPortfolioObject()

ilExSubmissionObjectGUI::unlinkPortfolioObject ( )
protected

Definition at line 618 of file class.ilExSubmissionObjectGUI.php.

618 : void
619 {
620 global $DIC;
621
622 $user = $DIC->user();
623
624 //$portfolio = $this->submission->getSelectedObject();
625 //$port_id = $portfolio["returned_id"];
626
627 //$ilsub = new ilExSubmission($this->assignment, $user->getId());
628 $this->submission->deleteResourceObject();
629
630 $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_portfolio_unlinked_from_assignment"), true);
631
632 $this->ctrl->redirect($this, "returnToParent");
633 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $selected_wsp_obj_id

ilExSubmissionObjectGUI::$selected_wsp_obj_id
protected

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


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