2 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
31 $tpl =
new ilTemplate(
"tpl.assignment_head.html",
true,
true,
"Modules/Exercise");
33 if ($a_data[
"deadline"] - time() <= 0)
35 $tpl->setCurrentBlock(
"prop");
36 $tpl->setVariable(
"PROP", $lng->txt(
"exc_ended_on"));
37 $tpl->setVariable(
"PROP_VAL",
39 $tpl->parseCurrentBlock();
41 else if ($a_data[
"start_time"] > 0 && time() - $a_data[
"start_time"] <= 0)
43 $tpl->setCurrentBlock(
"prop");
44 $tpl->setVariable(
"PROP", $lng->txt(
"exc_starting_on"));
45 $tpl->setVariable(
"PROP_VAL",
47 $tpl->parseCurrentBlock();
52 $tpl->setCurrentBlock(
"prop");
53 $tpl->setVariable(
"PROP", $lng->txt(
"exc_time_to_send"));
54 $tpl->setVariable(
"PROP_VAL", $time_str);
55 $tpl->parseCurrentBlock();
57 $tpl->setCurrentBlock(
"prop");
58 $tpl->setVariable(
"PROP", $lng->txt(
"exc_edit_until"));
59 $tpl->setVariable(
"PROP_VAL",
61 $tpl->parseCurrentBlock();
66 if ($a_data[
"mandatory"])
68 $mand =
" (".$lng->txt(
"exc_mandatory").
")";
70 $tpl->setVariable(
"TITLE", $a_data[
"title"].$mand);
77 case "passed": $pic =
"scorm/passed.gif";
break;
78 case "failed": $pic =
"scorm/failed.gif";
break;
79 default: $pic =
"scorm/not_attempted.gif";
break;
82 $tpl->setVariable(
"ALT_STATUS", $lng->txt(
"exc_".$stat));
94 $tpl =
new ilTemplate(
"tpl.assignment_body.html",
true,
true,
"Modules/Exercise");
96 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
97 if(IS_PAYMENT_ENABLED)
99 include_once
'./Services/Payment/classes/class.ilPaymentObject.php';
103 $info->setTableClass(
"");
105 $not_started_yet =
false;
106 if ($a_data[
"start_time"] > 0 && time() - $a_data[
"start_time"] <= 0)
108 $not_started_yet =
true;
111 if (!$not_started_yet)
114 $info->addSection($lng->txt(
"exc_instruction"));
115 $info->addProperty(
"",
120 $info->addSection($lng->txt(
"exc_schedule"));
121 if ($a_data[
"start_time"] > 0)
123 $info->addProperty($lng->txt(
"exc_start_time"),
126 $info->addProperty($lng->txt(
"exc_edit_until"),
129 if (!$not_started_yet)
131 $info->addProperty($lng->txt(
"exc_time_to_send"),
132 "<b>".$time_str.
"</b>");
136 if ($this->exc->getShowSubmissions())
138 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id", $a_data[
"id"]);
139 if ($a_data[
"deadline"] - time() <= 0)
141 $link =
'<a class="submit" href="'.
142 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"listPublicSubmissions").
'">'.
143 $lng->txt(
"exc_list_submission").
'</a>';
144 $info->addProperty($lng->txt(
"exc_public_submission"), $link);
148 $info->addProperty($lng->txt(
"exc_public_submission"),
149 $lng->txt(
"exc_msg_public_submission"));
151 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id",
$_GET[
"ass_id"]);
154 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id", $a_data[
"id"]);
156 if (!$not_started_yet)
162 $info->addSection($lng->txt(
"exc_files"));
169 $info->addProperty($file[
"name"],
171 $ilCtrl->getLinkTargetByClass(
"ilShopPurchaseGUI",
"showDetails"));
175 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"file", urlencode($file[
"name"]));
176 $info->addProperty($file[
"name"],
177 $lng->txt(
"download"),
178 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"downloadFile"));
179 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"file",
"");
187 if(IS_PAYMENT_ENABLED
191 $info->addSection($lng->txt(
"exc_your_submission"));
193 $ilCtrl->clearParameters($this);
195 $ilCtrl->setParameter($this,
"ref_id",
$_GET[
'ref_id']);
196 $ilCtrl->setParameter($this,
'subtype',
'upload');
197 $info->addProperty($lng->txt(
'exc_hand_in'),
199 $ilCtrl->getLinkTargetByClass(
"ilShopPurchaseGUI",
"showDetails"));
203 $info->addSection($lng->txt(
"exc_your_submission"));
208 if($a_data[
"deadline"] - time() < 0)
213 switch($a_data[
"type"])
217 foreach($delivered_files as
$file)
219 $titles[] = $file[
"filetitle"];
221 $files_str = implode($titles,
", ");
222 if ($files_str ==
"")
224 $files_str = $lng->txt(
"message_no_delivered_files");
227 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id", $a_data[
"id"]);
231 $files_str.=
' <a class="submit" href="'.
232 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"submissionScreen").
'">'.
234 ? $lng->txt(
"exc_hand_in")
235 : $lng->txt(
"exc_edit_submission")).
'</a>';
239 if (count($titles) > 0)
241 $files_str.=
' <a class="submit" href="'.
242 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"submissionScreen").
'">'.
243 $lng->txt(
"already_delivered_files").
'</a>';
247 $info->addProperty($lng->txt(
"exc_files_returned"),
254 if(
sizeof($delivered_files))
256 $delivered_files = array_pop($delivered_files);
257 $blog_id = (int)$delivered_files[
"filetitle"];
259 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
260 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
267 $files_str =
'<a href="'.$blog_link.
'">'.
268 $node[
"title"].
'</a>';
276 $files_str .=
'<a class="submit" href="'.
277 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"createBlog").
'">'.
278 $lng->txt(
"exc_create_blog").
'</a>';
280 $files_str .=
' <a class="submit" href="'.
281 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"selectBlog").
'">'.
282 $lng->txt(
"exc_select_blog".($valid_blog ?
"_change" :
"")).
'</a>';
286 $info->addProperty($lng->txt(
"exc_blog_returned"), $files_str);
288 if($delivered_files && substr($delivered_files[
"filename"], -1) !=
"/")
290 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"delivered", $delivered_files[
"returned_id"]);
291 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"download");
292 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"delivered",
"");
294 $info->addProperty($lng->txt(
"exc_files_returned"),
295 "<a href=\"".$dl_link.
"\">".$lng->txt(
"download").
"</a>");
302 if(
sizeof($delivered_files))
304 $delivered_files = array_pop($delivered_files);
305 $portfolio_id = (int)$delivered_files[
"filetitle"];
310 include_once
"Services/Portfolio/classes/class.ilObjPortfolio.php";
311 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
314 if($portfolio->getTitle())
316 $files_str =
'<a href="'.ilWorkspaceAccessHandler::getGotoLink($portfolio_id, $portfolio_id).
317 '">'.$portfolio->getTitle().
'</a>';
326 $files_str .=
'<a class="submit" href="'.
327 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"createPortfolio").
'">'.
328 $lng->txt(
"exc_create_portfolio").
'</a>';
330 $files_str .=
' <a class="submit" href="'.
331 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"selectPortfolio").
'">'.
332 $lng->txt(
"exc_select_portfolio".($valid_prtf ?
"_change" :
"")).
'</a>';
336 $info->addProperty($lng->txt(
"exc_portfolio_returned"), $files_str);
338 if($delivered_files && substr($delivered_files[
"filename"], -1) !=
"/")
340 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"delivered", $delivered_files[
"returned_id"]);
341 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"download");
342 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"delivered",
"");
344 $info->addProperty($lng->txt(
"exc_files_returned"),
345 "<a href=\"".$dl_link.
"\">".$lng->txt(
"download").
"</a>");
361 if ($last_sub !=
"---")
363 $info->addProperty($lng->txt(
"exc_last_submission"),
369 $cnt_files = $storage->countFeedbackFiles($ilUser->getId());
373 if ($lpcomment !=
"" || $mark !=
"" || $status !=
"notgraded" || $cnt_files > 0)
375 $info->addSection($lng->txt(
"exc_feedback_from_tutor"));
376 if ($lpcomment !=
"")
378 $info->addProperty($lng->txt(
"exc_comment"),
383 $info->addProperty($lng->txt(
"exc_mark"),
392 else if ($status !=
"notgraded")
394 $img =
'<img border="0" src="'.ilUtil::getImagePath(
"scorm/".$status.
".gif").
'" '.
395 ' alt="'.$lng->txt(
"exc_".$status).
'" title="'.$lng->txt(
"exc_".$status).
396 '" style="vertical-align:middle;"/>';
397 $info->addProperty($lng->txt(
"status"),
398 $img.
" ".$lng->txt(
"exc_".$status));
403 $info->addSection($lng->txt(
"exc_fb_files"));
404 $files = $storage->getFeedbackFiles($ilUser->getId());
407 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"file", urlencode($file));
408 $info->addProperty($file,
409 $lng->txt(
"download"),
410 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"downloadFeedbackFile"));
411 $ilCtrl->setParameter($this,
"file",
"");
418 $tpl->setVariable(
"CONTENT", $info->getHTML());
430 if ($a_deadline - time() <= 0)
432 $time_str = $lng->txt(
"exc_time_over_short");
437 if (isset($time_diff[
'days']))
439 unset($time_diff[
'minutes']);
441 if (isset($time_diff[
'months']))
443 unset($time_diff[
'hours']);
445 if (isset($time_diff[
'minutes']))
447 unset($time_diff[
'seconds']);