4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
5 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
6 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
7 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
23 function __construct($a_parent_obj, $a_parent_cmd, $a_exc, $a_part_id)
28 $this->exc_id = $this->exc->getId();
30 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
32 $this->part_id = $a_part_id;
34 $this->
setId(
"exc_part_".$this->exc_id.
"_".$this->part_id);
36 include_once(
"./Services/User/classes/class.ilObjUser.php");
38 if ($this->part_id > 0)
41 if(trim($name[
"login"]))
43 $this->user =
new ilObjUser($this->part_id);
48 $ilCtrl->setParameter($a_parent_obj,
"part_id",
"");
49 $ilCtrl->redirect($a_parent_obj, $a_parent_cmd);
61 if ($this->part_id > 0)
63 $this->
setTitle($lng->txt(
"exc_participant").
": ".
64 $name[
"lastname"].
", ".$name[
"firstname"].
" [".$name[
"login"].
"]");
68 $this->
setTitle($lng->txt(
"exc_participant"));
75 $this->
addColumn($this->lng->txt(
"exc_assignment"),
"order_val");
76 $this->
addColumn($this->lng->txt(
"exc_submission"),
"submission");
77 $this->
addColumn($this->lng->txt(
"exc_grading"),
"solved_time");
79 $this->
addColumn($this->lng->txt(
"feedback"),
"feedback_time");
86 $this->
setRowTemplate(
"tpl.exc_participant_row.html",
"Modules/Exercise");
91 if ($this->part_id > 0)
93 $this->
addCommandButton(
"saveStatusParticipant", $lng->txt(
"exc_save_changes"));
96 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
97 include_once
"Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
98 $this->overlay_tpl =
new ilTemplate(
"tpl.exc_learner_comment_overlay.html",
true,
true,
"Modules/Exercise");
106 if (in_array($a_f, array(
"order_val")))
121 $this->tpl->setVariable(
"TXT_ASS_TITLE",
$d[
"title"]);
125 $has_no_team_yet =
false;
133 $this->tpl->setCurrentBlock(
"ass_members");
134 foreach($members as $member_id)
136 $this->tpl->setVariable(
"TXT_MEMBER_NAME",
138 $this->tpl->parseCurrentBlock();
141 $ilCtrl->setParameter($this->parent_obj,
"lpart", $this->part_id);
142 $this->tpl->setVariable(
"HREF_LOG",
143 $ilCtrl->getLinkTarget($this->parent_obj,
"showTeamLog"));
144 $this->tpl->setVariable(
"TXT_LOG", $lng->txt(
"exc_team_log"));
145 $ilCtrl->setParameter($this->parent_obj,
"lpart",
"");
150 $has_no_team_yet =
true;
151 $this->tpl->setCurrentBlock(
"team_info");
152 $this->tpl->setVariable(
"TXT_TEAM_INFO", $lng->txt(
"exc_no_team_yet"));
153 $this->tpl->setVariable(
"TXT_CREATE_TEAM", $lng->txt(
"exc_create_team"));
155 $ilCtrl->setParameter($this->parent_obj,
"ass_id",
$d[
"id"]);
156 $ilCtrl->setParameter($this->parent_obj,
"lpart", $this->part_id);
157 $this->tpl->setVariable(
"URL_CREATE_TEAM",
158 $ilCtrl->getLinkTarget($this->getParentObject(),
"createSingleMemberTeam"));
159 $ilCtrl->setParameter($this->parent_obj,
"lpart",
"");
160 $ilCtrl->setParameter($this->parent_obj,
"ass_id",
"");
162 if($file_info[
"files"][
"count"])
164 $this->tpl->setVariable(
"TEAM_FILES_INFO",
"<br />".
165 $file_info[
"files"][
"txt"].
": ".
166 $file_info[
"files"][
"count"]);
168 $this->tpl->parseCurrentBlock();
172 if(!$has_no_team_yet)
174 $this->tpl->setVariable(
"VAL_CHKBOX",
176 $this->tpl->setVariable(
"VAL_ID",
179 $this->tpl->setVariable(
"VAL_LAST_SUBMISSION", $file_info[
"last_submission"][
"value"]);
180 $this->tpl->setVariable(
"TXT_LAST_SUBMISSION", $file_info[
"last_submission"][
"txt"]);
182 $this->tpl->setVariable(
"TXT_SUBMITTED_FILES", $file_info[
"files"][
"txt"]);
183 $this->tpl->setVariable(
"VAL_SUBMITTED_FILES", $file_info[
"files"][
"count"]);
185 if($file_info[
"files"][
"download_url"])
187 $this->tpl->setCurrentBlock(
"download_link");
188 $this->tpl->setVariable(
"LINK_DOWNLOAD", $file_info[
"files"][
"download_url"]);
189 $this->tpl->setVariable(
"TXT_DOWNLOAD", $file_info[
"files"][
"download_txt"]);
190 $this->tpl->parseCurrentBlock();
193 if($file_info[
"files"][
"download_new_url"])
195 $this->tpl->setCurrentBlock(
"download_link");
196 $this->tpl->setVariable(
"LINK_NEW_DOWNLOAD", $file_info[
"files"][
"download_new_url"]);
197 $this->tpl->setVariable(
"TXT_NEW_DOWNLOAD", $file_info[
"files"][
"download_new_txt"]);
198 $this->tpl->parseCurrentBlock();
202 $this->tpl->setVariable(
"TXT_NOTE", $lng->txt(
"exc_note_for_tutor"));
203 $this->tpl->setVariable(
"NAME_NOTE",
204 "notice[".
$d[
"id"].
"]");
205 $this->tpl->setVariable(
"VAL_NOTE",
212 $overlay_id =
"excasscomm_".$d[
"id"].
"_".$this->part_id;
213 $overlay_trigger_id = $overlay_id.
"_tr";
215 $overlay->setAnchor($overlay_trigger_id);
216 $overlay->setTrigger($overlay_trigger_id,
"click", $overlay_trigger_id);
219 $this->tpl->setVariable(
"LCOMMENT_ID", $overlay_id.
"_snip");
220 $this->tpl->setVariable(
"LCOMMENT_SNIPPET",
ilUtil::shortenText($lcomment_value, 25,
true));
221 $this->tpl->setVariable(
"COMMENT_OVERLAY_TRIGGER_ID", $overlay_trigger_id);
222 $this->tpl->setVariable(
"COMMENT_OVERLAY_TRIGGER_TEXT", $lng->txt(
"exc_comment_for_learner_edit"));
225 $lcomment_form->setId($overlay_id);
226 $lcomment_form->setPreventDoubleSubmission(
false);
228 $lcomment =
new ilTextAreaInputGUI($lng->txt(
"exc_comment_for_learner"),
"lcomment_".$d[
"id"].
"_".$this->part_id);
229 $lcomment->
setInfo($lng->txt(
"exc_comment_for_learner_info"));
230 $lcomment->setValue($lcomment_value);
231 $lcomment->setCols(45);
232 $lcomment->setRows(5);
233 $lcomment_form->addItem($lcomment);
235 $lcomment_form->addCommandButton(
"save", $lng->txt(
"save"));
238 $this->overlay_tpl->setCurrentBlock(
"overlay_bl");
239 $this->overlay_tpl->setVariable(
"COMMENT_OVERLAY_ID", $overlay_id);
240 $this->overlay_tpl->setVariable(
"COMMENT_OVERLAY_FORM", $lcomment_form->getHTML());
241 $this->overlay_tpl->parseCurrentBlock();
256 $this->tpl->setVariable(
"SEL_".strtoupper($status),
' selected="selected" ');
257 $this->tpl->setVariable(
"TXT_NOTGRADED", $lng->txt(
"exc_notgraded"));
258 $this->tpl->setVariable(
"TXT_PASSED", $lng->txt(
"exc_passed"));
259 $this->tpl->setVariable(
"TXT_FAILED", $lng->txt(
"exc_failed"));
262 $this->tpl->setCurrentBlock(
"status_date");
263 $this->tpl->setVariable(
"TXT_LAST_CHANGE", $lng->txt(
"last_change"));
264 $this->tpl->setVariable(
'VAL_STATUS_DATE',
266 $this->tpl->parseCurrentBlock();
270 case "passed": $pic =
"scorm/passed.svg";
break;
271 case "failed": $pic =
"scorm/failed.svg";
break;
272 default: $pic =
"scorm/not_attempted.svg";
break;
275 $this->tpl->setVariable(
"ALT_STATUS", $lng->txt(
"exc_".$status));
278 $this->tpl->setVariable(
"TXT_MARK", $lng->txt(
"exc_mark"));
279 $this->tpl->setVariable(
"NAME_MARK",
280 "mark[".
$d[
"id"].
"]");
282 $this->tpl->setVariable(
"VAL_MARK",
286 $ilCtrl->setParameter($this->parent_obj,
"member_id", $this->part_id);
289 $this->tpl->setCurrentBlock(
"feedback_date");
290 $this->tpl->setVariable(
"TXT_FEEDBACK_MAIL_SENT",
291 sprintf($lng->txt(
"exc_sent_at"),
293 $this->tpl->parseCurrentBlock();
295 $ilCtrl->setParameter($this,
"rcp_to", $this->user->getLogin());
296 $this->tpl->setVariable(
"LINK_FEEDBACK",
297 $ilCtrl->getLinkTarget($this->parent_obj,
"redirectFeedbackMail"));
299 $this->tpl->setVariable(
"TXT_FEEDBACK",
300 $lng->txt(
"exc_send_mail"));
301 $ilCtrl->setParameter($this->parent_obj,
"rcp_to",
"");
305 $feedback_id =
"t".ilExAssignment::getTeamIdByAssignment(
$d[
"id"], $this->part_id);
309 $feedback_id = $this->part_id;
313 $cnt_files = $storage->countFeedbackFiles($feedback_id);
314 $ilCtrl->setParameter($this->parent_obj,
"fsmode",
"feedbackpart");
315 $this->tpl->setVariable(
"LINK_FILE_FEEDBACK",
316 $ilCtrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"));
319 $this->tpl->setVariable(
"TXT_FILE_FEEDBACK",
320 $lng->txt(
"exc_add_feedback_file"));
324 $this->tpl->setVariable(
"TXT_FILE_FEEDBACK",
325 $lng->txt(
"exc_fb_files").
" (".$cnt_files.
")");
331 $this->tpl->setCurrentBlock(
"peer_review_bl");
332 $this->tpl->setVariable(
"TXT_PEER_REVIEW", $lng->txt(
"exc_peer_review_show"));
334 $ilCtrl->setParameter($this->parent_obj,
"grd", 2);
335 $this->tpl->setVariable(
"LINK_PEER_REVIEW",
336 $ilCtrl->getLinkTarget($this->parent_obj,
"showPersonalPeerReview"));
337 $ilCtrl->setParameter($this->parent_obj,
"grd",
"");
340 $rating->setObject(
$d[
"id"],
"ass", $this->part_id,
"peer");
341 $rating->setUserId(0);
342 $this->tpl->setVariable(
"VAL_RATING", $rating->getHTML(
true,
false));
344 $this->tpl->parseCurrentBlock();
347 $ilCtrl->setParameter($this->parent_obj,
"ass_id",
$_GET[
"ass_id"]);
351 $this->tpl->touchBlock(
"member_has_no_team_bl");
359 $url = $ilCtrl->getLinkTarget($this->
getParentObject(),
"saveCommentForLearners",
"",
true,
false);
360 $this->overlay_tpl->setVariable(
"AJAX_URL", $url);
363 $this->overlay_tpl->get();