18 if(!$this->submission->canView())
23 $class = $ilCtrl->getNextClass($this);
24 $cmd = $ilCtrl->getCmd();
29 $this->{
$cmd.
"Object"}();
39 return self::getOverviewContentBlog($a_info, $a_submission);
42 return self::getOverviewContentPortfolio($a_info, $a_submission);
50 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
54 if(!$wsp_tree->getRootId())
64 $blog_id = (int)$selected_blog[
"filetitle"];
65 $node = $wsp_tree->getNodeData($blog_id);
69 $ilCtrl->setParameterByClass(
"ilobjbloggui",
"wsp_id", $blog_id);
70 $blog_link = $ilCtrl->getLinkTargetByClass(
array(
"ilpersonaldesktopgui",
"ilpersonalworkspacegui",
"ilobjbloggui"),
"");
71 $ilCtrl->setParameterByClass(
"ilobjbloggui",
"wsp_id",
"");
72 $files_str =
'<a href="'.$blog_link.
'">'.
73 $node[
"title"].
'</a>';
77 else if(substr($selected_blog[
"filename"], -1) ==
"/")
88 $button->setCaption(
"exc_create_blog");
89 $button->setUrl($ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionObjectGUI"),
"createBlog"));
90 $files_str.= $button->render();
93 $blogs =
sizeof($wsp_tree->getObjectsFromType(
"blog"));
94 if((!$valid_blog && $blogs)
95 || ($valid_blog && $blogs > 1))
98 $button->setCaption(
"exc_select_blog".($valid_blog ?
"_change" :
""));
99 $button->setUrl($ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionObjectGUI"),
"selectBlog"));
100 $files_str.=
" ".$button->render();
105 $a_info->
addProperty($lng->txt(
"exc_blog_returned"), $files_str);
109 $ilCtrl->setParameterByClass(
"ilExSubmissionFileGUI",
"delivered", $selected_blog[
"returned_id"]);
110 $dl_link = $ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionFileGUI"),
"download");
111 $ilCtrl->setParameterByClass(
"ilExSubmissionFileGUI",
"delivered",
"");
114 $button->setCaption(
"download");
115 $button->setUrl($dl_link);
117 $a_info->
addProperty($lng->txt(
"exc_files_returned"), $button->render());
125 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
132 $portfolio_id = (int)$selected_prtf[
"filetitle"];
138 if($portfolio->getTitle())
141 $ilCtrl->setParameterByClass(
"ilobjportfoliogui",
"prt_id", $portfolio_id);
142 $prtf_link = $ilCtrl->getLinkTargetByClass(
array(
"ilpersonaldesktopgui",
"ilportfoliorepositorygui",
"ilobjportfoliogui"),
"view");
143 $ilCtrl->setParameterByClass(
"ilobjportfoliogui",
"prt_id",
"");
145 $files_str =
'<a href="'.$prtf_link.
146 '">'.$portfolio->getTitle().
'</a>';
151 else if(substr($selected_prtf[
"filename"], -1) ==
"/")
162 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
168 $button->setCaption(
"exc_create_portfolio");
169 $button->setUrl($ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionObjectGUI"),
"createPortfolio".$has_prtt));
170 $files_str .= $button->render();
174 if((!$valid_prtf && $prtfs)
175 || ($valid_prtf && $prtfs > 1))
178 $button->setCaption(
"exc_select_portfolio".($valid_prtf ?
"_change" :
""));
179 $button->setUrl($ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionObjectGUI"),
"selectPortfolio"));
180 $files_str.=
" ".$button->render();
185 $a_info->
addProperty($lng->txt(
"exc_portfolio_returned"), $files_str);
189 $ilCtrl->setParameterByClass(
"ilExSubmissionFileGUI",
"delivered", $selected_prtf[
"returned_id"]);
190 $dl_link =$ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionFileGUI"),
"download");
191 $ilCtrl->setParameterByClass(
"ilExSubmissionFileGUI",
"delivered",
"");
194 $button->setCaption(
"download");
195 $button->setUrl($dl_link);
197 $a_info->
addProperty($lng->txt(
"exc_files_returned"), $button->render());
203 if(!$this->submission->canSubmit())
209 $tpl =
new ilTemplate(
"tpl.exc_select_resource.html",
true,
true,
"Modules/Exercise");
211 if(is_array($a_items))
213 $tpl->setCurrentBlock(
"item");
214 foreach($a_items as $item_id => $item_title)
216 $tpl->setVariable(
"ITEM_ID", $item_id);
217 $tpl->setVariable(
"ITEM_TITLE", $item_title);
218 $tpl->parseCurrentBlock();
221 else if($a_explorer_cmd)
226 $tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
227 $tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
228 $tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
229 $tpl->setVariable(
"CMD_SUBMIT", $a_cmd);
230 $tpl->setVariable(
"CMD_CANCEL",
"returnToParent");
234 $title = $this->lng->txt($a_title).
": ".$this->assignment->getTitle();
236 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
238 $panel->setBody(
$tpl->get());
239 $panel->setHeading($title);
241 $this->tpl->setContent($panel->getHTML());
255 "exc_create_blog_select_info",
267 "exc_select_blog_info",
275 if (!$this->submission->canSubmit())
287 $parent_node =
$_POST[
"node"];
289 include_once
"Modules/Blog/classes/class.ilObjBlog.php";
290 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
291 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
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);
315 if (!$this->submission->canSubmit())
323 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
326 if($node && $node[
"type"] ==
"blog")
328 $this->submission->deleteAllFiles();
331 $this->submission->addResourceObject($node[
"wsp_id"]);
334 $this->ctrl->setParameter($this,
"blog_id", $node[
"wsp_id"]);
335 $this->ctrl->redirect($this,
"askDirectSubmission");
345 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
346 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
347 require_once
'Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php';
352 'exc_wspexpand', $tree, $access_handler);
353 $exp->setTargetGet(
'wsp_id');
355 if($a_cmd ==
"selectBlog")
357 $exp->removeAllFormItemTypes();
358 $exp->addFilter(
'blog');
359 $exp->addFormItemForType(
'blog');
362 if(
$_GET[
'exc_wspexpand'] ==
'')
365 $expanded = $tree->readRootId();
369 $expanded =
$_GET[
'exc_wspexpand'];
372 $exp->setExpandTarget($this->ctrl->getLinkTarget($this, $a_cmd));
373 $exp->setPostVar(
'node');
374 $exp->setExpand($expanded);
377 return $exp->getOutput();
390 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
394 foreach($portfolios as $portfolio)
396 $items[$portfolio[
"id"]]= $portfolio[
"title"];
401 "exc_select_portfolio",
402 "exc_select_portfolio_info",
403 "setSelectedPortfolio",
411 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
413 $form->setTitle($this->lng->txt(
"exc_create_portfolio").
": ".$this->assignment->getTitle());
414 $form->setFormAction($this->ctrl->getFormAction($this,
"setSelectedPortfolioTemplate"));
418 $prtt->addOption(
new ilRadioOption($this->lng->txt(
"exc_create_portfolio_no_template"), -1));
419 foreach($a_templates as $id =>
$title)
424 $form->addItem($prtt);
426 $form->addCommandButton(
"setSelectedPortfolioTemplate", $this->lng->txt(
"save"));
427 $form->addCommandButton(
"returnToParent", $this->lng->txt(
"cancel"));
434 if (!$this->submission->canSubmit())
440 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
442 if(!
sizeof($templates))
452 $this->tpl->setContent($a_form->getHTML());
457 if (!$this->submission->canSubmit())
463 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
465 if(!
sizeof($templates))
467 $this->ctrl->redirect($this,
"returnToParent");
471 if($form->checkInput())
473 $prtt = $form->getInput(
"prtt");
474 if($prtt > 0 && array_key_exists($prtt, $templates))
476 $title = $this->exercise->getTitle().
" - ".$this->assignment->getTitle();
477 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"exc_id", $this->exercise->getRefId());
478 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"ass_id", $this->assignment->getId());
479 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"pt",
$title);
480 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"prtt", $prtt);
481 $this->ctrl->redirectByClass(
array(
"ilPersonalDesktopGUI",
"ilPortfolioRepositoryGUI",
"ilObjPortfolioGUI"),
"createPortfolioFromTemplate");
490 $form->setValuesByPost();
496 if (!$this->submission->canSubmit())
502 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
504 $portfolio->setTitle($this->exercise->getTitle().
" - ".$this->assignment->getTitle());
505 $portfolio->create();
507 $this->submission->deleteAllFiles();
510 $this->submission->addResourceObject($portfolio->getId());
518 if (!$this->submission->canSubmit())
526 $this->submission->deleteAllFiles();
529 $this->submission->addResourceObject(
$_POST[
"item"]);
532 $this->ctrl->setParameter($this,
"prtf_id",
$_POST[
"item"]);
533 $this->ctrl->redirect($this,
"askDirectSubmission");
549 if (!$this->submission->canSubmit())
555 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
558 if($_REQUEST[
"blog_id"])
560 $this->ctrl->setParameter($this,
"blog_id", $_REQUEST[
"blog_id"]);
561 $txt = $this->lng->txt(
"exc_direct_submit_blog");
565 $this->ctrl->setParameter($this,
"prtf_id", $_REQUEST[
"prtf_id"]);
566 $txt = $this->lng->txt(
"exc_direct_submit_portfolio");
568 $conf->setFormAction($this->ctrl->getFormAction($this,
"directSubmit"));
570 $conf->setHeaderText(
$txt);
571 $conf->setConfirm($this->lng->txt(
"exc_direct_submit"),
"directSubmit");
572 $conf->setCancel($this->lng->txt(
"cancel"),
"returnToParent");
574 $tpl->setContent($conf->getHTML());
579 if (!$this->submission->canSubmit())
588 if($_REQUEST[
"blog_id"])
591 $this->ctrl->setParameter($this,
"blog_id",
"");
594 else if($_REQUEST[
"prtf_id"])
597 $this->ctrl->setParameter($this,
"prtf_id",
"");
608 $this->ctrl->redirect($this,
"returnToParent");
619 if(!$this->submission->canSubmit())
624 $blog_id = $a_blog_id;
626 include_once
"Modules/Blog/classes/class.ilObjBlogGUI.php";
628 if($blog_gui->object)
630 $file = $blog_gui->buildExportFile();
634 $this->submission->deleteAllFiles();
641 $this->submission->uploadFile($meta,
true);
658 if(!$this->submission->canSubmit())
663 $prtf_id = $a_portfolio_id;
665 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
667 if($prtf->getTitle())
669 include_once
"Modules/Portfolio/classes/class.ilPortfolioHTMLExport.php";
671 $file = $export->buildExportFile();
675 $this->submission->deleteAllFiles();
682 $this->submission->uploadFile($meta,
true);
697 $a_user_id = $ilUser->getId();
700 include_once
"Modules/Exercise/classes/class.ilObjExercise.php";
701 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
702 include_once
"Modules/Exercise/classes/class.ilExSubmission.php";
706 $exc_id = $ass->getExerciseId();
712 return new self($exc, $sub);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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.
setSelectedPortfolioObject()
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.
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)
getNodeData($a_node_id, $a_tree_pk=null)
get all information of a node.
special template class to simplify handling of ITX/PEAR
static getAvailablePortfolioTemplates($a_permission="read")
insertObject($a_parent_node_id, $a_object_id)
Add object to tree.
Create styles array
The data for the language used.
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.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
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)
Confirmation screen class.