2 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
31 $lng->loadLanguageModule(
"exc");
33 $tpl =
new ilTemplate(
"tpl.assignment_head.html",
true,
true,
"Modules/Exercise");
35 if (($a_data[
"deadline"] > 0) && $a_data[
"deadline"] - time() <= 0)
37 $tpl->setCurrentBlock(
"prop");
38 $tpl->setVariable(
"PROP", $lng->txt(
"exc_ended_on"));
39 $tpl->setVariable(
"PROP_VAL",
41 $tpl->parseCurrentBlock();
43 else if ($a_data[
"start_time"] > 0 && time() - $a_data[
"start_time"] <= 0)
45 $tpl->setCurrentBlock(
"prop");
46 $tpl->setVariable(
"PROP", $lng->txt(
"exc_starting_on"));
47 $tpl->setVariable(
"PROP_VAL",
49 $tpl->parseCurrentBlock();
54 $tpl->setCurrentBlock(
"prop");
55 $tpl->setVariable(
"PROP", $lng->txt(
"exc_time_to_send"));
56 $tpl->setVariable(
"PROP_VAL", $time_str);
57 $tpl->parseCurrentBlock();
59 if ($a_data[
"deadline"] > 0)
61 $tpl->setCurrentBlock(
"prop");
62 $tpl->setVariable(
"PROP", $lng->txt(
"exc_edit_until"));
63 $tpl->setVariable(
"PROP_VAL",
65 $tpl->parseCurrentBlock();
71 if ($a_data[
"mandatory"])
73 $mand =
" (".$lng->txt(
"exc_mandatory").
")";
75 $tpl->setVariable(
"TITLE", $a_data[
"title"].$mand);
82 case "passed": $pic =
"scorm/passed.png";
break;
83 case "failed": $pic =
"scorm/failed.png";
break;
84 default: $pic =
"scorm/not_attempted.png";
break;
87 $tpl->setVariable(
"ALT_STATUS", $lng->txt(
"exc_".$stat));
99 $tpl =
new ilTemplate(
"tpl.assignment_body.html",
true,
true,
"Modules/Exercise");
101 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
102 if(IS_PAYMENT_ENABLED)
104 include_once
'./Services/Payment/classes/class.ilPaymentObject.php';
108 $info->setTableClass(
"");
110 $not_started_yet =
false;
111 if ($a_data[
"start_time"] > 0 && time() - $a_data[
"start_time"] <= 0)
113 $not_started_yet =
true;
116 if (!$not_started_yet)
119 $info->addSection($lng->txt(
"exc_instruction"));
120 $info->addProperty(
"",
125 $info->addSection($lng->txt(
"exc_schedule"));
126 if ($a_data[
"start_time"] > 0)
128 $info->addProperty($lng->txt(
"exc_start_time"),
131 if ($a_data[
"deadline"] > 0)
133 $info->addProperty($lng->txt(
"exc_edit_until"),
137 if (!$not_started_yet)
139 $info->addProperty($lng->txt(
"exc_time_to_send"),
140 "<b>".$time_str.
"</b>");
144 if ($this->exc->getShowSubmissions())
146 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id", $a_data[
"id"]);
147 if ($a_data[
"deadline"] - time() <= 0)
149 $link =
'<a class="submit" href="'.
150 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"listPublicSubmissions").
'">'.
151 $lng->txt(
"exc_list_submission").
'</a>';
152 $info->addProperty($lng->txt(
"exc_public_submission"), $link);
156 $info->addProperty($lng->txt(
"exc_public_submission"),
157 $lng->txt(
"exc_msg_public_submission"));
159 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id",
$_GET[
"ass_id"]);
162 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id", $a_data[
"id"]);
164 if (!$not_started_yet)
168 if (count($files) > 0)
170 $info->addSection($lng->txt(
"exc_files"));
171 foreach($files as
$file)
177 $info->addProperty($file[
"name"],
179 $ilCtrl->getLinkTargetByClass(
"ilShopPurchaseGUI",
"showDetails"));
183 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"file", urlencode($file[
"name"]));
184 $info->addProperty($file[
"name"],
185 $lng->txt(
"download"),
186 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"downloadFile"));
187 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"file",
"");
195 if(IS_PAYMENT_ENABLED
199 $info->addSection($lng->txt(
"exc_your_submission"));
201 $ilCtrl->clearParameters($this);
203 $ilCtrl->setParameter($this,
"ref_id",
$_GET[
'ref_id']);
204 $ilCtrl->setParameter($this,
'subtype',
'upload');
205 $info->addProperty($lng->txt(
'exc_hand_in'),
207 $ilCtrl->getLinkTargetByClass(
"ilShopPurchaseGUI",
"showDetails"));
211 $info->addSection($lng->txt(
"exc_your_submission"));
216 if(($a_data[
"deadline"] > 0) && $a_data[
"deadline"] - time() < 0)
221 $team_members = null;
222 switch($a_data[
"type"])
225 $no_team_yet =
false;
227 if(
sizeof($team_members))
230 foreach($team_members as $member_id)
234 $info->addProperty($lng->txt(
"exc_team_members"), implode(
", ", $team));
239 if(!
sizeof($delivered_files))
241 $info->addProperty($lng->txt(
"exc_team_members"), $lng->txt(
"exc_no_team_yet"));
245 $info->addProperty($lng->txt(
"exc_team_members"),
246 '<span class="warning">'.$lng->txt(
"exc_no_team_yet").
'</span>');
253 foreach($delivered_files as
$file)
255 $titles[] = $file[
"filetitle"];
257 $files_str = implode($titles,
", ");
258 if ($files_str ==
"")
260 $files_str = $lng->txt(
"message_no_delivered_files");
263 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id", $a_data[
"id"]);
268 if($no_team_yet && count($titles))
270 $title = $lng->txt(
"exc_create_team");
274 $title = (count($titles) == 0
275 ? $lng->txt(
"exc_hand_in")
276 : $lng->txt(
"exc_edit_submission"));
278 $files_str.=
' <a class="submit" href="'.
279 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"submissionScreen").
'">'.
286 $files_str .=
'<div class="warning">'.
287 $lng->txt(
"exc_create_team_times_up_warning").
'</div>';
289 else if (count($titles) > 0)
291 $files_str.=
' <a class="submit" href="'.
292 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"submissionScreen").
'">'.
293 $lng->txt(
"already_delivered_files").
'</a>';
297 $info->addProperty($lng->txt(
"exc_files_returned"),
302 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
306 if(!$wsp_tree->getRootId())
313 if(
sizeof($delivered_files))
315 $delivered_files = array_pop($delivered_files);
316 $blog_id = (int)$delivered_files[
"filetitle"];
317 $node = $wsp_tree->getNodeData($blog_id);
321 $ilCtrl->setParameterByClass(
"ilobjbloggui",
"wsp_id", $blog_id);
322 $blog_link = $ilCtrl->getLinkTargetByClass(array(
"ilpersonaldesktopgui",
"ilpersonalworkspacegui",
"ilobjbloggui"),
"");
323 $ilCtrl->setParameterByClass(
"ilobjbloggui",
"wsp_id",
"");
324 $files_str =
'<a href="'.$blog_link.
'">'.
325 $node[
"title"].
'</a>';
333 $files_str .=
'<a class="submit" href="'.
334 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"createBlog").
'">'.
335 $lng->txt(
"exc_create_blog").
'</a>';
338 $blogs =
sizeof($wsp_tree->getObjectsFromType(
"blog"));
339 if((!$valid_blog && $blogs)
340 || ($valid_blog && $blogs > 1))
342 $files_str .=
' <a class="submit" href="'.
343 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"selectBlog").
'">'.
344 $lng->txt(
"exc_select_blog".($valid_blog ?
"_change" :
"")).
'</a>';
349 $info->addProperty($lng->txt(
"exc_blog_returned"), $files_str);
351 if($delivered_files && substr($delivered_files[
"filename"], -1) !=
"/")
353 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"delivered", $delivered_files[
"returned_id"]);
354 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"download");
355 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"delivered",
"");
357 $info->addProperty($lng->txt(
"exc_files_returned"),
358 "<a href=\"".$dl_link.
"\">".$lng->txt(
"download").
"</a>");
363 include_once
"Services/Portfolio/classes/class.ilObjPortfolio.php";
367 if(
sizeof($delivered_files))
369 $delivered_files = array_pop($delivered_files);
370 $portfolio_id = (int)$delivered_files[
"filetitle"];
376 if($portfolio->getTitle())
379 $ilCtrl->setParameterByClass(
"ilobjportfoliogui",
"prt_id", $portfolio_id);
380 $prtf_link = $ilCtrl->getLinkTargetByClass(array(
"ilpersonaldesktopgui",
"ilobjportfoliogui"),
"pages");
381 $ilCtrl->setParameterByClass(
"ilobjportfoliogui",
"prt_id",
"");
383 $files_str =
'<a href="'.$prtf_link.
384 '">'.$portfolio->getTitle().
'</a>';
393 $files_str .=
'<a class="submit" href="'.
394 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"createPortfolio").
'">'.
395 $lng->txt(
"exc_create_portfolio").
'</a>';
399 if((!$valid_prtf && $prtfs)
400 || ($valid_prtf && $prtfs > 1))
402 $files_str .=
' <a class="submit" href="'.
403 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"selectPortfolio").
'">'.
404 $lng->txt(
"exc_select_portfolio".($valid_prtf ?
"_change" :
"")).
'</a>';
409 $info->addProperty($lng->txt(
"exc_portfolio_returned"), $files_str);
411 if($delivered_files && substr($delivered_files[
"filename"], -1) !=
"/")
413 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"delivered", $delivered_files[
"returned_id"]);
414 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"download");
415 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"delivered",
"");
417 $info->addProperty($lng->txt(
"exc_files_returned"),
418 "<a href=\"".$dl_link.
"\">".$lng->txt(
"download").
"</a>");
434 if ($last_sub !=
"---")
436 $info->addProperty($lng->txt(
"exc_last_submission"),
443 $feedback_id =
"t".ilExAssignment::getTeamIdByAssignment($a_data[
"id"], $ilUser->getId());
447 $feedback_id = $ilUser->getId();
450 $cnt_files = $storage->countFeedbackFiles($feedback_id);
454 if ($lpcomment !=
"" || $mark !=
"" || $status !=
"notgraded" || $cnt_files > 0)
456 $info->addSection($lng->txt(
"exc_feedback_from_tutor"));
457 if ($lpcomment !=
"")
459 $info->addProperty($lng->txt(
"exc_comment"),
464 $info->addProperty($lng->txt(
"exc_mark"),
473 else if ($status !=
"notgraded")
475 $img =
'<img border="0" src="'.ilUtil::getImagePath(
"scorm/".$status.
".png").
'" '.
476 ' alt="'.$lng->txt(
"exc_".$status).
'" title="'.$lng->txt(
"exc_".$status).
477 '" style="vertical-align:middle;"/>';
478 $info->addProperty($lng->txt(
"status"),
479 $img.
" ".$lng->txt(
"exc_".$status));
484 $info->addSection($lng->txt(
"exc_fb_files"));
485 $files = $storage->getFeedbackFiles($feedback_id);
486 foreach($files as
$file)
488 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"file", urlencode($file));
489 $info->addProperty($file,
490 $lng->txt(
"download"),
491 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"downloadFeedbackFile"));
492 $ilCtrl->setParameter($this,
"file",
"");
499 $tpl->setVariable(
"CONTENT", $info->getHTML());
511 if ($a_deadline == 0)
513 return $lng->txt(
"exc_no_deadline_specified");
516 if ($a_deadline - time() <= 0)
518 $time_str = $lng->txt(
"exc_time_over_short");
524 if (isset($time_diff[
'minutes']))
526 unset($time_diff[
'seconds']);
528 if (isset($time_diff[
'days']))
530 unset($time_diff[
'minutes']);
532 if (isset($time_diff[
'months']))
534 unset($time_diff[
'hours']);