29 $tpl =
new ilTemplate(
"tpl.assignment_head.html",
true,
true,
"Modules/Exercise");
31 if ($a_data[
"deadline"] - time() <= 0)
33 $tpl->setCurrentBlock(
"prop");
34 $tpl->setVariable(
"PROP", $lng->txt(
"exc_ended_on"));
35 $tpl->setVariable(
"PROP_VAL",
37 $tpl->parseCurrentBlock();
39 else if ($a_data[
"start_time"] > 0 && time() - $a_data[
"start_time"] <= 0)
41 $tpl->setCurrentBlock(
"prop");
42 $tpl->setVariable(
"PROP", $lng->txt(
"exc_starting_on"));
43 $tpl->setVariable(
"PROP_VAL",
45 $tpl->parseCurrentBlock();
50 $tpl->setCurrentBlock(
"prop");
51 $tpl->setVariable(
"PROP", $lng->txt(
"exc_time_to_send"));
52 $tpl->setVariable(
"PROP_VAL", $time_str);
53 $tpl->parseCurrentBlock();
55 $tpl->setCurrentBlock(
"prop");
56 $tpl->setVariable(
"PROP", $lng->txt(
"exc_edit_until"));
57 $tpl->setVariable(
"PROP_VAL",
59 $tpl->parseCurrentBlock();
64 if ($a_data[
"mandatory"])
66 $mand =
" (".$lng->txt(
"exc_mandatory").
")";
68 $tpl->setVariable(
"TITLE", $a_data[
"title"].$mand);
75 case "passed": $pic =
"scorm/passed.gif";
break;
76 case "failed": $pic =
"scorm/failed.gif";
break;
77 default: $pic =
"scorm/not_attempted.gif";
break;
80 $tpl->setVariable(
"ALT_STATUS", $lng->txt(
"exc_".$stat));
92 $tpl =
new ilTemplate(
"tpl.assignment_body.html",
true,
true,
"Modules/Exercise");
94 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
96 $info->setTableClass(
"");
98 $not_started_yet =
false;
99 if ($a_data[
"start_time"] > 0 && time() - $a_data[
"start_time"] <= 0)
101 $not_started_yet =
true;
104 if (!$not_started_yet)
107 $info->addSection($lng->txt(
"exc_instruction"));
108 $info->addProperty(
"",
113 $info->addSection($lng->txt(
"exc_schedule"));
114 if ($a_data[
"start_time"] > 0)
116 $info->addProperty($lng->txt(
"exc_start_time"),
119 $info->addProperty($lng->txt(
"exc_edit_until"),
122 if (!$not_started_yet)
124 $info->addProperty($lng->txt(
"exc_time_to_send"),
125 "<b>".$time_str.
"</b>");
129 if ($this->exc->getShowSubmissions())
131 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id", $a_data[
"id"]);
132 if ($a_data[
"deadline"] - time() <= 0)
134 $link =
'<a class="submit" href="'.
135 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"listPublicSubmissions").
'">'.
136 $lng->txt(
"exc_list_submission").
'</a>';
137 $info->addProperty($lng->txt(
"exc_public_submission"), $link);
141 $info->addProperty($lng->txt(
"exc_public_submission"),
142 $lng->txt(
"exc_msg_public_submission"));
144 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id",
$_GET[
"ass_id"]);
147 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id", $a_data[
"id"]);
149 if (!$not_started_yet)
155 $info->addSection($lng->txt(
"exc_files"));
158 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"file", urlencode($file[
"name"]));
159 $info->addProperty($file[
"name"],
160 $lng->txt(
"download"),
161 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"downloadFile"));
162 $ilCtrl->setParameter($this,
"file",
"");
167 $info->addSection($lng->txt(
"exc_your_submission"));
170 foreach($delivered_files as
$file)
172 $titles[] = $file[
"filetitle"];
174 $files_str = implode($titles,
", ");
175 if ($files_str ==
"")
177 $files_str = $lng->txt(
"message_no_delivered_files");
180 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"ass_id", $a_data[
"id"]);
182 if ($a_data[
"deadline"] - time() > 0)
184 $files_str.=
' <a class="submit" href="'.
185 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"submissionScreen").
'">'.
187 ? $lng->txt(
"exc_hand_in")
188 : $lng->txt(
"exc_edit_submission")).
'</a>';
192 $files_str.=
' <a class="submit" href="'.
193 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"submissionScreen").
'">'.
194 $lng->txt(
"already_delivered_files").
'</a>';
197 $info->addProperty($lng->txt(
"exc_files_returned"),
209 if ($last_sub !=
"---")
211 $info->addProperty($lng->txt(
"exc_last_submission"),
217 $cnt_files = $storage->countFeedbackFiles($ilUser->getId());
221 if ($lpcomment !=
"" || $mark !=
"" || $status !=
"notgraded" || $cnt_files > 0)
223 $info->addSection($lng->txt(
"exc_feedback_from_tutor"));
224 if ($lpcomment !=
"")
226 $info->addProperty($lng->txt(
"exc_comment"),
231 $info->addProperty($lng->txt(
"exc_mark"),
240 else if ($status !=
"notgraded")
242 $img =
'<img border="0" src="'.ilUtil::getImagePath(
"scorm/".$status.
".gif").
'" '.
243 ' alt="'.$lng->txt(
"exc_".$status).
'" title="'.$lng->txt(
"exc_".$status).
244 '" style="vertical-align:middle;"/>';
245 $info->addProperty($lng->txt(
"status"),
246 $img.
" ".$lng->txt(
"exc_".$status));
251 $info->addSection($lng->txt(
"exc_fb_files"));
252 $files = $storage->getFeedbackFiles($ilUser->getId());
255 $ilCtrl->setParameterByClass(
"ilobjexercisegui",
"file", urlencode($file));
256 $info->addProperty($file,
257 $lng->txt(
"download"),
258 $ilCtrl->getLinkTargetByClass(
"ilobjexercisegui",
"downloadFeedbackFile"));
259 $ilCtrl->setParameter($this,
"file",
"");
265 $tpl->setVariable(
"CONTENT", $info->getHTML());
277 if ($a_deadline - time() <= 0)
279 $time_str = $lng->txt(
"exc_time_over_short");
284 unset($time_diff[
'seconds']);
285 if (isset($time_diff[
'days']))
287 unset($time_diff[
'minutes']);
289 if (isset($time_diff[
'months']))
291 unset($time_diff[
'hours']);