25 require_once
"classes/class.ilObjectGUI.php";
48 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
50 $lng->loadLanguageModule(
"exercise");
51 $this->ctrl->saveParameter($this, array(
"sort_by",
"sort_order",
"offset"));
56 return $this->files ? $this->files : array();
61 $this->files = $a_files;
74 $this->tpl->setVariable(
"EDIT_FORM", $this->form_gui->getHtml());
80 $this->tpl->setVariable(
"INSTRUCTION",
84 $this->tpl->setVariable(
"TXT_INSTRUCTION",$this->lng->txt(
"exc_instruction"));
85 $this->tpl->setVariable(
"TXT_EDIT_UNTIL",$this->lng->txt(
"exc_edit_until"));
86 $this->tpl->setVariable(
"TXT_HOUR",$this->lng->txt(
"time_h"));
87 $this->tpl->setVariable(
"TXT_DAY",$this->lng->txt(
"time_d"));
88 $this->tpl->setVariable(
"SELECT_HOUR",$this->
__getDateSelect(
"hour",(
int) date(
"H",time())));
89 $this->tpl->setVariable(
"SELECT_MINUTES",$this->
__getDateSelect(
"minutes",(
int) date(
"i",time())));
90 $this->tpl->setVariable(
"SELECT_DAY",$this->
__getDateSelect(
"day",(
int) date(
"d",time())));
91 $this->tpl->setVariable(
"SELECT_MONTH",$this->
__getDateSelect(
"month",(
int) date(
"m",time())));
92 $this->tpl->setVariable(
"SELECT_YEAR",$this->
__getDateSelect(
"year",1));
93 $this->tpl->setVariable(
"CMD_CANCEL",
"cancel");
104 global $rbacsystem,$ilUser;
106 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
110 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
116 if (!$rbacsystem->checkAccess(
"read", $this->ref_id))
118 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
122 $this->tpl->setVariable(
"FORM_DOWNLOAD_ACTION", $this->ctrl->getFormAction($this,
"downloadFile"));
123 $this->tpl->setVariable(
"TITLE_TXT",$this->lng->txt(
"title"));
124 $this->tpl->setVariable(
"TITLE",$this->object->getTitle());
125 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"exc_details"));
126 $this->tpl->setVariable(
"DESCRIPTION_TXT",$this->lng->txt(
"description"));
127 $this->tpl->setVariable(
"DESCRIPTION",$this->object->getDescription());
128 $this->tpl->setVariable(
"INSTRUCTION_TXT",$this->lng->txt(
"exc_instruction"));
129 $this->tpl->setVariable(
"INSTRUCTION",nl2br($this->object->getInstruction()));
130 $this->tpl->setVariable(
"EDIT_UNTIL_TXT",$this->lng->txt(
"exc_edit_until"));
131 $this->tpl->setVariable(
"EDIT_UNTIL",date(
"H:i, d.m.Y",$this->object->getTimestamp()));
132 $this->tpl->setVariable(
"TIME_TO_SEND_TXT",$this->lng->txt(
"exc_time_to_send"));
134 if ($this->object->getTimestamp()-time() <= 0)
136 $this->tpl->setCurrentBlock(
"TIME_REACHED");
137 $this->tpl->setVariable(
"TIME_TO_SEND",$this->lng->txt(
"exc_time_over_short"));
138 $this->tpl->parseCurrentBlock();
143 $this->tpl->setCurrentBlock(
"TIME_NOT_REACHED");
144 $this->tpl->setVariable(
"TIME_TO_SEND",$timestr);
145 $this->tpl->parseCurrentBlock();
149 foreach($this->object->getFiles() as
$file)
151 $this->tpl->setCurrentBlock(
"FILES_ROW");
152 $this->tpl->setVariable(
"FILE_DATA",
$file[
"name"]);
154 $this->tpl->parseCurrentBlock();
160 $this->tpl->setCurrentBlock(
"FILES");
161 $this->tpl->setVariable(
"FILES_TXT",$this->lng->txt(
"exc_files"));
162 $this->tpl->setVariable(
"TXT_DOWNLOAD",$this->lng->txt(
"download"));
164 $this->tpl->parseCurrentBlock();
167 $this->tpl->setCurrentBlock(
"perma_link");
168 $this->tpl->setVariable(
"PERMA_LINK", ILIAS_HTTP_PATH.
170 $this->object->getType().
171 "_".$this->object->getRefId().
"&client_id=".CLIENT_ID);
172 $this->tpl->setVariable(
"TXT_PERMA_LINK", $this->lng->txt(
"perma_link"));
173 $this->tpl->setVariable(
"PERMA_TARGET",
"_top");
174 $this->tpl->parseCurrentBlock();
187 require_once
"./Services/Utilities/classes/class.ilUtil.php";
191 $this->tabs_gui->setTabActive(
"exc_your_submission");
193 if (mktime() > $this->object->getTimestamp())
199 if ($_POST[
"cmd"][
"delete"] && mktime() < $this->
object->getTimestamp())
201 if (count($_POST[
"delivered"]))
203 $this->
object->deleteDeliveredFiles($_POST[
"delivered"], $ilUser->id);
207 ilUtil::sendInfo($this->lng->txt(
"please_select_a_delivered_file_to_delete"));
211 if ($_POST[
"cmd"][
"download"])
213 if (count($_POST[
"delivered"]))
215 $this->
object->members_obj->downloadSelectedFiles($_POST[
"delivered"],$ilUser->getId());
219 ilUtil::sendInfo($this->lng->txt(
"please_select_a_delivered_file_to_download"));
224 if (mktime() > $this->
object->getTimestamp())
233 $delivered_files = $this->
object->getDeliveredFiles($ilUser->id);
234 $color_class = array(
"tblrow1",
"tblrow2");
236 foreach ($delivered_files as $index =>
$file)
238 $this->tpl->setCurrentBlock(
"delivered_row");
239 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
240 $this->tpl->setVariable(
"FILE_ID",
$file[
"returned_id"]);
241 $this->tpl->setVariable(
"DELIVERED_FILE",
$file[
"filetitle"]);
251 $this->tpl->parseCurrentBlock();
254 if (count($delivered_files))
256 $this->tpl->setCurrentBlock(
"footer_content");
258 $this->tpl->setVariable(
"BUTTON_DELETE", $this->lng->txt(
"delete"));
259 $this->tpl->setVariable(
"BUTTON_DOWNLOAD", $this->lng->txt(
"download"));
260 $this->tpl->parseCurrentBlock();
264 $this->tpl->setCurrentBlock(
"footer_empty");
265 $this->tpl->setVariable(
"TEXT_NO_DELIVERED_FILES",
266 $this->lng->txt(
"message_no_delivered_files"));
267 $this->tpl->parseCurrentBlock();
270 $this->tpl->setCurrentBlock(
"delivered_files");
271 $this->tpl->setVariable(
"DELIVER_FORMACTION",
272 $this->ctrl->getLinkTarget($this,
"deliver"));
273 $this->tpl->setVariable(
"TEXT_DATE", $this->lng->txt(
"date"));
274 $this->tpl->setVariable(
"TEXT_DELIVERED_FILENAME", $this->lng->txt(
"filename"));
275 $this->tpl->setVariable(
"TEXT_HEADING_DELIVERED_FILES", $this->lng->txt(
"already_delivered_files"));
276 $this->tpl->parseCurrentBlock();
277 $this->tpl->setCurrentBlock(
"adm_content");
278 $this->tpl->setVariable(
"FORMACTION",
279 $this->ctrl->getLinkTarget($this,
"deliverFile"));
280 $this->tpl->setVariable(
"BUTTON_DELIVER", $this->lng->txt(
"upload"));
281 $this->tpl->setVariable(
"TEXT_FILENAME", $this->lng->txt(
"enter_filename_deliver"));
282 $this->tpl->setVariable(
"TXT_UPLOAD_FILE", $this->lng->txt(
"file_add"));
283 $this->tpl->setVariable(
"TXT_UPLOAD_ZIPFILE", $this->lng->txt(
"header_zip"));
284 $this->tpl->parseCurrentBlock();
290 global $ilUser,
$lng;
294 $this->tabs_gui->setTabActive(
"view");
295 $this->tabs_gui->setTabActive(
"exc_your_submission");
297 if (!empty($_POST[
"cmd"][deliverUnzip]) && preg_match(
"/zip/",$_FILES[
"deliver"][
"type"]) == 1)
299 $this->
object->processUploadedFile($_FILES[
"deliver"][
"tmp_name"],
"deliverFile",
false);
304 if(!$this->object->deliverFile($_FILES[
"deliver"], $ilUser->id))
318 $file = ($_POST[
"file"])
327 $this->ctrl->redirect($this,
"view");
329 $files = $this->
object->getFiles();
332 foreach($this->object->getFiles() as $lfile)
334 if($lfile[
"name"] == urldecode(
$file))
342 echo
"FILE DOES NOT EXIST";
361 if ($this->form_gui->checkInput())
371 $newObj->setTitle($this->form_gui->getInput(
"title"));
372 $newObj->setDescription($this->form_gui->getInput(
"desc"));
373 $newObj->setInstruction($this->form_gui->getInput(
"instruction"));
375 $this->form_gui->getItemByPostVar(
"edit_date")->getDate();
376 $newObj->setTimestamp($edit_date->get(
IL_CAL_UNIX));
383 ilUtil::redirect(
"ilias.php?baseClass=ilExerciseHandlerGUI&ref_id=".$newObj->getRefId().
"&cmd=edit");
387 $this->form_gui->setValuesByPost();
394 global $rbacsystem,
$tpl;
403 $this->tpl->setVariable(
"EDIT_FORM", $this->form_gui->getHtml());
405 $this->tpl->setCurrentBlock(
"FILES");
406 $this->tpl->setVariable(
"TXT_HEADER_FILE",$this->lng->txt(
"file_add"));
407 $this->tpl->setVariable(
"TXT_FILE",$this->lng->txt(
"file"));
408 $this->tpl->setVariable(
"TXT_UPLOAD",$this->lng->txt(
"upload"));
409 $this->tpl->setVariable(
"FORMACTION_FILE", $this->ctrl->getFormAction($this));
410 $this->tpl->setVariable(
"TXT_HEADER_ZIP", $this->lng->txt(
"header_zip"));
411 $this->tpl->setVariable(
"CMD_FILE_SUBMIT",
"uploadFile");
412 $this->tpl->parseCurrentBlock();
425 $lng->loadLanguageModule(
"form");
426 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
428 $this->form_gui->setTableWidth(
"60%");
429 if ($a_mode ==
"edit")
431 $this->form_gui->setTitle($lng->txt(
"exc_edit_exercise"));
435 $this->form_gui->setTitle($lng->txt(
"exc_new"));
438 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
442 if ($a_mode ==
"create")
445 $type_input->setValue(
"exc");
446 $this->form_gui->addItem($type_input);
452 $title_input->setMaxLength(128);
453 $this->form_gui->addItem($title_input);
457 $this->form_gui->addItem($desc_input);
461 $this->form_gui->addItem($desc_input);
468 $this->form_gui->addItem($edit_date);
471 if ($a_mode ==
"edit")
473 if(count(
$files = $this->object->getFiles()))
477 $files_head->setTitle($lng->txt(
"files"));
478 $this->form_gui->addItem($files_head);
486 $file_cb->setValue($file[
"name"]);
487 $this->form_gui->addItem($file_cb);
493 if ($a_mode ==
"create")
495 $this->form_gui->addCommandButton(
"save", $lng->txt(
"save"));
496 $this->form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
500 $this->form_gui->addCommandButton(
"update", $lng->txt(
"save"));
501 $this->form_gui->addCommandButton(
"cancelEdit", $lng->txt(
"cancel"));
510 $values[
"title"] = $this->
object->getTitle();
511 $values[
"desc"] = $this->
object->getLongDescription();
512 $values[
"instruction"] = $this->
object->getInstruction();
513 $this->form_gui->setValuesByArray($values);
517 $ed_item = $this->form_gui->getItemByPostVar(
"edit_date");
526 global $rbacsystem,
$tpl;
531 if ($this->form_gui->checkInput())
533 $this->
object->setTitle($this->form_gui->getInput(
"title"));
534 $this->
object->setDescription($this->form_gui->getInput(
"desc"));
535 $this->
object->setInstruction($this->form_gui->getInput(
"instruction"));
537 $this->form_gui->getItemByPostVar(
"edit_date")->getDate();
538 $this->
object->setTimestamp($edit_date->get(
IL_CAL_UNIX));
541 $del_files = array();
542 foreach ($_POST as $k => $v)
544 if (substr($k, 0, 12) ==
"delete_file_" && $v !=
"")
550 $this->
object->deleteFiles($del_files);
552 $this->
object->update();
555 $this->ctrl->redirect($this,
"edit");
559 $this->form_gui->setValuesByPost();
560 $tpl->setContent($this->form_gui->getHTML());
566 $this->
object->setDate($_POST[
"d_hour"],$_POST[
"d_minutes"],$_POST[
"d_day"],
567 $_POST[
"d_month"],$_POST[
"d_year"]);
568 if($_POST[
"delete_file"])
570 $this->
object->deleteFiles($_POST[
"delete_file"]);
575 $this->update = $this->
object->update();
579 $this->ctrl->redirect($this,
"edit");
585 $this->ctrl->redirect($this,
"view");
594 if(!$this->object->addUploadedFile($_FILES[
"zipfile"],
true))
598 $this->ctrl->redirect($this,
"edit");
608 if(!$this->object->addUploadedFile($_FILES[
"file"]))
612 $this->ctrl->redirect($this,
"edit");
625 if ($_POST[
"downloadReturned"])
627 $this->
object->members_obj->deliverReturnedFiles(key($_POST[
"downloadReturned"]));
632 switch($_POST[
"action"])
639 if(!count($_POST[
"member"]))
645 $this->
object->send($_POST[
"member"]);
650 case "redirectFeedbackMail":
672 case "delete_member":
677 $this->ctrl->redirect($this,
"members");
687 if (!$this->object->members_obj->deliverReturnedFiles(
$_GET[
"member_id"]))
689 $this->ctrl->redirect($this,
"members");
701 if (!$this->object->members_obj->deliverReturnedFiles(
$_GET[
"member_id"],
true))
703 $this->ctrl->redirect($this,
"members");
713 if(!count($_POST[
'user']))
719 if(!$this->object->members_obj->assignMembers($_POST[
"user"]))
728 $this->ctrl->redirect($this,
"members");
735 global $rbacsystem,
$tree;
737 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
742 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
745 $this->tpl->setCurrentBlock(
"btn_cell");
746 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
747 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"add_member"));
748 $this->tpl->parseCurrentBlock();
751 $parent_id = $tree->getParentId(
$_GET[
"ref_id"]);
758 while ($parent_id != 1 && $type !=
"crs")
760 $parent_id = $tree->getParentId($parent_id);
770 $search_for_role =
"il_crs_member_" . $parent_id;
771 $this->tpl->setCurrentBlock(
"btn_cell");
773 $_SESSION[
'rep_query'][
'role'][
'title'] = $search_for_role;
776 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'performSearch'));
777 $this->lng->loadLanguageModule(
"exercise");
778 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"exc_crs_add_members"));
779 $this->tpl->parseCurrentBlock();
785 if(!count($this->object->members_obj->getMembers()))
814 $members = $this->
object->getMemberListData();
816 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
818 $tbl->setSelectAllCheckbox(
"member");
819 $tbl->setFormName(
"cmd");
820 $tbl->enable(
"select_all");
821 $this->tpl->addBlockfile(
"MEMBER_TABLE",
"term_table",
"tpl.table.html");
822 $this->tpl->addBlockfile(
"TBL_CONTENT",
"member_row",
"tpl.exc_members_row.html",
"Modules/Exercise");
824 $sent_col = $this->
object->_lookupAnyExerciseSent($this->object->getId());
827 $this->tpl->setCurrentBlock(
"tbl_form_header");
829 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getLinkTarget($this,
"updateMembers"));
830 $this->tpl->parseCurrentBlock();
833 $this->tpl->setCurrentBlock(
"tbl_action_row");
835 $this->tpl->setVariable(
"COLUMN_COUNTS",6);
838 $actions = array(
"save_status" => $this->lng->txt(
"exc_save_changes"),
839 "redirectFeedbackMail" => $this->lng->txt(
"exc_send_mail"),
840 "send_member" => $this->lng->txt(
"exc_send_exercise"),
841 "delete_member" => $this->lng->txt(
"exc_deassign_members"));
843 $this->tpl->setCurrentBlock(
"tbl_action_select");
845 $this->tpl->setVariable(
"BTN_NAME",
"execute");
846 $this->tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"execute"));
847 $this->tpl->parseCurrentBlock();
849 $this->tpl->setCurrentBlock(
"tbl_action_row");
850 $this->tpl->setVariable(
"COLUMN_COUNTS",10);
851 $this->tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
852 $this->tpl->parseCurrentBlock();
857 $sent_str = $this->lng->txt(
"exc_exercise_sent");
861 $sent_str =
" ";
863 $tbl->setTitle($this->lng->txt(
"members"),
"icon_usr.gif",
864 $this->lng->txt(
"exc_header_members"));
865 $tbl->setHeaderNames(array(
"",
"", $this->lng->txt(
"name"),
866 $this->lng->txt(
"login"),
868 $this->lng->txt(
"exc_submission"),
869 $this->lng->txt(
"exc_grading"),
870 $this->lng->txt(
"mail")
873 $tbl->setColumnWidth(array(
"1%",
"1%",
"",
"",
"",
"",
"",
""));
874 $cols = array(
"",
"",
"name",
"login",
"sent_time",
"submission",
875 "status_time",
"feedback_time");
877 if (!
$_GET[
"sort_by"])
879 $_GET[
"sort_by"] =
"name";
881 if (!
$_GET[
"sort_order"])
883 $_GET[
"sort_order"] =
"asc";
886 $header_params = $this->ctrl->getParameterArray($this);
887 unset($header_params[
"sort_by"]);
888 unset($header_params[
"sort_order"]);
889 unset($header_params[
"offset"]);
890 $header_params[
"cmd"] =
"members";
891 $tbl->setHeaderVars($cols, $header_params);
893 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
894 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
895 $tbl->setOffset(
$_GET[
"offset"]);
896 $tbl->setLimit(
$_GET[
"limit"]);
897 $tbl->setMaxCount(count($members));
898 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
899 $members = array_slice($members,
$_GET[
"offset"],
$_GET[
"limit"]);
904 foreach ($members as $member)
906 include_once
"./classes/class.ilObjectFactory.php";
908 $member_id = $member[
"usr_id"];
915 $this->tpl->setCurrentBlock(
"member_row");
916 $this->tpl->setVariable(
"ROW_CSS",
918 $this->tpl->setVariable(
"VAL_CHKBOX",
920 $this->tpl->setVariable(
"VAL_ID",
924 $this->tpl->setVariable(
"TXT_NAME",
926 $this->tpl->setVariable(
"TXT_LOGIN",
927 "[".$member[
"login"].
"]");
930 $this->tpl->setVariable(
"USR_IMAGE",
931 $mem_obj->getPersonalPicturePath(
"xxsmall"));
932 $this->tpl->setVariable(
"USR_ALT", $this->lng->txt(
"personal_picture"));
935 if ($this->object->members_obj->getStatusSentByMember($member_id))
940 $this->tpl->setVariable(
"TXT_MAIL_SENT",
941 sprintf($this->lng->txt(
"exc_sent_at"),
946 $this->tpl->setVariable(
"TXT_MAIL_SENT",
947 $this->lng->txt(
"sent"));
954 $this->
object->getLastSubmission($member_id);
964 if ($this->object->_lookupUpdatedSubmission($this->object->getId(), $member_id) == 1)
966 $last_sub =
"<b>".$last_sub.
"</b>";
968 $this->tpl->setVariable(
"VAL_LAST_SUBMISSION", $last_sub);
969 $this->tpl->setVariable(
"TXT_LAST_SUBMISSION",
970 $this->lng->txt(
"exc_last_submission"));
973 $this->tpl->setVariable(
"TXT_SUBMITTED_FILES",
974 $this->lng->txt(
"exc_files_returned"));
975 $sub_cnt = count($this->object->getDeliveredFiles($member_id));
976 $new = $this->
object->_lookupNewFiles($this->object->getId(), $member_id);
979 $sub_cnt.=
" ".sprintf($this->lng->txt(
"cnt_new"),count($new));
981 $this->tpl->setVariable(
"VAL_SUBMITTED_FILES",
985 $this->ctrl->setParameter($this,
"member_id", $member_id);
988 $this->tpl->setCurrentBlock(
"download_link");
989 $this->tpl->setVariable(
"LINK_DOWNLOAD",
990 $this->ctrl->getLinkTarget($this,
"downloadReturned"));
991 if (count($new) <= 0)
993 $this->tpl->setVariable(
"TXT_DOWNLOAD",
994 $this->lng->txt(
"exc_download_files"));
998 $this->tpl->setVariable(
"TXT_DOWNLOAD",
999 $this->lng->txt(
"exc_download_all"));
1001 $this->tpl->parseCurrentBlock();
1004 if (count($new) > 0)
1006 $this->tpl->setCurrentBlock(
"download_link");
1007 $this->tpl->setVariable(
"LINK_NEW_DOWNLOAD",
1008 $this->ctrl->getLinkTarget($this,
"downloadNewReturned"));
1009 $this->tpl->setVariable(
"TXT_NEW_DOWNLOAD",
1010 $this->lng->txt(
"exc_download_new"));
1011 $this->tpl->parseCurrentBlock();
1014 $this->tpl->setCurrentBlock(
"member_row");
1018 $this->tpl->setVariable(
"TXT_NOTE", $this->lng->txt(
"note"));
1019 $this->tpl->setVariable(
"NAME_NOTE",
1020 "notice[$member_id]");
1021 $this->tpl->setVariable(
"VAL_NOTE",
1025 $this->tpl->setVariable(
"TXT_LCOMMENT", $this->lng->txt(
"exc_comment_for_learner"));
1026 $this->tpl->setVariable(
"NAME_LCOMMENT",
1027 "lcomment[$member_id]");
1029 $this->tpl->setVariable(
"VAL_LCOMMENT",
1036 $this->tpl->setVariable(
"SEL_".strtoupper($status),
' selected="selected" ');
1037 $this->tpl->setVariable(
"TXT_NOTGRADED", $this->lng->txt(
"exc_notgraded"));
1038 $this->tpl->setVariable(
"TXT_PASSED", $this->lng->txt(
"exc_passed"));
1039 $this->tpl->setVariable(
"TXT_FAILED", $this->lng->txt(
"exc_failed"));
1042 $this->tpl->setCurrentBlock(
"status_date");
1043 $this->tpl->setVariable(
"TXT_LAST_CHANGE", $this->lng->txt(
"last_change"));
1044 $this->tpl->setVariable(
'VAL_STATUS_DATE',
1046 $this->tpl->parseCurrentBlock();
1047 $this->tpl->setCurrentBlock(
"member_row");
1051 case "passed": $pic =
"scorm/passed.gif";
break;
1052 case "failed": $pic =
"scorm/failed.gif";
break;
1053 default: $pic =
"scorm/not_attempted.gif";
break;
1056 $this->tpl->setVariable(
"ALT_STATUS", $this->lng->txt(
"exc_".$status));
1059 $this->tpl->setVariable(
"TXT_MARK", $this->lng->txt(
"exc_mark"));
1060 $this->tpl->setVariable(
"NAME_MARK",
1061 "mark[$member_id]");
1063 $this->tpl->setVariable(
"VAL_MARK",
1067 $this->ctrl->setParameter($this,
"member_id", $member_id);
1068 $this->tpl->setVariable(
"CHKBOX_FEEDBACK",
1069 ilUtil::formCheckbox($this->object->members_obj->getStatusFeedbackByMember($member_id),
"feedback[$member_id]",1));
1072 $this->tpl->setCurrentBlock(
"feedback_date");
1073 $this->tpl->setVariable(
"TXT_FEEDBACK_MAIL_SENT",
1074 sprintf($this->lng->txt(
"exc_sent_at"),
1076 $this->tpl->parseCurrentBlock();
1077 $this->tpl->setCurrentBlock(
"member_row");
1079 $this->ctrl->setParameter($this,
"rcp_to", $mem_obj->getLogin());
1080 $this->tpl->setVariable(
"LINK_FEEDBACK",
1081 $this->ctrl->getLinkTarget($this,
"redirectFeedbackMail"));
1083 $this->tpl->setVariable(
"TXT_FEEDBACK",
1084 $this->lng->txt(
"exc_send_mail"));
1085 $this->ctrl->setParameter($this,
"rcp_to",
"");
1087 $this->tpl->parseCurrentBlock();
1095 if(count($this->object->members_obj->getAllDeliveredFiles()))
1097 $this->tpl->addBlockFile(
"SPECIAL_BUTTONS",
"special_buttons",
"tpl.exc_download_all.html",
1098 "Modules/Exercise");
1099 $this->tpl->setCurrentBlock(
"download_all");
1100 $this->tpl->setVariable(
"BUTTON_DOWNLOAD_ALL", $this->lng->txt(
"download_all_returned_files"));
1101 $this->tpl->setVariable(
"FORMACTION",
1102 $this->ctrl->getLinkTarget($this,
"downloadAll"));
1103 $this->tpl->parseCurrentBlock();
1115 if (
$_GET[
"member_id"] !=
"")
1117 $this->
object->members_obj->setStatusFeedbackForMember(
$_GET[
"member_id"], 1);
1120 else if(count($_POST[
"member"]) > 0)
1122 include_once(
'./Services/User/classes/class.ilObjUser.php');
1124 foreach($_POST[
"member"] as $member => $val)
1127 $this->
object->members_obj->setStatusFeedbackForMember($member, 1);
1129 $logins = implode($logins,
",");
1130 ilUtil::redirect(
"ilias.php?baseClass=ilMailGUI&type=new&rcp_to=".$logins);
1134 $this->ctrl->redirect($this,
"members");
1146 foreach($this->object->members_obj->getMembers() as $member_id)
1149 $this->
object->members_obj->updateTutorDownloadTime($member_id);
1155 $members[$member_id] = $tmp_obj->getFirstname() .
" " . $tmp_obj->getLastname();
1160 $this->
object->file_obj->downloadAllDeliveredFiles($members);
1170 if(isset($_POST[
"cancel"]))
1172 $this->ctrl->redirect($this,
"members");
1175 if(isset($_POST[
"select"]))
1177 if(is_array($_POST[
"id"]))
1179 if(!$this->object->members_obj->assignMembers($_POST[
"id"]))
1187 $this->ctrl->redirect($this,
"members");
1190 $show_search =
true;
1193 $this->tpl->setVariable(
"F_ACTION",$this->ctrl->getLinkTarget($this,
"newMembers"));
1195 if($_POST[
"search_str"])
1209 $show_search =
false;
1213 if($_POST[
"search_for"] ==
'usr')
1221 $show_search =
false;
1225 if($_POST[
"obj_select"])
1227 if(count($_POST[
"obj"]))
1231 $show_search =
false;
1238 $this->lng->loadLanguageModule(
"content");
1239 $this->lng->loadLanguageModule(
"search");
1241 $search_for = array(
"usr" => $this->lng->txt(
"exc_users"),
1242 "grp" => $this->lng->txt(
"exc_groups"));
1243 #"role" => $this->lng->txt("!!Rollen"));
1246 foreach($search_for as $key => $value)
1248 $this->tpl->setCurrentBlock(
"USR_SEARCH_ROW");
1249 $this->tpl->setVariable(
"SEARCH_ROW_CHECK",
1251 $this->tpl->setVariable(
"SEARCH_ROW_TXT",$value);
1252 $this->tpl->parseCurrentBlock();
1254 $this->tpl->setVariable(
"SEARCH_ASSIGN_USR",$this->lng->txt(
"add_member"));
1255 $this->tpl->setVariable(
"SEARCH_SEARCH_TERM",$this->lng->txt(
"search_search_term"));
1256 $this->tpl->setVariable(
"SEARCH_FOR",$this->lng->txt(
"exc_search_for"));
1257 $this->tpl->setVariable(
"BTN1_VALUE",$this->lng->txt(
"search"));
1258 $this->tpl->setVariable(
"BTN2_VALUE",$this->lng->txt(
"cancel"));
1270 include_once
"./Modules/Group/classes/class.ilObjGroup.php";
1272 $all_members = array();
1273 foreach($a_result as $group)
1277 $members = $tmp_grp_obj->getGroupMemberIds();
1278 $all_members = array_merge($all_members,$members);
1281 $all_members = array_unique($all_members);
1282 foreach($all_members as $member)
1284 $result[] = array(
"id" => $member);
1293 include_once
"./classes/class.ilObjectFactory.php";
1295 foreach($a_result as $obj)
1298 $this->tpl->setCurrentBlock(
"OBJ_SELECT_ROW");
1299 $this->tpl->setVariable(
"OBJ_ROW_TITLE",$tmp_obj->getTitle());
1300 $this->tpl->setVariable(
"OBJ_ROW_ID",$tmp_obj->getRefId());
1301 $this->tpl->setVariable(
"OBJ_ROW_DESCRIPTION",$tmp_obj->getDescription());
1302 $this->tpl->parseCurrentBlock();
1306 $this->tpl->setCurrentBlock(
"OBJ_SELECT");
1307 $this->tpl->setVariable(
"OBJ_SELECT_TITLE",$this->lng->txt(
"title"));
1308 $this->tpl->setVariable(
"OBJ_SELECT_DESCRIPTION",$this->lng->txt(
"description"));
1310 $this->tpl->setVariable(
"OBJ_BTN1_VALUE",$this->lng->txt(
"select"));
1311 $this->tpl->setVariable(
"OBJ_BTN2_VALUE",$this->lng->txt(
"cancel"));
1312 $this->tpl->parseCurrentBlock();
1317 include_once
"./classes/class.ilObjectFactory.php";
1318 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1321 foreach($a_result as
$user)
1323 array_push($ids, $user[
"id"]);
1327 $this->tpl->setCurrentBlock(
"USR_SELECT_ROW");
1328 $this->tpl->setVariable(
"ROW_LOGIN",$tmp_obj->getLogin());
1329 $this->tpl->setVariable(
"NAME_ID",
"id_".$tmp_obj->getId());
1330 $this->tpl->setVariable(
"ROW_ID",$tmp_obj->getId());
1331 $this->tpl->setVariable(
"ROW_FIRSTNAME",$tmp_obj->getFirstname());
1332 $this->tpl->setVariable(
"ROW_LASTNAME",$tmp_obj->getLastname());
1333 $this->tpl->parseCurrentBlock();
1338 $this->tpl->setCurrentBlock(
"USR_SELECT");
1339 $this->tpl->setVariable(
"SELECT_LOGIN",$this->lng->txt(
"login"));
1340 $this->tpl->setVariable(
"SELECT_FIRSTNAME",$this->lng->txt(
"firstname"));
1341 $this->tpl->setVariable(
"SELECT_LASTNAME",$this->lng->txt(
"lastname"));
1343 $this->tpl->setVariable(
"BTN1_VALUE",$this->lng->txt(
"assign"));
1344 $this->tpl->setVariable(
"BTN2_VALUE",$this->lng->txt(
"cancel"));
1345 $this->tpl->setVariable(
"JS_VARNAME",
"id");
1347 $this->tpl->setVariable(
"TXT_CHECKALL",$this->lng->txt(
"check_all"));
1348 $this->tpl->setVariable(
"TXT_UNCHECKALL",$this->lng->txt(
"uncheck_all"));
1350 $this->tpl->parseCurrentBlock();
1354 include_once(
"./classes/class.ilSearch.php");
1356 $this->lng->loadLanguageModule(
"content");
1359 $search->setPerformUpdate(
false);
1361 $search->setCombination(
"and");
1362 $search->setSearchFor(array(0 => $a_search_for));
1363 $search->setSearchType(
'new');
1366 if($search->validate($message))
1368 $search->performSearch();
1373 $this->ctrl->redirect($this,
"newMembers");
1375 return $search->getResultByType($a_search_for);
1380 if(is_array($_POST[
"member"]))
1382 foreach($_POST[
"member"] as $usr_id => $member)
1384 $this->
object->members_obj->deassignMember($usr_id);
1399 if(!isset($_POST[
'comments_value']))
1404 $this->
object->members_obj->setNoticeForMember(
$_GET[
"member_id"],
1412 return $this->
object->members_obj->getNoticeByMember($member_id);
1419 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
1424 $saved_for = array();
1426 foreach($_POST[
"id"] as $key => $value)
1428 if (count($_POST[
"member"]) > 0 && $_POST[
"member"][$key] !=
"1")
1434 if (count($_POST[
"member"]) > 0)
1437 $saved_for[] = $uname[
"lastname"].
", ".$uname[
"firstname"];
1441 $this->
object->members_obj->setStatusForMember($key, $_POST[
"status"][$key]);
1443 $this->
object->members_obj->setNoticeForMember($key,
ilUtil::stripSlashes($_POST[
"notice"][$key]));
1448 $this->
object->members_obj->updateStatusTimeForMember($key);
1452 $marks_obj =
new ilLPMarks($this->object->getId(),$key);
1455 $marks_obj->update();
1457 if (count($saved_for) > 0)
1459 $save_for_str =
"(".implode($saved_for,
" - ").
")";
1461 ilUtil::sendInfo($this->lng->txt(
"exc_status_saved").
" ".$save_for_str,
true);
1470 for($i=0; $i<24; $i++)
1472 $hours[$i] = $i < 10 ?
"0".$i : $i;
1477 for($i=0;$i<60;$i++)
1479 $minutes[$i] = $i < 10 ?
"0".$i : $i;
1484 for($i=1; $i<32; $i++)
1486 $days[$i] = $i < 10 ?
"0".$i : $i;
1491 for($i=1; $i<13; $i++)
1493 $month[$i] = $i < 10 ?
"0".$i : $i;
1498 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
1508 foreach($a_result as
$user)
1510 if(!$this->object->members_obj->isAssigned($user[
"id"]))
1512 $filtered[] =
$user;
1516 return $filtered ? $filtered : array();
1526 global $ilAccess,$ilUser;
1528 $next_class = strtolower($this->ctrl->getNextClass());
1529 if ($ilAccess->checkAccess(
"visible",
"", $this->object->getRefId()))
1531 $force_active = ($next_class ==
"ilinfoscreengui")
1534 $tabs_gui->addTarget(
"info_short",
1535 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
1537 "ilinfoscreengui",
"", $force_active);
1545 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
1547 $tabs_gui->addTarget(
"exc_your_submission",
1548 $this->ctrl->getLinkTarget($this,
"deliver"),
1553 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
1555 $tabs_gui->addTarget(
"edit_properties",
1556 $this->ctrl->getLinkTarget($this,
'edit'),
1559 $tabs_gui->addTarget(
"members",
1560 $this->ctrl->getLinkTarget($this,
'members'),
1561 array(
"members",
"newMembers",
"newmembers"),
"");
1565 $save_sort_order =
$_GET[
"sort_order"];
1566 $save_sort_by =
$_GET[
"sort_by"];
1567 $save_offset =
$_GET[
"offset"];
1570 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
1573 $tabs_gui->addTarget(
'learning_progress',
1574 $this->ctrl->getLinkTargetByClass(array(
'ilobjexercisegui',
'illearningprogressgui'),
''),
1576 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
1579 $_GET[
"sort_order"] = $save_sort_order;
1580 $_GET[
"sort_by"] = $save_sort_by;
1581 $_GET[
"offset"] = $save_offset;
1584 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->ref_id))
1586 $tabs_gui->addTarget(
"perm_settings",
1587 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
1588 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1596 $next_class = $this->ctrl->getNextClass($this);
1597 $cmd = $this->ctrl->getCmd();
1603 case "ilinfoscreengui":
1607 case 'ilpermissiongui':
1608 include_once(
"./classes/class.ilPermissionGUI.php");
1610 $ret =& $this->ctrl->forwardCommand($perm_gui);
1613 case "illearningprogressgui":
1614 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
1617 $this->object->getRefId(),
1618 $_GET[
'user_id'] ?
$_GET[
'user_id'] : $ilUser->getId());
1619 $this->ctrl->forwardCommand($new_gui);
1620 $this->tabs_gui->setTabActive(
'learning_progress');
1623 case 'ilrepositorysearchgui':
1624 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
1626 $rep_search->setCallback($this,
'addMembersObject');
1629 $this->tabs_gui->setTabActive(
'members');
1630 $this->ctrl->setReturn($this,
'members');
1631 $ret =& $this->ctrl->forwardCommand($rep_search);
1632 #$this->__setSubTabs('members');
1633 #$this->tabs_gui->setSubTabActive('members');
1640 $cmd =
"infoScreen";
1660 $this->ctrl->setCmd(
"showSummary");
1661 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1670 global $ilAccess, $ilUser;
1674 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1677 $info->enablePrivateNotes();
1679 $info->enableNews();
1680 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1682 $info->enableNewsEditing();
1683 $info->setBlockProperty(
"news",
"settings",
true);
1690 $info->addSection($this->lng->txt(
"exc_instruction"));
1691 $info->addProperty(
"",
1692 nl2br($this->object->getInstruction()));
1695 $info->addSection($this->lng->txt(
"exc_schedule"));
1696 $info->addProperty($this->lng->txt(
"exc_edit_until"),
1699 if ($this->object->getTimestamp()-time() <= 0)
1701 $time_str = $this->lng->txt(
"exc_time_over_short");
1707 unset($time_diff[
'seconds']);
1710 if (isset($time_diff[
'days']))
1712 unset($time_diff[
'minutes']);
1716 if (isset($time_diff[
'months']))
1718 unset($time_diff[
'hours']);
1723 $info->addProperty($this->lng->txt(
"exc_time_to_send"),
1724 "<b>".$time_str.
"</b>");
1727 if ($ilAccess->checkAccess(
"read",
"", $this->ref_id))
1729 $files = $this->
object->getFiles();
1732 $info->addSection($this->lng->txt(
"exc_files"));
1735 $this->ctrl->setParameter($this,
"file", urlencode($file[
"name"]));
1736 $info->addProperty($file[
"name"],
1737 $this->lng->txt(
"download"),
1738 $this->ctrl->getLinkTarget($this,
"downloadFile"));
1739 $this->ctrl->setParameter($this,
"file",
"");
1745 if ($ilAccess->checkAccess(
"read",
"", $this->ref_id))
1748 $info->addSection($this->lng->txt(
"exc_your_submission"));
1749 $delivered_files = $this->
object->getDeliveredFiles($ilUser->id);
1751 foreach($delivered_files as
$file)
1753 $titles[] = $file[
"filetitle"];
1755 $files_str = implode($titles,
", ");
1756 if ($files_str ==
"")
1758 $files_str = $this->lng->txt(
"message_no_delivered_files");
1760 $info->addProperty($this->lng->txt(
"exc_files_returned"),
1762 $last_sub = $this->
object->getLastSubmission($ilUser->getId());
1772 $info->addProperty($this->lng->txt(
"exc_last_submission"),
1776 include_once(
"Services/Tracking/classes/class.ilLPMarks.php");
1780 if ($lpcomment !=
"" || $mark !=
"" || $status !=
"notgraded")
1782 $info->addSection($this->lng->txt(
"exc_feedback_from_tutor"));
1783 if ($lpcomment !=
"")
1785 $info->addProperty($this->lng->txt(
"exc_comment"),
1790 $info->addProperty($this->lng->txt(
"exc_mark"),
1796 $info->addProperty($this->lng->txt(
"status"),
1797 $this->lng->txt(
"message_no_delivered_files"));
1800 if ($status !=
"notgraded")
1802 $info->addProperty($this->lng->txt(
"status"),
1803 $this->lng->txt(
"exc_".$status));
1809 $this->ctrl->forwardCommand($info);
1822 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
1824 $_GET[
"ref_id"] = $a_target;
1825 $_GET[
"cmd"] =
"infoScreen";
1826 $_GET[
"baseClass"] =
"ilExerciseHandlerGUI";
1827 include(
"ilias.php");
1830 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1832 $_GET[
"cmd"] =
"frameset";
1833 $_GET[
"target"] =
"";
1834 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
1837 include(
"repository.php");
1841 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
1851 if (is_object($this->
object))
1853 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);