5 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
6 include_once
"Modules/Exercise/classes/class.ilExSubmission.php";
25 $this->user_id = $a_user_id;
26 $this->obj_id = $a_obj_id;
27 $this->ass_id = (int)
$_GET[
"ass"];
38 $this->ctrl->returnToParent($this);
41 $next_class = $ilCtrl->getNextClass($this);
42 $cmd = $ilCtrl->getCmd();
54 public static function checkExercise($a_user_id, $a_obj_id, $a_add_submit =
false)
68 foreach($exercises as $exercise)
74 if(!$tree->isSaved($ref_id))
82 $part = self::getExerciseInfo($a_user_id, $exercise[
"ass_id"], $a_add_submit);
91 return implode(
"<br />",
$info);
96 protected static function getExerciseInfo($a_user_id, $a_assignment_id, $a_add_submit =
false)
100 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
102 $exercise_id = $ass->getExerciseId();
109 $times_up = $ass->afterDeadlineStrict();
112 include_once
"./Services/Link/classes/class.ilLink.php";
116 $info = sprintf($lng->txt(
"prtf_exercise_info"),
118 "<a href=\"".$exc_link.
"\">".
122 if($a_add_submit && !$times_up)
124 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass", $a_assignment_id);
125 $submit_link = $ilCtrl->getLinkTargetByClass(
"ilportfolioexercisegui",
"finalize");
126 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass",
"");
128 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
130 $button->setCaption(
"prtf_finalize_portfolio");
131 $button->setPrimary(
true);
132 $button->setUrl($submit_link);
133 $info .=
" ".$button->render();
137 include_once
"Modules/Exercise/classes/class.ilExSubmission.php";
139 if($submission->hasSubmitted())
142 $submitted = $submission->getSelectedObject();
144 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass", $a_assignment_id);
145 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilportfolioexercisegui",
"downloadExcSubFile");
146 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass",
"");
151 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
153 $button->setCaption(
"download");
154 $button->setUrl($dl_link);
156 $info .=
"<br />".sprintf($lng->txt(
"prtf_exercise_submitted_info"),
168 $inst = $ass->getInstruction();
171 $tooltip .= nl2br($inst);
174 $ass_files = $ass->getFiles();
175 if (count($ass_files) > 0)
179 $tooltip .=
"<br /><br />";
182 foreach($ass_files as
$file)
184 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass", $a_assignment_id);
185 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"file", urlencode($file[
"name"]));
186 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilportfolioexercisegui",
"downloadExcAssFile");
187 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"file",
"");
188 $ilCtrl->setParameterByClass(
"ilportfolioexercisegui",
"ass",
"");
190 $tooltip .= $file[
"name"].
": <a href=\"".$dl_link.
"\">".
191 $lng->txt(
"download").
"</a>";
197 $ol_id =
"exc_ass_".$a_assignment_id;
199 include_once
"Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
203 $overlay->setAnchor($ol_id.
"_tr");
204 $overlay->setTrigger($ol_id.
"_tr",
"click", $ol_id.
"_tr");
205 $overlay->setAutoHide(
false);
210 $overlay->addTrigger($ol_id.
"_tr",
"click", $ol_id.
"_tr");
212 $info .=
"<div id=\"".$ol_id.
"_tr\"><a href=\"#\">".$lng->txt(
"exc_instruction").
"</a></div>".
213 "<div id=\"".$ol_id.
"\" style=\"display:none; background-color:white; border: 1px solid #bbb; padding: 10px;\">".$tooltip.
"</div>";
223 include_once
"Modules/Exercise/classes/class.ilExAssignment.php";
225 $ass_files = $ass->getFiles();
226 if (count($ass_files) > 0)
228 foreach($ass_files as
$file)
230 if($file[
"name"] == $this->
file)
243 $submitted = $submission->getFiles();
244 if (count($submitted) > 0)
246 $submitted = array_pop($submitted);
250 $ass->getTitle().
" - ".
251 $user_data[
"firstname"].
" ".
252 $user_data[
"lastname"].
" (".
253 $user_data[
"login"].
").zip";
266 include_once
"Modules/Exercise/classes/class.ilExSubmissionBaseGUI.php";
267 include_once
"Modules/Exercise/classes/class.ilExSubmissionObjectGUI.php";
269 $exc_gui->submitPortfolio($this->obj_id);
272 $ilCtrl->returnToParent($this);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupName($a_user_id)
lookup user name
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static getExerciseInfo($a_user_id, $a_assignment_id, $a_add_submit=false)
static setUseRelativeDates($a_status)
set use relative dates
static _lookupTitle($a_id)
lookup object title
Class ilPortfolioExerciseGUI.
static _getAllReferences($a_id)
get all reference ids of object
static useRelativeDates()
check if relative dates are used
static initGUIForSubmit($a_ass_id, $a_user_id=null)
This is a utility class for the yui overlays.
static formatDate(ilDateTime $date)
Format a date public.
Reload workbook from saved file
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
Create styles array
The data for the language used.
static findUserFiles($a_user_id, $a_filetitle)
Check if given file was assigned.
static checkExercise($a_user_id, $a_obj_id, $a_add_submit=false)
finalize()
Finalize and submit portfolio to exercise.
__construct($a_user_id, $a_obj_id)