Object-based submissions (ends up as static file)
More...
◆ askDirectSubmissionObject()
ilExSubmissionObjectGUI::askDirectSubmissionObject |
( |
| ) |
|
|
protected |
Definition at line 575 of file class.ilExSubmissionObjectGUI.php.
References ilExSubmissionBaseGUI\$tpl, $txt, ilExSubmissionBaseGUI\returnToParentObject(), and ilUtil\sendInfo().
579 if (!$this->submission->canSubmit()) {
586 if ($_REQUEST[
"blog_id"]) {
587 $this->ctrl->setParameter($this,
"blog_id", $_REQUEST[
"blog_id"]);
588 $txt = $this->lng->txt(
"exc_direct_submit_blog");
590 $this->ctrl->setParameter($this,
"prtf_id", $_REQUEST[
"prtf_id"]);
591 $txt = $this->lng->txt(
"exc_direct_submit_portfolio");
593 $conf->setFormAction($this->ctrl->getFormAction($this,
"directSubmit"));
595 $conf->setHeaderText(
$txt);
596 $conf->setConfirm($this->lng->txt(
"exc_direct_submit"),
"directSubmit");
597 $conf->setCancel($this->lng->txt(
"exc_direct_no_submit"),
"returnToParent");
599 $tpl->setContent($conf->getHTML());
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Confirmation screen class.
◆ askUnlinkPortfolioObject()
ilExSubmissionObjectGUI::askUnlinkPortfolioObject |
( |
| ) |
|
|
protected |
Definition at line 536 of file class.ilExSubmissionObjectGUI.php.
References ilExSubmissionBaseGUI\$submission, ilExSubmissionBaseGUI\$tpl, and ilUtil\getImagePath().
541 $conf->setFormAction($this->ctrl->getFormAction($this,
"unlinkPortfolio"));
542 $conf->setHeaderText($this->lng->txt(
"exc_sure_unlink_portfolio",
"sure_unlink_portfolio"));
543 $conf->setConfirm($this->lng->txt(
"confirm"),
"unlinkPortfolio");
544 $conf->setCancel($this->lng->txt(
"cancel"),
"returnToParent");
546 $submission = $this->submission->getSelectedObject();
551 $tpl->setContent($conf->getHTML());
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Confirmation screen class.
◆ createBlogObject()
ilExSubmissionObjectGUI::createBlogObject |
( |
| ) |
|
|
protected |
◆ createPortfolioFromAssignmentObject()
ilExSubmissionObjectGUI::createPortfolioFromAssignmentObject |
( |
| ) |
|
|
protected |
Definition at line 411 of file class.ilExSubmissionObjectGUI.php.
References $_GET, ilExSubmissionBaseGUI\$ctrl, $DIC, ilObject\_lookupObjectId(), createPortfolioTemplateObject(), and ilObjPortfolioTemplate\getAvailablePortfolioTemplates().
415 $ctrl = $DIC->ctrl();
420 $template_id = $this->assignment->getPortfolioTemplateId();
425 if (count($templates) > 0 && $template_object_id == 0) {
430 $title = $this->exercise->getTitle() .
" - " . $this->assignment->getTitle();
431 $ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"exc_id", $this->exercise->getRefId());
432 $ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"ass_id", $this->assignment->getId());
433 $ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"pt", $title);
435 if ($template_object_id > 0) {
436 $ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"prtt", $template_object_id);
438 $ctrl->setParameterByClass(
"ilobjportfoliogui",
"exc_back_ref_id", (
int)
$_GET[
"ref_id"]);
439 $ctrl->redirectByClass(array(
"ildashboardgui",
"ilPortfolioRepositoryGUI",
"ilObjPortfolioGUI"),
"createPortfolioFromAssignment");
createPortfolioTemplateObject(ilPropertyFormGUI $a_form=null)
static _lookupObjectId($a_ref_id)
lookup object id
static getAvailablePortfolioTemplates($a_permission="read")
◆ createPortfolioObject()
ilExSubmissionObjectGUI::createPortfolioObject |
( |
| ) |
|
|
protected |
◆ createPortfolioTemplateObject()
ilExSubmissionObjectGUI::createPortfolioTemplateObject |
( |
ilPropertyFormGUI |
$a_form = null | ) |
|
|
protected |
◆ directSubmitObject()
ilExSubmissionObjectGUI::directSubmitObject |
( |
| ) |
|
|
protected |
Definition at line 602 of file class.ilExSubmissionObjectGUI.php.
References $success, ilExSubmissionBaseGUI\returnToParentObject(), ilUtil\sendFailure(), ilUtil\sendInfo(), submitBlog(), and submitPortfolio().
604 if (!$this->submission->canSubmit()) {
612 if ($_REQUEST[
"blog_id"]) {
614 $this->ctrl->setParameter($this,
"blog_id",
"");
617 elseif ($_REQUEST[
"prtf_id"]) {
619 $this->ctrl->setParameter($this,
"prtf_id",
"");
623 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
627 $this->ctrl->redirect($this,
"returnToParent");
submitBlog($a_blog_id)
Submit blog for assignment.
submitPortfolio($a_portfolio_id)
Submit portfolio for assignment.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
◆ executeCommand()
ilExSubmissionObjectGUI::executeCommand |
( |
| ) |
|
◆ getOverviewContent()
◆ getOverviewContentBlog()
Definition at line 49 of file class.ilExSubmissionObjectGUI.php.
References $DIC, $ilCtrl, ilExSubmissionBaseGUI\$lng, ilInfoScreenGUI\addProperty(), ilExSubmission\canSubmit(), ilWorkspaceTree\createTreeForUser(), ilExSubmission\deleteResourceObject(), ilLinkButton\getInstance(), ilExSubmission\getSelectedObject(), ilExSubmission\getUserId(), and ilExSubmission\hasSubmitted().
53 $lng = $DIC->language();
59 if (!$wsp_tree->getRootId()) {
68 $blog_id = (int) $selected_blog[
"filetitle"];
69 $node = $wsp_tree->getNodeData($blog_id);
72 $ilCtrl->setParameterByClass(
"ilobjbloggui",
"wsp_id", $blog_id);
73 $blog_link =
$ilCtrl->getLinkTargetByClass(array(
"ildashboardgui",
"ilpersonalworkspacegui",
"ilobjbloggui"),
"");
74 $ilCtrl->setParameterByClass(
"ilobjbloggui",
"wsp_id",
"");
75 $files_str =
'<a href="' . $blog_link .
'">' .
76 $node[
"title"] .
'</a>';
80 elseif (substr($selected_blog[
"filename"], -1) ==
"/") {
88 $button->setCaption(
"exc_create_blog");
89 $button->setUrl(
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionObjectGUI"),
"createBlog"));
90 $buttons_str .= $button->render();
93 $blogs =
sizeof($wsp_tree->getObjectsFromType(
"blog"));
94 if ((!$valid_blog && $blogs)
95 || ($valid_blog && $blogs > 1)) {
97 $button->setCaption(
"exc_select_blog" . ($valid_blog ?
"_change" :
""));
98 $button->setUrl(
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionObjectGUI"),
"selectBlog"));
99 $buttons_str .=
" " . $button->render();
104 if ($buttons_str !=
"") {
105 $files_str .=
"<p>" . $buttons_str .
"</p>";
113 $ilCtrl->setParameterByClass(
"ilExSubmissionFileGUI",
"delivered", $selected_blog[
"returned_id"]);
114 $dl_link =
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionFileGUI"),
"download");
115 $ilCtrl->setParameterByClass(
"ilExSubmissionFileGUI",
"delivered",
"");
118 $button->setCaption(
"download");
119 $button->setUrl($dl_link);
121 $a_info->
addProperty(
$lng->txt(
"exc_files_returned"), $button->render());
createTreeForUser($a_user_id)
Create personal workspace tree for user.
Tree handler for personal workspace.
addProperty($a_name, $a_value, $a_link="")
add a property to current section
deleteResourceObject($a_returned_id)
Remove personal resource to assigment.
◆ getOverviewContentPortfolio()
Definition at line 125 of file class.ilExSubmissionObjectGUI.php.
References $_GET, $DIC, $ilCtrl, ilExSubmissionBaseGUI\$lng, ilObject\_exists(), ilInfoScreenGUI\addProperty(), ilExSubmission\canSubmit(), ilExSubmission\deleteResourceObject(), ilLinkButton\getInstance(), ilObjPortfolio\getPortfoliosOfUser(), ilExSubmission\getSelectedObject(), ilExSubmission\getUserId(), and ilExSubmission\hasSubmitted().
129 $lng = $DIC->language();
136 if ($selected_prtf) {
137 $portfolio_id = (int) $selected_prtf[
"filetitle"];
142 if ($portfolio->getTitle()) {
144 $ilCtrl->setParameterByClass(
"ilobjportfoliogui",
"prt_id", $portfolio_id);
146 $ref_id = $_REQUEST[
'ref_id'];
147 $ilCtrl->setParameterByClass(
"ilobjportfoliogui",
"ref_id", $ref_id);
149 $ilCtrl->setParameterByClass(
"ilobjportfoliogui",
"exc_back_ref_id", (
int)
$_GET[
"ref_id"]);
151 $prtf_link =
$ilCtrl->getLinkTargetByClass(array(
"ildashboardgui",
"ilportfoliorepositorygui",
"ilobjportfoliogui"),
"view");
152 $ilCtrl->setParameterByClass(
"ilobjportfoliogui",
"prt_id",
"");
153 $ilCtrl->setParameterByClass(
"ilobjportfoliogui",
"ref_id",
"");
156 $files_str =
'<a href="' . $prtf_link .
157 '">' . $portfolio->getTitle() .
'</a>';
162 elseif (substr($selected_prtf[
"filename"], -1) ==
"/") {
170 $button->setCaption(
"exc_create_portfolio");
171 $button->setUrl(
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionObjectGUI"),
"createPortfolioFromAssignment"));
173 $buttons_str .=
"" . $button->render();
178 if ((!$valid_prtf && $prtfs)
179 || ($valid_prtf && $prtfs > 1)) {
181 $button->setCaption(
"exc_select_portfolio" . ($valid_prtf ?
"_change" :
""));
182 $button->setUrl(
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionObjectGUI"),
"selectPortfolio"));
183 $buttons_str .=
" " . $button->render();
187 $button->setCaption(
"exc_select_portfolio" . ($valid_prtf ?
"_unlink" :
""));
188 $button->setUrl(
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionObjectGUI"),
"askUnlinkPortfolio"));
189 $buttons_str .=
" " . $button->render();
193 if ($buttons_str !=
"") {
194 $files_str .=
"<p>" . $buttons_str .
"</p>";
200 $ilCtrl->setParameterByClass(
"ilExSubmissionFileGUI",
"delivered", $selected_prtf[
"returned_id"]);
201 $dl_link =
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionFileGUI"),
"download");
202 $ilCtrl->setParameterByClass(
"ilExSubmissionFileGUI",
"delivered",
"");
205 $button->setCaption(
"download");
206 $button->setUrl($dl_link);
208 $a_info->
addProperty(
$lng->txt(
"exc_files_returned"), $button->render());
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
static getPortfoliosOfUser($a_user_id)
Get views of user.
addProperty($a_name, $a_value, $a_link="")
add a property to current section
deleteResourceObject($a_returned_id)
Remove personal resource to assigment.
◆ initGUIForSubmit()
static ilExSubmissionObjectGUI::initGUIForSubmit |
( |
|
$a_ass_id, |
|
|
|
$a_user_id = null |
|
) |
| |
|
static |
◆ initPortfolioTemplateForm()
ilExSubmissionObjectGUI::initPortfolioTemplateForm |
( |
array |
$a_templates | ) |
|
|
protected |
Definition at line 390 of file class.ilExSubmissionObjectGUI.php.
References ilFormPropertyGUI\setRequired().
Referenced by createPortfolioTemplateObject(), and setSelectedPortfolioTemplateObject().
393 $form->setTitle($this->lng->txt(
"exc_create_portfolio") .
": " . $this->assignment->getTitle());
394 $form->setFormAction($this->ctrl->getFormAction($this,
"setSelectedPortfolioTemplate"));
398 $prtt->addOption(
new ilRadioOption($this->lng->txt(
"exc_create_portfolio_no_template"), -1));
399 foreach ($a_templates as $id => $title) {
400 $prtt->addOption(
new ilRadioOption(
'"' . $title .
'"', $id));
403 $form->addItem($prtt);
405 $form->addCommandButton(
"setSelectedPortfolioTemplate", $this->lng->txt(
"save"));
406 $form->addCommandButton(
"returnToParent", $this->lng->txt(
"cancel"));
This class represents an option in a radio group.
◆ renderResourceSelection()
ilExSubmissionObjectGUI::renderResourceSelection |
( |
|
$a_title, |
|
|
|
$a_info, |
|
|
|
$a_cmd, |
|
|
|
$a_explorer_cmd, |
|
|
array |
$a_items = null |
|
) |
| |
|
protected |
Definition at line 212 of file class.ilExSubmissionObjectGUI.php.
References ilExSubmissionBaseGUI\$tpl, ilPanelGUI\getInstance(), renderWorkspaceExplorer(), ilExSubmissionBaseGUI\returnToParentObject(), and ilUtil\sendInfo().
Referenced by createBlogObject(), selectBlogObject(), and selectPortfolioObject().
214 if (!$this->submission->canSubmit()) {
219 $tpl =
new ilTemplate(
"tpl.exc_select_resource.html",
true,
true,
"Modules/Exercise");
221 if (is_array($a_items)) {
222 $tpl->setCurrentBlock(
"item");
223 foreach ($a_items as $item_id => $item_title) {
224 $tpl->setVariable(
"ITEM_ID", $item_id);
225 $tpl->setVariable(
"ITEM_TITLE", $item_title);
226 $tpl->parseCurrentBlock();
228 $tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
229 $tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
230 $tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
231 $tpl->setVariable(
"CMD_SUBMIT", $a_cmd);
232 $tpl->setVariable(
"CMD_CANCEL",
"returnToParent");
234 } elseif ($a_explorer_cmd) {
241 $title = $this->lng->txt($a_title) .
": " . $this->assignment->getTitle();
244 $panel->setBody($html);
245 $panel->setHeading($title);
247 $this->tpl->setContent($panel->getHTML());
renderWorkspaceExplorer($a_cmd)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getInstance()
Get instance.
◆ renderWorkspaceExplorer()
ilExSubmissionObjectGUI::renderWorkspaceExplorer |
( |
|
$a_cmd | ) |
|
|
protected |
◆ saveBlogObject()
ilExSubmissionObjectGUI::saveBlogObject |
( |
| ) |
|
|
protected |
Definition at line 279 of file class.ilExSubmissionObjectGUI.php.
References $_GET, createBlogObject(), ilExSubmissionBaseGUI\handleRemovedUpload(), ilWorkspaceTree\insertObject(), ilExSubmissionBaseGUI\returnToParentObject(), ilUtil\sendFailure(), and ilUtil\sendInfo().
281 if (!$this->submission->canSubmit()) {
286 if (!
$_GET[
"sel_wsp_obj"]) {
291 $parent_node =
$_GET[
"sel_wsp_obj"];
294 $blog->setTitle($this->exercise->getTitle() .
" - " . $this->assignment->getTitle());
299 $node_id = $tree->
insertObject($parent_node, $blog->getId());
302 $access_handler->setPermissions($parent_node, $node_id);
304 $this->submission->deleteAllFiles();
307 $this->submission->addResourceObject($node_id);
309 ilUtil::sendSuccess($this->lng->txt(
"exc_blog_created"),
true);
Access handler for personal workspace.
Tree handler for personal workspace.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
insertObject($a_parent_node_id, $a_object_id)
Add object to tree.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
◆ selectBlogObject()
ilExSubmissionObjectGUI::selectBlogObject |
( |
| ) |
|
|
protected |
◆ selectPortfolioObject()
ilExSubmissionObjectGUI::selectPortfolioObject |
( |
| ) |
|
|
protected |
◆ setSelectedBlogObject()
ilExSubmissionObjectGUI::setSelectedBlogObject |
( |
| ) |
|
|
protected |
Definition at line 313 of file class.ilExSubmissionObjectGUI.php.
References $_GET, ilTree\getNodeData(), ilExSubmissionBaseGUI\handleRemovedUpload(), ilExSubmissionBaseGUI\returnToParentObject(), selectBlogObject(), and ilUtil\sendInfo().
315 if (!$this->submission->canSubmit()) {
320 if (
$_GET[
"sel_wsp_obj"]) {
323 if ($node && $node[
"type"] ==
"blog") {
324 $this->submission->deleteAllFiles();
327 $this->submission->addResourceObject($node[
"wsp_id"]);
329 ilUtil::sendSuccess($this->lng->txt(
"exc_blog_selected"),
true);
330 $this->ctrl->setParameter($this,
"blog_id", $node[
"wsp_id"]);
331 $this->ctrl->redirect($this,
"askDirectSubmission");
Tree handler for personal workspace.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getNodeData($a_node_id, $a_tree_pk=null)
get all information of a node.
◆ setSelectedPortfolioObject()
ilExSubmissionObjectGUI::setSelectedPortfolioObject |
( |
| ) |
|
|
protected |
Definition at line 514 of file class.ilExSubmissionObjectGUI.php.
References $_POST, ilExSubmissionBaseGUI\handleRemovedUpload(), ilExSubmissionBaseGUI\returnToParentObject(), selectPortfolioObject(), ilUtil\sendFailure(), and ilUtil\sendInfo().
516 if (!$this->submission->canSubmit()) {
522 $this->submission->deleteAllFiles();
525 $this->submission->addResourceObject(
$_POST[
"item"]);
527 ilUtil::sendSuccess($this->lng->txt(
"exc_portfolio_selected"),
true);
528 $this->ctrl->setParameter($this,
"prtf_id",
$_POST[
"item"]);
529 $this->ctrl->redirect($this,
"askDirectSubmission");
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
◆ setSelectedPortfolioTemplateObject()
ilExSubmissionObjectGUI::setSelectedPortfolioTemplateObject |
( |
| ) |
|
|
protected |
Definition at line 461 of file class.ilExSubmissionObjectGUI.php.
References $_GET, createPortfolioObject(), createPortfolioTemplateObject(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), initPortfolioTemplateForm(), ilExSubmissionBaseGUI\returnToParentObject(), and ilUtil\sendInfo().
463 if (!$this->submission->canSubmit()) {
469 if (!
sizeof($templates)) {
470 $this->ctrl->redirect($this,
"returnToParent");
474 if ($form->checkInput()) {
475 $prtt = $form->getInput(
"prtt");
476 if ($prtt > 0 && array_key_exists($prtt, $templates)) {
477 $title = $this->exercise->getTitle() .
" - " . $this->assignment->getTitle();
478 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"exc_id", $this->exercise->getRefId());
479 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"ass_id", $this->assignment->getId());
480 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"pt", $title);
481 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"prtt", $prtt);
482 $this->ctrl->setParameterByClass(
"ilobjportfoliogui",
"exc_back_ref_id", (
int)
$_GET[
"ref_id"]);
483 $this->ctrl->redirectByClass(array(
"ildashboardgui",
"ilPortfolioRepositoryGUI",
"ilObjPortfolioGUI"),
"createPortfolioFromTemplate");
490 $form->setValuesByPost();
createPortfolioTemplateObject(ilPropertyFormGUI $a_form=null)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getAvailablePortfolioTemplates($a_permission="read")
initPortfolioTemplateForm(array $a_templates)
◆ submitBlog()
ilExSubmissionObjectGUI::submitBlog |
( |
|
$a_blog_id | ) |
|
◆ submitPortfolio()
ilExSubmissionObjectGUI::submitPortfolio |
( |
|
$a_portfolio_id | ) |
|
Submit portfolio for assignment.
- Parameters
-
- Returns
- bool
Definition at line 671 of file class.ilExSubmissionObjectGUI.php.
References $size, and ilExSubmissionBaseGUI\handleNewUpload().
Referenced by directSubmitObject().
673 if (!$this->submission->canSubmit()) {
677 $prtf_id = $a_portfolio_id;
680 if ($prtf->getTitle()) {
682 $port_export = new \ILIAS\Portfolio\Export\PortfolioHtmlExport($port_gui);
683 $file = $port_export->exportHtml();
685 $size = filesize($file);
687 $this->submission->deleteAllFiles();
694 $this->submission->uploadFile($meta,
true);
Portfolio view gui class.
handleNewUpload($a_no_notifications=false)
◆ unlinkPortfolioObject()
ilExSubmissionObjectGUI::unlinkPortfolioObject |
( |
| ) |
|
|
protected |
Definition at line 554 of file class.ilExSubmissionObjectGUI.php.
References $DIC, and ilExSubmission\deleteResourceObject().
558 $user = $DIC->user();
560 $portfolio = $this->submission->getSelectedObject();
561 $port_id = $portfolio[
"returned_id"];
566 ilUtil::sendSuccess($this->lng->txt(
"exc_portfolio_unlinked_from_assignment"),
true);
568 $this->ctrl->redirect($this,
"returnToParent");
deleteResourceObject($a_returned_id)
Remove personal resource to assigment.
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
The documentation for this class was generated from the following file: