24 if (!$this->submission->canView()) {
28 $class =
$ilCtrl->getNextClass($this);
33 $this->{$cmd .
"Object"}();
42 return self::getOverviewContentBlog($a_info, $a_submission);
45 return self::getOverviewContentPortfolio($a_info, $a_submission);
53 $lng = $DIC->language();
56 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
60 if (!$wsp_tree->getRootId()) {
69 $blog_id = (int) $selected_blog[
"filetitle"];
70 $node = $wsp_tree->getNodeData($blog_id);
73 $ilCtrl->setParameterByClass(
"ilobjbloggui",
"wsp_id", $blog_id);
74 $blog_link =
$ilCtrl->getLinkTargetByClass(array(
"ilpersonaldesktopgui",
"ilpersonalworkspacegui",
"ilobjbloggui"),
"");
75 $ilCtrl->setParameterByClass(
"ilobjbloggui",
"wsp_id",
"");
76 $files_str =
'<a href="' . $blog_link .
'">' .
77 $node[
"title"] .
'</a>';
81 elseif (substr($selected_blog[
"filename"], -1) ==
"/") {
89 $button->setCaption(
"exc_create_blog");
90 $button->setUrl(
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionObjectGUI"),
"createBlog"));
91 $buttons_str .= $button->render();
94 $blogs =
sizeof($wsp_tree->getObjectsFromType(
"blog"));
95 if ((!$valid_blog && $blogs)
96 || ($valid_blog && $blogs > 1)) {
98 $button->setCaption(
"exc_select_blog" . ($valid_blog ?
"_change" :
""));
99 $button->setUrl(
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionObjectGUI"),
"selectBlog"));
100 $buttons_str .=
" " . $button->render();
105 if ($buttons_str !=
"") {
106 $files_str .=
"<p>" . $buttons_str .
"</p>";
114 $ilCtrl->setParameterByClass(
"ilExSubmissionFileGUI",
"delivered", $selected_blog[
"returned_id"]);
115 $dl_link =
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionFileGUI"),
"download");
116 $ilCtrl->setParameterByClass(
"ilExSubmissionFileGUI",
"delivered",
"");
119 $button->setCaption(
"download");
120 $button->setUrl($dl_link);
122 $a_info->
addProperty(
$lng->txt(
"exc_files_returned"), $button->render());
130 $lng = $DIC->language();
133 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
139 if ($selected_prtf) {
140 $portfolio_id = (int) $selected_prtf[
"filetitle"];
145 if ($portfolio->getTitle()) {
147 $ilCtrl->setParameterByClass(
"ilobjportfoliogui",
"prt_id", $portfolio_id);
149 $ref_id = $_REQUEST[
'ref_id'];
150 $ilCtrl->setParameterByClass(
"ilobjportfoliogui",
"ref_id", $ref_id);
152 $ilCtrl->setParameterByClass(
"ilobjportfoliogui",
"exc_back_ref_id", (
int)
$_GET[
"ref_id"]);
154 $prtf_link =
$ilCtrl->getLinkTargetByClass(array(
"ilpersonaldesktopgui",
"ilportfoliorepositorygui",
"ilobjportfoliogui"),
"view");
155 $ilCtrl->setParameterByClass(
"ilobjportfoliogui",
"prt_id",
"");
156 $ilCtrl->setParameterByClass(
"ilobjportfoliogui",
"ref_id",
"");
159 $files_str =
'<a href="' . $prtf_link .
160 '">' . $portfolio->getTitle() .
'</a>';
165 elseif (substr($selected_prtf[
"filename"], -1) ==
"/") {
173 $button->setCaption(
"exc_create_portfolio");
174 $button->setUrl(
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionObjectGUI"),
"createPortfolioFromAssignment"));
176 $buttons_str .=
"" . $button->render();
181 if ((!$valid_prtf && $prtfs)
182 || ($valid_prtf && $prtfs > 1)) {
184 $button->setCaption(
"exc_select_portfolio" . ($valid_prtf ?
"_change" :
""));
185 $button->setUrl(
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionObjectGUI"),
"selectPortfolio"));
186 $buttons_str .=
" " . $button->render();
190 $button->setCaption(
"exc_select_portfolio" . ($valid_prtf ?
"_unlink" :
""));
191 $button->setUrl(
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionObjectGUI"),
"askUnlinkPortfolio"));
192 $buttons_str .=
" " . $button->render();
196 if ($buttons_str !=
"") {
197 $files_str .=
"<p>" . $buttons_str .
"</p>";
203 $ilCtrl->setParameterByClass(
"ilExSubmissionFileGUI",
"delivered", $selected_prtf[
"returned_id"]);
204 $dl_link =
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionFileGUI"),
"download");
205 $ilCtrl->setParameterByClass(
"ilExSubmissionFileGUI",
"delivered",
"");
208 $button->setCaption(
"download");
209 $button->setUrl($dl_link);
211 $a_info->
addProperty(
$lng->txt(
"exc_files_returned"), $button->render());
217 if (!$this->submission->canSubmit()) {
222 $tpl =
new ilTemplate(
"tpl.exc_select_resource.html",
true,
true,
"Modules/Exercise");
224 if (is_array($a_items)) {
225 $tpl->setCurrentBlock(
"item");
226 foreach ($a_items as $item_id => $item_title) {
227 $tpl->setVariable(
"ITEM_ID", $item_id);
228 $tpl->setVariable(
"ITEM_TITLE", $item_title);
229 $tpl->parseCurrentBlock();
231 $tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
232 $tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
233 $tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
234 $tpl->setVariable(
"CMD_SUBMIT", $a_cmd);
235 $tpl->setVariable(
"CMD_CANCEL",
"returnToParent");
237 } elseif ($a_explorer_cmd) {
244 $title = $this->lng->txt($a_title) .
": " . $this->assignment->getTitle();
246 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
248 $panel->setBody(
$html);
249 $panel->setHeading($title);
251 $this->tpl->setContent($panel->getHTML());
265 "exc_create_blog_select_info",
277 "exc_select_blog_info",
285 if (!$this->submission->canSubmit()) {
290 if (!
$_GET[
"sel_wsp_obj"]) {
295 $parent_node =
$_GET[
"sel_wsp_obj"];
297 include_once
"Modules/Blog/classes/class.ilObjBlog.php";
298 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
299 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
302 $blog->setTitle($this->exercise->getTitle() .
" - " . $this->assignment->getTitle());
307 $node_id =
$tree->insertObject($parent_node, $blog->getId());
310 $access_handler->setPermissions($parent_node, $node_id);
312 $this->submission->deleteAllFiles();
315 $this->submission->addResourceObject($node_id);
317 ilUtil::sendSuccess($this->lng->txt(
"exc_blog_created"),
true);
323 if (!$this->submission->canSubmit()) {
328 if (
$_GET[
"sel_wsp_obj"]) {
329 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
331 $node =
$tree->getNodeData(
$_GET[
"sel_wsp_obj"]);
332 if ($node && $node[
"type"] ==
"blog") {
333 $this->submission->deleteAllFiles();
336 $this->submission->addResourceObject($node[
"wsp_id"]);
338 ilUtil::sendSuccess($this->lng->txt(
"exc_blog_selected"),
true);
339 $this->ctrl->setParameter($this,
"blog_id", $node[
"wsp_id"]);
340 $this->ctrl->redirect($this,
"askDirectSubmission");
354 include_once(
"./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorerGUI.php");
357 $exp2 =
new ilWorkspaceExplorerGUI($this->submission->getUserId(), $this, $a_cmd, $this,
"setSelectedBlog");
359 $exp2->setSelectableTypes(array(
"blog"));
365 $exp2->setSelectableTypes(array(
"wsrt",
"wfld"));
368 if (!$exp2->handleCommand()) {
369 return $exp2->getHTML();
384 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
387 foreach ($portfolios as $portfolio) {
388 $items[$portfolio[
"id"]] = $portfolio[
"title"];
393 "exc_select_portfolio",
394 "exc_select_portfolio_info",
395 "setSelectedPortfolio",
403 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
405 $form->setTitle($this->lng->txt(
"exc_create_portfolio") .
": " . $this->assignment->getTitle());
406 $form->setFormAction($this->ctrl->getFormAction($this,
"setSelectedPortfolioTemplate"));
410 $prtt->addOption(
new ilRadioOption($this->lng->txt(
"exc_create_portfolio_no_template"), -1));
411 foreach ($a_templates as
$id =>
$title) {
415 $form->addItem($prtt);
417 $form->addCommandButton(
"setSelectedPortfolioTemplate", $this->lng->txt(
"save"));
418 $form->addCommandButton(
"returnToParent", $this->lng->txt(
"cancel"));
427 $ctrl = $DIC->ctrl();
429 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
434 $template_id = $this->assignment->getPortfolioTemplateId();
439 if (count($templates) > 0 && $template_object_id == 0) {
444 $title = $this->exercise->getTitle() .
" - " . $this->assignment->getTitle();
445 $ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"exc_id", $this->exercise->getRefId());
446 $ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"ass_id", $this->assignment->getId());
447 $ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"pt",
$title);
449 if ($template_object_id > 0) {
450 $ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"prtt", $template_object_id);
452 $ctrl->setParameterByClass(
"ilobjportfoliogui",
"exc_back_ref_id", (
int)
$_GET[
"ref_id"]);
453 $ctrl->redirectByClass(array(
"ilPersonalDesktopGUI",
"ilPortfolioRepositoryGUI",
"ilObjPortfolioGUI"),
"createPortfolioFromAssignment");
458 if (!$this->submission->canSubmit()) {
463 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
465 if (!
sizeof($templates)) {
473 $this->tpl->setContent($a_form->getHTML());
478 if (!$this->submission->canSubmit()) {
483 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
485 if (!
sizeof($templates)) {
486 $this->ctrl->redirect($this,
"returnToParent");
490 if (
$form->checkInput()) {
491 $prtt =
$form->getInput(
"prtt");
492 if ($prtt > 0 && array_key_exists($prtt, $templates)) {
493 $title = $this->exercise->getTitle() .
" - " . $this->assignment->getTitle();
494 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"exc_id", $this->exercise->getRefId());
495 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"ass_id", $this->assignment->getId());
496 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"pt",
$title);
497 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"prtt", $prtt);
498 $this->ctrl->setParameterByClass(
"ilobjportfoliogui",
"exc_back_ref_id", (
int)
$_GET[
"ref_id"]);
499 $this->ctrl->redirectByClass(array(
"ilPersonalDesktopGUI",
"ilPortfolioRepositoryGUI",
"ilObjPortfolioGUI"),
"createPortfolioFromTemplate");
506 $form->setValuesByPost();
512 if (!$this->submission->canSubmit()) {
517 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
519 $portfolio->setTitle($this->exercise->getTitle() .
" - " . $this->assignment->getTitle());
520 $portfolio->create();
522 $this->submission->deleteAllFiles();
525 $this->submission->addResourceObject($portfolio->getId());
527 ilUtil::sendSuccess($this->lng->txt(
"exc_portfolio_created"),
true);
533 if (!$this->submission->canSubmit()) {
539 $this->submission->deleteAllFiles();
542 $this->submission->addResourceObject(
$_POST[
"item"]);
544 ilUtil::sendSuccess($this->lng->txt(
"exc_portfolio_selected"),
true);
545 $this->ctrl->setParameter($this,
"prtf_id",
$_POST[
"item"]);
546 $this->ctrl->redirect($this,
"askDirectSubmission");
557 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
559 $conf->setFormAction($this->ctrl->getFormAction($this,
"unlinkPortfolio"));
560 $conf->setHeaderText($this->lng->txt(
"exc_sure_unlink_portfolio",
"sure_unlink_portfolio"));
561 $conf->setConfirm($this->lng->txt(
"confirm"),
"unlinkPortfolio");
562 $conf->setCancel($this->lng->txt(
"cancel"),
"returnToParent");
564 $submission = $this->submission->getSelectedObject();
565 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
570 $tpl->setContent($conf->getHTML());
577 $user = $DIC->user();
579 $portfolio = $this->submission->getSelectedObject();
580 $port_id = $portfolio[
"returned_id"];
585 ilUtil::sendSuccess($this->lng->txt(
"exc_portfolio_unlinked_from_assignment"),
true);
587 $this->ctrl->redirect($this,
"returnToParent");
598 if (!$this->submission->canSubmit()) {
603 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
606 if ($_REQUEST[
"blog_id"]) {
607 $this->ctrl->setParameter($this,
"blog_id", $_REQUEST[
"blog_id"]);
608 $txt = $this->lng->txt(
"exc_direct_submit_blog");
610 $this->ctrl->setParameter($this,
"prtf_id", $_REQUEST[
"prtf_id"]);
611 $txt = $this->lng->txt(
"exc_direct_submit_portfolio");
613 $conf->setFormAction($this->ctrl->getFormAction($this,
"directSubmit"));
615 $conf->setHeaderText(
$txt);
616 $conf->setConfirm($this->lng->txt(
"exc_direct_submit"),
"directSubmit");
617 $conf->setCancel($this->lng->txt(
"exc_direct_no_submit"),
"returnToParent");
619 $tpl->setContent($conf->getHTML());
624 if (!$this->submission->canSubmit()) {
632 if ($_REQUEST[
"blog_id"]) {
634 $this->ctrl->setParameter($this,
"blog_id",
"");
637 elseif ($_REQUEST[
"prtf_id"]) {
639 $this->ctrl->setParameter($this,
"prtf_id",
"");
643 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
647 $this->ctrl->redirect($this,
"returnToParent");
658 if (!$this->submission->canSubmit()) {
662 $blog_id = $a_blog_id;
664 include_once
"Modules/Blog/classes/class.ilObjBlogGUI.php";
666 if ($blog_gui->object) {
667 $file = $blog_gui->buildExportFile();
668 $size = filesize($file);
670 $this->submission->deleteAllFiles();
677 $this->submission->uploadFile($meta,
true);
694 if (!$this->submission->canSubmit()) {
698 $prtf_id = $a_portfolio_id;
700 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
702 if ($prtf->getTitle()) {
703 include_once
"Modules/Portfolio/classes/class.ilPortfolioHTMLExport.php";
705 $file = $export->buildExportFile();
706 $size = filesize($file);
708 $this->submission->deleteAllFiles();
715 $this->submission->uploadFile($meta,
true);
734 include_once
"Modules/Exercise/classes/class.ilObjExercise.php";
735 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
736 include_once
"Modules/Exercise/classes/class.ilExSubmission.php";
740 $exc_id = $ass->getExerciseId();
746 return new self($exc, $sub);
This class represents an option in a radio group.
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
askDirectSubmissionObject()
submitBlog($a_blog_id)
Submit blog for assignment.
createTreeForUser($a_user_id)
Create personal workspace tree for user.
Portfolio HTML exporter class.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
renderWorkspaceExplorer($a_cmd)
static getPortfoliosOfUser($a_user_id)
Get views of user.
Exercise submission base gui.
if(!array_key_exists('StateId', $_REQUEST)) $id
setSelectedPortfolioObject()
askUnlinkPortfolioObject()
Access handler for personal workspace.
createPortfolioTemplateObject(ilPropertyFormGUI $a_form=null)
static getOverviewContentPortfolio(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
submitPortfolio($a_portfolio_id)
Submit portfolio for assignment.
static _getAllReferences($a_id)
get all reference ids of object
Tree handler for personal workspace.
setTypeWhiteList($a_val)
Set type white list.
static _lookupObjectId($a_ref_id)
lookup object id
static initGUIForSubmit($a_ass_id, $a_user_id=null)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getOverviewContentBlog(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
handleNewUpload($a_no_notifications=false)
if(isset($_POST['submit'])) $form
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
Explorer for selecting a personal workspace item.
static getAvailablePortfolioTemplates($a_permission="read")
setSelectedPortfolioTemplateObject()
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getInstance()
Get instance.
addProperty($a_name, $a_value, $a_link="")
add a property to current section
deleteResourceObject($a_returned_id)
Remove personal resource to assigment.
createPortfolioFromAssignmentObject()
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
initPortfolioTemplateForm(array $a_templates)
Object-based submissions (ends up as static file)
renderResourceSelection($a_title, $a_info, $a_cmd, $a_explorer_cmd, array $a_items=null)
executeCommand()
Execute command.
Confirmation screen class.