ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilExAssignmentGUI.php
Go to the documentation of this file.
1 <?php
2 include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
13 {
14 
18  function __construct($a_exc)
19  {
20  $this->exc = $a_exc;
21  }
22 
23 
27  function getOverviewHeader($a_data)
28  {
29  global $lng, $ilUser;
30 
31  $lng->loadLanguageModule("exc");
32 
33  $tpl = new ilTemplate("tpl.assignment_head.html", true, true, "Modules/Exercise");
34 
35  if (($a_data["deadline"] > 0) && $a_data["deadline"] - time() <= 0)
36  {
37  $tpl->setCurrentBlock("prop");
38  $tpl->setVariable("PROP", $lng->txt("exc_ended_on"));
39  $tpl->setVariable("PROP_VAL",
40  ilDatePresentation::formatDate(new ilDateTime($a_data["deadline"],IL_CAL_UNIX)));
41  $tpl->parseCurrentBlock();
42 
43  // #14077
44  if($a_data["peer"] && $a_data["peer_dl"])
45  {
46  $tpl->setCurrentBlock("prop");
47  $tpl->setVariable("PROP", $lng->txt("exc_peer_review_deadline"));
48  $tpl->setVariable("PROP_VAL",
49  ilDatePresentation::formatDate(new ilDateTime($a_data["peer_dl"],IL_CAL_UNIX)));
50  $tpl->parseCurrentBlock();
51  }
52  }
53  else if ($a_data["start_time"] > 0 && time() - $a_data["start_time"] <= 0)
54  {
55  $tpl->setCurrentBlock("prop");
56  $tpl->setVariable("PROP", $lng->txt("exc_starting_on"));
57  $tpl->setVariable("PROP_VAL",
58  ilDatePresentation::formatDate(new ilDateTime($a_data["start_time"],IL_CAL_UNIX)));
59  $tpl->parseCurrentBlock();
60  }
61  else
62  {
63  $time_str = $this->getTimeString($a_data["deadline"]);
64  $tpl->setCurrentBlock("prop");
65  $tpl->setVariable("PROP", $lng->txt("exc_time_to_send"));
66  $tpl->setVariable("PROP_VAL", $time_str);
67  $tpl->parseCurrentBlock();
68 
69  if ($a_data["deadline"] > 0)
70  {
71  $tpl->setCurrentBlock("prop");
72  $tpl->setVariable("PROP", $lng->txt("exc_edit_until"));
73  $tpl->setVariable("PROP_VAL",
74  ilDatePresentation::formatDate(new ilDateTime($a_data["deadline"],IL_CAL_UNIX)));
75  $tpl->parseCurrentBlock();
76  }
77 
78  }
79 
80  $mand = "";
81  if ($a_data["mandatory"])
82  {
83  $mand = " (".$lng->txt("exc_mandatory").")";
84  }
85  $tpl->setVariable("TITLE", $a_data["title"].$mand);
86 
87  // status icon
88  $stat = ilExAssignment::lookupStatusOfUser($a_data["id"], $ilUser->getId());
89  switch ($stat)
90  {
91  case "passed": $pic = "scorm/passed.svg"; break;
92  case "failed": $pic = "scorm/failed.svg"; break;
93  default: $pic = "scorm/not_attempted.svg"; break;
94  }
95  $tpl->setVariable("IMG_STATUS", ilUtil::getImagePath($pic));
96  $tpl->setVariable("ALT_STATUS", $lng->txt("exc_".$stat));
97 
98  return $tpl->get();
99  }
100 
104  function getOverviewBody($a_data)
105  {
106  global $lng, $ilCtrl, $ilUser;
107 
108  $tpl = new ilTemplate("tpl.assignment_body.html", true, true, "Modules/Exercise");
109 
110  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
111  include_once("./Services/UIComponent/Button/classes/class.ilLinkButton.php");
112 
113  if(IS_PAYMENT_ENABLED)
114  {
115  include_once './Services/Payment/classes/class.ilPaymentObject.php';
116  }
117 
118  $info = new ilInfoScreenGUI(null);
119  $info->setTableClass("");
120 
121  $not_started_yet = false;
122  if ($a_data["start_time"] > 0 && time() - $a_data["start_time"] <= 0)
123  {
124  $not_started_yet = true;
125  }
126 
127  if (!$not_started_yet)
128  {
129  // instructions
130  $info->addSection($lng->txt("exc_instruction"));
131 
132  $is_html = (strlen($a_data["instruction"]) != strlen(strip_tags($a_data["instruction"])));
133  if(!$is_html)
134  {
135  $a_data["instruction"] = nl2br(ilUtil::makeClickable($a_data["instruction"], true));
136  }
137  $info->addProperty("", $a_data["instruction"]);
138  }
139 
140  // schedule
141  $info->addSection($lng->txt("exc_schedule"));
142  if ($a_data["start_time"] > 0)
143  {
144  $info->addProperty($lng->txt("exc_start_time"),
145  ilDatePresentation::formatDate(new ilDateTime($a_data["start_time"],IL_CAL_UNIX)));
146  }
147  if ($a_data["deadline"] > 0)
148  {
149  $info->addProperty($lng->txt("exc_edit_until"),
150  ilDatePresentation::formatDate(new ilDateTime($a_data["deadline"],IL_CAL_UNIX)));
151  }
152  $time_str = $this->getTimeString($a_data["deadline"]);
153  if (!$not_started_yet)
154  {
155  $info->addProperty($lng->txt("exc_time_to_send"),
156  "<b>".$time_str."</b>");
157  }
158 
159  // public submissions
160  if ($this->exc->getShowSubmissions())
161  {
162  $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
163  if ($a_data["deadline"] - time() <= 0)
164  {
165  $button = ilLinkButton::getInstance();
166  $button->setCaption("exc_list_submission");
167  $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "listPublicSubmissions"));
168 
169  $info->addProperty($lng->txt("exc_public_submission"), $button->render());
170  }
171  else
172  {
173  $info->addProperty($lng->txt("exc_public_submission"),
174  $lng->txt("exc_msg_public_submission"));
175  }
176  $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $_GET["ass_id"]);
177  }
178 
179  $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
180 
181  if (!$not_started_yet)
182  {
183  // download files
184  $files = ilExAssignment::getFiles($a_data["exc_id"], $a_data["id"]);
185  if (count($files) > 0)
186  {
187  $info->addSection($lng->txt("exc_files"));
188  foreach($files as $file)
189  {
190  // if download must be purchased first show a "buy"-button
191  if(IS_PAYMENT_ENABLED && (ilPaymentObject::_isBuyable($_GET['ref_id'],'download') &&
192  !ilPaymentObject::_hasAccess($_GET['ref_id'],'','download')))
193  {
194  $info->addProperty($file["name"],
195  $lng->txt("buy"),
196  $ilCtrl->getLinkTargetByClass("ilShopPurchaseGUI", "showDetails"));
197  }
198  else
199  {
200  $ilCtrl->setParameterByClass("ilobjexercisegui", "file", urlencode($file["name"]));
201  $info->addProperty($file["name"],
202  $lng->txt("download"),
203  $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadFile"));
204  $ilCtrl->setParameterByClass("ilobjexercisegui", "file", "");
205  }
206  }
207  }
208 
209  // submission
210 
211  // if submission must be purchased first
212  if(IS_PAYMENT_ENABLED
213  && (ilPaymentObject::_isBuyable($_GET['ref_id'],'upload')
214  && !ilPaymentObject::_hasAccess($_GET['ref_id'],'','upload')))
215  {
216  $info->addSection($lng->txt("exc_your_submission"));
217 
218  $ilCtrl->clearParameters($this);
219 
220  $ilCtrl->setParameter($this, "ref_id", $_GET['ref_id']);
221  $ilCtrl->setParameter($this,'subtype','upload');
222  $info->addProperty($lng->txt('exc_hand_in'),
223  $lng->txt("buy"),
224  $ilCtrl->getLinkTargetByClass("ilShopPurchaseGUI", "showDetails"));
225  }
226  else
227  {
228  $info->addSection($lng->txt("exc_your_submission"));
229 
230  $delivered_files = ilExAssignment::getDeliveredFiles($a_data["exc_id"], $a_data["id"], $ilUser->getId());
231 
232  $times_up = false;
233  if(($a_data["deadline"] > 0) && $a_data["deadline"] - time() < 0)
234  {
235  $times_up = true;
236  }
237 
238  $team_members = null;
239  switch($a_data["type"])
240  {
242  $no_team_yet = false;
243  $team_members = ilExAssignment::getTeamMembersByAssignmentId($a_data["id"], $ilUser->getId());
244  if(sizeof($team_members))
245  {
246  $team = array();
247  foreach($team_members as $member_id)
248  {
249  $team[] = ilObjUser::_lookupFullname($member_id);
250  }
251  $team = implode(", ", $team);
252 
253  // any team member upload?
254  if(!ilExAssignment::getLastSubmission($a_data["id"], $ilUser->getId()))
255  {
256  $button = ilLinkButton::getInstance();
257  $button->setCaption("exc_delete_team");
258  $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "confirmDeleteTeam"));
259  $team .= " ".$button->render();
260  }
261 
262  $button = ilLinkButton::getInstance();
263  $button->setCaption("exc_manage_team");
264  $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreenTeam"));
265  $team .= " ".$button->render();
266 
267  $info->addProperty($lng->txt("exc_team_members"), $team);
268  }
269  else
270  {
271  $no_team_yet = true;
272 
273  if(!$times_up)
274  {
275  if(!sizeof($delivered_files))
276  {
277  $team_info = $lng->txt("exc_no_team_yet_notice");
278  }
279  else
280  {
281  $team_info = '<span class="warning">'.$lng->txt("exc_no_team_yet_notice").'</span>';
282  }
283 
284  $button = ilLinkButton::getInstance();
285  $button->setPrimary(true);
286  $button->setCaption("exc_create_team");
287  $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createTeam"));
288  $team_info .= " ".$button->render();
289 
290  $team_info .= '<div class="ilFormInfo">'.$lng->txt("exc_no_team_yet_info").'</div>';
291  }
292  else
293  {
294  $team_info = '<span class="warning">'.$lng->txt("exc_create_team_times_up_warning").'</span>';
295  }
296 
297  $info->addProperty($lng->txt("exc_team_members"), $team_info);
298  }
299  // fallthrough
300 
302  $titles = array();
303  foreach($delivered_files as $file)
304  {
305  $titles[] = $file["filetitle"];
306  }
307  $files_str = implode($titles, ", ");
308  if ($files_str == "")
309  {
310  $files_str = $lng->txt("message_no_delivered_files");
311  }
312 
313  // no team == no submission
314  if(!$no_team_yet)
315  {
316  $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
317 
318  if (!$times_up)
319  {
320  $title = (count($titles) == 0
321  ? $lng->txt("exc_hand_in")
322  : $lng->txt("exc_edit_submission"));
323 
324  $button = ilLinkButton::getInstance();
325  $button->setPrimary(true);
326  $button->setCaption($title, false);
327  $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreen"));
328  $files_str.= " ".$button->render();
329  }
330  else
331  {
332  if (count($titles) > 0)
333  {
334  $button = ilLinkButton::getInstance();
335  $button->setCaption("already_delivered_files");
336  $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "submissionScreen"));
337  $files_str.= " ".$button->render();
338  }
339  }
340  }
341 
342  $info->addProperty($lng->txt("exc_files_returned"),
343  $files_str);
344  break;
345 
347  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
348  $wsp_tree = new ilWorkspaceTree($ilUser->getId());
349 
350  // #12939
351  if(!$wsp_tree->getRootId())
352  {
353  $wsp_tree->createTreeForUser($ilUser->getId());
354  }
355 
356  $files_str = "";
357  $valid_blog = false;
358  if(sizeof($delivered_files))
359  {
360  $delivered_files = array_pop($delivered_files);
361  $blog_id = (int)$delivered_files["filetitle"];
362  $node = $wsp_tree->getNodeData($blog_id);
363  if($node["title"])
364  {
365  // #10116
366  $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", $blog_id);
367  $blog_link = $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilpersonalworkspacegui", "ilobjbloggui"), "");
368  $ilCtrl->setParameterByClass("ilobjbloggui", "wsp_id", "");
369  $files_str = '<a href="'.$blog_link.'">'.
370  $node["title"].'</a>';
371  $valid_blog = true;
372  }
373  // remove invalid resource if no upload yet (see download below)
374  else if(substr($delivered_files["filename"], -1) == "/")
375  {
376  $this->exc->deleteResourceObject($delivered_files["ass_id"],
377  $ilUser->getId(), $delivered_files["returned_id"]);
378  }
379  }
380  if(!$times_up)
381  {
382  if(!$valid_blog)
383  {
384  $button = ilLinkButton::getInstance();
385  $button->setCaption("exc_create_blog");
386  $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createBlog"));
387  $files_str.= $button->render();
388  }
389  // #10462
390  $blogs = sizeof($wsp_tree->getObjectsFromType("blog"));
391  if((!$valid_blog && $blogs)
392  || ($valid_blog && $blogs > 1))
393  {
394  $button = ilLinkButton::getInstance();
395  $button->setCaption("exc_select_blog".($valid_blog ? "_change" : ""));
396  $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "selectBlog"));
397  $files_str.= " ".$button->render();
398  }
399  }
400  if($files_str)
401  {
402  $info->addProperty($lng->txt("exc_blog_returned"), $files_str);
403  }
404  if($delivered_files && substr($delivered_files["filename"], -1) != "/")
405  {
406  $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", $delivered_files["returned_id"]);
407  $dl_link = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "download");
408  $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", "");
409 
410  $button = ilLinkButton::getInstance();
411  $button->setCaption("download");
412  $button->setUrl($dl_link);
413 
414  $info->addProperty($lng->txt("exc_files_returned"),
415  $button->render());
416  }
417  break;
418 
420  include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
421 
422  $files_str = "";
423  $valid_prtf = false;
424  if(sizeof($delivered_files))
425  {
426  $delivered_files = array_pop($delivered_files);
427  $portfolio_id = (int)$delivered_files["filetitle"];
428 
429  // #11746
430  if(ilObject::_exists($portfolio_id, false, "prtf"))
431  {
432  $portfolio = new ilObjPortfolio($portfolio_id, false);
433  if($portfolio->getTitle())
434  {
435  // #10116 / #12791
436  $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", $portfolio_id);
437  $prtf_link = $ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilportfoliorepositorygui", "ilobjportfoliogui"), "view");
438  $ilCtrl->setParameterByClass("ilobjportfoliogui", "prt_id", "");
439 
440  $files_str = '<a href="'.$prtf_link.
441  '">'.$portfolio->getTitle().'</a>';
442  $valid_prtf = true;
443  }
444  }
445  // remove invalid resource if no upload yet (see download below)
446  else if(substr($delivered_files["filename"], -1) == "/")
447  {
448  $this->exc->deleteResourceObject($delivered_files["ass_id"],
449  $ilUser->getId(), $delivered_files["returned_id"]);
450  }
451  }
452  if(!$times_up)
453  {
454  if(!$valid_prtf)
455  {
456  // if there are portfolio templates available show form first
457  include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
459  ? "Template"
460  : "";
461 
462  $button = ilLinkButton::getInstance();
463  $button->setCaption("exc_create_portfolio");
464  $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "createPortfolio".$has_prtt));
465  $files_str .= $button->render();
466  }
467  // #10462
468  $prtfs = sizeof(ilObjPortfolio::getPortfoliosOfUser($ilUser->getId()));
469  if((!$valid_prtf && $prtfs)
470  || ($valid_prtf && $prtfs > 1))
471  {
472  $button = ilLinkButton::getInstance();
473  $button->setCaption("exc_select_portfolio".($valid_prtf ? "_change" : ""));
474  $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "selectPortfolio"));
475  $files_str.= " ".$button->render();
476  }
477  }
478  if($files_str)
479  {
480  $info->addProperty($lng->txt("exc_portfolio_returned"), $files_str);
481  }
482  if($delivered_files && substr($delivered_files["filename"], -1) != "/")
483  {
484  $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", $delivered_files["returned_id"]);
485  $dl_link = $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "download");
486  $ilCtrl->setParameterByClass("ilobjexercisegui", "delivered", "");
487 
488  $button = ilLinkButton::getInstance();
489  $button->setCaption("download");
490  $button->setUrl($dl_link);
491 
492  $info->addProperty($lng->txt("exc_files_returned"),
493  $button->render());
494  }
495  break;
496 
498  $ilCtrl->setParameterByClass("ilobjexercisegui", "ass_id", $a_data["id"]);
499 
500  if(!$times_up)
501  {
502  $button = ilLinkButton::getInstance();
503  $button->setPrimary(true);
504  $button->setCaption("exc_text_assignment_edit");
505  $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "editAssignmentText"));
506  $files_str = $button->render();
507  }
508  else
509  {
510  $button = ilLinkButton::getInstance();
511  $button->setCaption("exc_text_assignment_show");
512  $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "showAssignmentText"));
513  $files_str = $button->render();
514  }
515 
516  $info->addProperty($lng->txt("exc_files_returned_text"),
517  $files_str);
518  break;
519  }
520 
521 
522  $last_sub = ilExAssignment::getLastSubmission($a_data["id"], $ilUser->getId());
523  if ($last_sub)
524  {
525  $last_sub = ilDatePresentation::formatDate(new ilDateTime($last_sub,IL_CAL_DATETIME));
526  }
527  else
528  {
529  $last_sub = "---";
530  }
531 
532  if ($last_sub != "---")
533  {
534  $info->addProperty($lng->txt("exc_last_submission"),
535  $last_sub);
536  }
537 
538 
539  // peer feedback
540  if($times_up && $a_data["peer"])
541  {
542  $nr_missing_fb = ilExAssignment::getNumberOfMissingFeedbacks($a_data["id"], $a_data["peer_min"]);
543 
544  if(!$a_data["peer_dl"] || $a_data["peer_dl"] > time())
545  {
546  $dl_info = "";
547  if($a_data["peer_dl"])
548  {
549  $dl_info = " (".sprintf($lng->txt("exc_peer_review_deadline_info_button"),
550  ilDatePresentation::formatDate(new ilDateTime($a_data["peer_dl"], IL_CAL_UNIX))).")";
551  }
552 
553  $button = ilLinkButton::getInstance();
554  $button->setPrimary($nr_missing_fb);
555  $button->setCaption($lng->txt("exc_peer_review_give").$dl_info, false);
556  $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "editPeerReview"));
557  $edit_pc = $button->render();
558  }
559  else if($a_data["peer_dl"])
560  {
561  $edit_pc = $lng->txt("exc_peer_review_deadline_reached");
562  }
563  if((!$a_data["peer_dl"] || $a_data["peer_dl"] < time()) &&
564  !$nr_missing_fb)
565  {
566  $button = ilLinkButton::getInstance();
567  $button->setCaption("exc_peer_review_show");
568  $button->setUrl($ilCtrl->getLinkTargetByClass("ilobjexercisegui", "showPersonalPeerReview"));
569  $view_pc = $button->render();
570  }
571  /*
572  else
573  {
574  $view_pc = $lng->txt("exc_peer_review_show_not_rated_yet");
575  }
576  */
577 
578  $info->addProperty($lng->txt("exc_peer_review"),
579  $edit_pc." ".$view_pc);
580  }
581 
582 
583  // feedback from tutor
584  if($a_data["type"] == ilExAssignment::TYPE_UPLOAD_TEAM)
585  {
586  $feedback_id = "t".ilExAssignment::getTeamIdByAssignment($a_data["id"], $ilUser->getId());
587  }
588  else
589  {
590  $feedback_id = $ilUser->getId();
591  }
592 
593  // global feedback / sample solution
594  if($a_data["fb_date"] == ilExAssignment::FEEDBACK_DATE_DEADLINE)
595  {
596  $show_global_feedback = ($times_up && $a_data["fb_file"]);
597  }
598  else
599  {
600  $show_global_feedback = ($last_sub != "---" && $a_data["fb_file"]);
601  }
602 
603  $storage = new ilFSStorageExercise($a_data["exc_id"], $a_data["id"]);
604  $cnt_files = $storage->countFeedbackFiles($feedback_id);
605  $lpcomment = ilExAssignment::lookupCommentForUser($a_data["id"], $ilUser->getId());
606  $mark = ilExAssignment::lookupMarkOfUser($a_data["id"], $ilUser->getId());
607  $status = ilExAssignment::lookupStatusOfUser($a_data["id"], $ilUser->getId());
608  if ($lpcomment != "" || $mark != "" || $status != "notgraded" ||
609  $cnt_files > 0 || $show_global_feedback)
610  {
611  $info->addSection($lng->txt("exc_feedback_from_tutor"));
612  if ($lpcomment != "")
613  {
614  $info->addProperty($lng->txt("exc_comment"),
615  $lpcomment);
616  }
617  if ($mark != "")
618  {
619  $info->addProperty($lng->txt("exc_mark"),
620  $mark);
621  }
622 
623  if ($status == "")
624  {
625  // $info->addProperty($lng->txt("status"),
626  // $lng->txt("message_no_delivered_files"));
627  }
628  else if ($status != "notgraded")
629  {
630  $img = '<img src="'.ilUtil::getImagePath("scorm/".$status.".svg").'" '.
631  ' alt="'.$lng->txt("exc_".$status).'" title="'.$lng->txt("exc_".$status).
632  '" />';
633  $info->addProperty($lng->txt("status"),
634  $img." ".$lng->txt("exc_".$status));
635  }
636 
637  if ($cnt_files > 0)
638  {
639  $info->addSection($lng->txt("exc_fb_files").
640  '<a name="fb'.$a_data["id"].'"></a>');
641 
642  if($cnt_files > 0)
643  {
644  $files = $storage->getFeedbackFiles($feedback_id);
645  foreach($files as $file)
646  {
647  $ilCtrl->setParameterByClass("ilobjexercisegui", "file", urlencode($file));
648  $info->addProperty($file,
649  $lng->txt("download"),
650  $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadFeedbackFile"));
651  $ilCtrl->setParameterByClass("ilobjexercisegui", "file", "");
652  }
653  }
654  }
655 
656  // #15002 - global feedback
657  if($show_global_feedback)
658  {
659  $info->addSection($lng->txt("exc_global_feedback_file"));
660 
661  $info->addProperty($a_data["fb_file"],
662  $lng->txt("download"),
663  $ilCtrl->getLinkTargetByClass("ilobjexercisegui", "downloadGlobalFeedbackFile"));
664  }
665  }
666  }
667  }
668 
669  $tpl->setVariable("CONTENT", $info->getHTML());
670 
671  return $tpl->get();
672  }
673 
677  function getTimeString($a_deadline)
678  {
679  global $lng;
680 
681  if ($a_deadline == 0)
682  {
683  return $lng->txt("exc_no_deadline_specified");
684  }
685 
686  if ($a_deadline - time() <= 0)
687  {
688  $time_str = $lng->txt("exc_time_over_short");
689  }
690  else
691  {
692  $time_diff = ilUtil::int2array($a_deadline - time(),null);
693  // #11576 - order ascending!
694  if (isset($time_diff['minutes']))
695  {
696  unset($time_diff['seconds']);
697  }
698  if (isset($time_diff['days']))
699  {
700  unset($time_diff['minutes']);
701  }
702  if (isset($time_diff['months']))
703  {
704  unset($time_diff['hours']);
705  }
706  $time_str = ilUtil::timearray2string($time_diff);
707  }
708 
709  return $time_str;
710  }
711 
712 
713 }