5 require_once
"classes/class.ilObjectGUI.php";
30 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
32 $lng->loadLanguageModule(
"exercise");
33 $lng->loadLanguageModule(
"exc");
34 $this->ctrl->saveParameter($this,
35 array(
"ass_id",
"part_id",
"fsmode"));
37 if (
$_GET[
"ass_id"] > 0)
39 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
46 return $this->files ? $this->files : array();
51 $this->files = $a_files;
58 $next_class = $this->ctrl->getNextClass($this);
59 $cmd = $this->ctrl->getCmd();
65 case "ilfilesystemgui":
68 if (
$_GET[
"fsmode"] ==
"feedback" ||
69 $_GET[
"fsmode"] ==
"feedbackpart")
71 $ilCtrl->saveParameter($this, array(
"member_id"));
74 $ilTabs->clearTargets();
76 if (
$_GET[
"fsmode"] !=
"feedbackpart")
78 $ilTabs->setBackTarget($lng->txt(
"back"),
79 $ilCtrl->getLinkTarget($this,
"members"));
83 $ilTabs->setBackTarget($lng->txt(
"back"),
84 $ilCtrl->getLinkTarget($this,
"showParticipant"));
86 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
89 include_once(
"./classes/class.ilFileSystemGUI.php");
91 $fs_gui->
setTableId(
"excfbfil".(
int)$_GET[
"ass_id"].
"_".(
int)$_GET[
"member_id"]);
92 $fs_gui->setAllowDirectories(
false);
93 include_once(
"./Services/User/classes/class.ilUserUtil.php");
94 $fs_gui->setTitle($lng->txt(
"exc_fb_files").
" - ".
97 $pcommand = $fs_gui->getLastPerformedCommand();
98 if ($pcommand[
"cmd"] ==
"create_file")
100 $this->
object->sendFeedbackFileNotification($pcommand[
"name"], (
int) $_GET[
"member_id"],
101 (
int) $_GET[
"ass_id"]);
103 $ret = $this->ctrl->forwardCommand($fs_gui);
108 $ilTabs->activateTab(
"ass_files");
109 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
112 include_once(
"./classes/class.ilFileSystemGUI.php");
115 $fs_gui->setAllowDirectories(
false);
116 $ret = $this->ctrl->forwardCommand($fs_gui);
120 case "ilinfoscreengui":
121 $ilTabs->activateTab(
"info");
125 case 'ilpermissiongui':
126 $ilTabs->activateTab(
"permissions");
127 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
129 $ret =& $this->ctrl->forwardCommand($perm_gui);
132 case "illearningprogressgui":
133 $ilTabs->activateTab(
"learning_progress");
134 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
137 $this->object->getRefId(),
138 $_GET[
'user_id'] ?
$_GET[
'user_id'] : $ilUser->getId());
139 $this->ctrl->forwardCommand($new_gui);
140 $this->tabs_gui->setTabActive(
'learning_progress');
143 case 'ilrepositorysearchgui':
144 $ilTabs->activateTab(
"grades");
145 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
147 $rep_search->setCallback($this,
'addMembersObject');
150 $this->tabs_gui->setTabActive(
'members');
151 $this->ctrl->setReturn($this,
'members');
152 $ret =& $this->ctrl->forwardCommand($rep_search);
153 #$this->__setSubTabs('members');
154 #$this->tabs_gui->setSubTabActive('members');
157 case 'ilobjectcopygui':
158 $ilCtrl->saveParameter($this,
'new_type');
159 $ilCtrl->setReturnByClass(get_class($this),
'create');
161 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
164 $this->ctrl->forwardCommand($cp);
169 $ilTabs->activateTab(
"export");
170 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
172 $exp_gui->addFormat(
"xml");
173 $ret = $this->ctrl->forwardCommand($exp_gui);
203 $this->tpl->setVariable(
"EDIT_FORM", $this->form_gui->getHtml());
208 $this->tpl->setVariable(
"IMPORT", $this->form->getHTML());
221 $lng->loadLanguageModule(
"exc");
223 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
225 $this->form->setTarget(
"_top");
228 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
231 $fi->setRequired(
true);
232 $this->form->addItem($fi);
234 $this->form->addCommandButton(
"importFile", $lng->txt(
"import"));
235 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
236 $this->form->setTitle($lng->txt($a_new_type.
"_import"));
237 $ilCtrl->setParameter($this,
"new_type", $a_new_type);
239 $this->form->setFormAction($ilCtrl->getFormAction($this));
254 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
256 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
258 $this->ctrl->setParameter($this,
"new_type", $new_type);
260 if ($this->form->checkInput())
263 include_once(
"./Services/Export/classes/class.ilImport.php");
265 $new_id = $imp->importObject($newObj, $_FILES[
"importfile"][
"tmp_name"],
266 $_FILES[
"importfile"][
"name"], $new_type);
271 $newObj->createReference();
272 $newObj->putInTree($_GET[
"ref_id"]);
273 $newObj->setPermissions($_GET[
"ref_id"]);
276 $this->ctrl->returnToParent($this);
281 $this->form->setValuesByPost();
282 $tpl->setContent($this->form->getHtml());
301 if (count(
$_POST[
"delivered"]))
304 $ilUser->getId(),
$_POST[
"delivered"]);
310 $ilCtrl->redirect($this,
"submissionScreen");
323 $this->tabs_gui->setTabActive(
"content");
326 if (mktime() > $this->ass->getDeadline())
329 $ilCtrl->redirect($this,
"submissionScreen");
332 if (!is_array(
$_POST[
"delivered"]) || count(
$_POST[
"delivered"]) == 0)
335 $ilCtrl->redirect($this,
"submissionScreen");
339 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
341 $cgui->setFormAction($ilCtrl->getFormAction($this));
342 $cgui->setHeaderText($lng->txt(
"info_delete_sure"));
343 $cgui->setCancel($lng->txt(
"cancel"),
"submissionScreen");
344 $cgui->setConfirm($lng->txt(
"delete"),
"deleteDelivered");
349 foreach (
$_POST[
"delivered"] as $i)
355 if ($f[
"returned_id"] == $i)
360 $cgui->addItem(
"delivered[]", $i,
$title);
363 $tpl->setContent($cgui->getHTML());
379 if (mktime() > $this->ass->getDeadline())
382 $ilCtrl->redirect($this,
"submissionScreen");
385 if (count(
$_POST[
"delivered"]) && mktime() < $this->ass->getDeadline())
387 $this->
object->deleteDeliveredFiles($this->object->getId(), (int)
$_GET[
"ass_id"],
388 $_POST[
"delivered"], $ilUser->id);
395 $ilCtrl->redirect($this,
"submissionScreen");
406 require_once
"./Services/Utilities/classes/class.ilUtil.php";
410 $this->tabs_gui->setTabActive(
"content");
413 if (mktime() > $this->ass->getDeadline())
420 include_once(
"./Modules/Exercise/classes/class.ilExcDeliveredFilesTableGUI.php");
422 $this->tpl->setVariable(
"DELIVERED_FILES_TABLE",
$tab->getHTML());
424 if (mktime() < $this->ass->getDeadline())
427 $this->tpl->setVariable(
"UPLOAD_SINGLE_FORM", $this->form->getHTML());
430 $this->tpl->setVariable(
"UPLOAD_MULTI_FORM", $this->form->getHTML());
441 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
445 include_once(
"./Services/Form/classes/class.ilFileWizardInputGUI.php");
449 $this->form->addItem($fi);
451 $this->form->addCommandButton(
"deliverFile", $lng->txt(
"upload"));
453 $this->form->setTitle($lng->txt(
"file_add"));
454 $this->form->setFormAction($ilCtrl->getFormAction($this));
464 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
468 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
471 $this->form->addItem($fi);
473 $this->form->addCommandButton(
"deliverUnzip", $lng->txt(
"upload"));
475 $this->form->setTitle($lng->txt(
"header_zip"));
476 $this->form->setFormAction($ilCtrl->getFormAction($this));
489 foreach ($_FILES[
"deliver"][
"name"] as $k => $v)
492 "name" => $_FILES[
"deliver"][
"name"][$k],
493 "type" => $_FILES[
"deliver"][
"type"][$k],
494 "tmp_name" => $_FILES[
"deliver"][
"tmp_name"][$k],
495 "error" => $_FILES[
"deliver"][
"error"][$k],
496 "size" => $_FILES[
"deliver"][
"size"][$k],
498 if(!$this->object->deliverFile(
$file, (
int)
$_GET[
"ass_id"], $ilUser->id))
512 $ilCtrl->redirect($this,
"submissionScreen");
524 if (preg_match(
"/zip/",$_FILES[
"deliver"][
"type"]) == 1)
526 if($this->object->processUploadedFile($_FILES[
"deliver"][
"tmp_name"],
"deliverFile",
false,
527 (
int)
$_GET[
"ass_id"]))
533 $ilCtrl->redirect($this,
"submissionScreen");
541 global $rbacsystem, $ilUser;
553 $this->ctrl->redirect($this,
"view");
557 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
559 $files = $storage->getFeedbackFiles($ilUser->getId());
561 foreach(
$files as $fb_file)
563 if($fb_file == urldecode(
$file))
571 echo
"FILE DOES NOT EXIST";
577 $not_started_yet =
false;
578 if ($ass->getStartTime() > 0 && time() - $ass->getStartTime() <= 0)
580 $not_started_yet =
true;
584 if (!$not_started_yet)
586 $p = $storage->getFeedbackFilePath($ilUser->getId(), urldecode(
$file));
610 $this->ctrl->redirect($this,
"view");
614 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
619 if($lfile[
"name"] == urldecode(
$file))
627 echo
"FILE DOES NOT EXIST";
633 $not_started_yet =
false;
634 if ($ass->getStartTime() > 0 && time() - $ass->getStartTime() <= 0)
636 $not_started_yet =
true;
640 if (!$not_started_yet)
642 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
644 $p = $storage->getAssignmentFilePath(urldecode(
$file));
661 if ($this->form_gui->checkInput())
668 $newObj->setTitle($this->form_gui->getInput(
"title"));
669 $newObj->setDescription($this->form_gui->getInput(
"desc"));
680 ilUtil::redirect(
"ilias.php?baseClass=ilExerciseHandlerGUI&ref_id=".$newObj->getRefId().
"&cmd=addAssignment");
684 $this->form_gui->setValuesByPost();
694 global $rbacsystem,
$tpl, $ilTabs;
696 $ilTabs->activateTab(
"settings");
705 $this->tpl->setVariable(
"EDIT_FORM", $this->form_gui->getHtml());
727 $lng->loadLanguageModule(
"form");
728 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
730 $this->form_gui->setTableWidth(
"600px");
731 if ($a_mode ==
"edit")
733 $this->form_gui->setTitle($lng->txt(
"exc_edit_exercise"));
737 $this->form_gui->setTitle($lng->txt(
"exc_new"));
740 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
744 if ($a_mode ==
"create")
747 $type_input->setValue(
"exc");
748 $this->form_gui->addItem($type_input);
754 $title_input->setMaxLength(128);
755 $this->form_gui->addItem($title_input);
759 $this->form_gui->addItem($desc_input);
773 if ($a_mode ==
"edit")
777 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"exc_show_submissions"),
"show_submissions");
778 $cb->
setInfo($this->lng->txt(
"exc_show_submissions_info"));
779 $this->form_gui->addItem($cb);
785 $lng->txt(
"exc_pass_all_info"));
786 $radg->addOption($op1);
787 $op2 =
new ilRadioOption($lng->txt(
"exc_pass_minimum_nr"),
"nr",
788 $lng->txt(
"exc_pass_minimum_nr_info"));
789 $radg->addOption($op2);
794 $ni->setMaxLength(4);
795 $ni->setRequired(
true);
796 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
798 $min = max($mand, 1);
799 $ni->setMinValue($min);
800 $op2->addSubItem($ni);
802 $this->form_gui->addItem($radg);
805 $cbox =
new ilCheckboxInputGUI($lng->txt(
"exc_submission_notification"),
"notification");
806 $cbox->
setInfo($lng->txt(
"exc_submission_notification_info"));
807 $this->form_gui->addItem($cbox);
831 if ($a_mode ==
"create")
833 $this->form_gui->addCommandButton(
"save", $lng->txt(
"save"));
834 $this->form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
838 $this->form_gui->addCommandButton(
"update", $lng->txt(
"save"));
839 $this->form_gui->addCommandButton(
"cancelEdit", $lng->txt(
"cancel"));
850 $values[
"title"] = $this->
object->getTitle();
851 $values[
"desc"] = $this->
object->getLongDescription();
852 $values[
"pass_mode"] = $this->
object->getPassMode();
853 $values[
"show_submissions"] = $this->
object->getShowSubmissions();
855 if ($this->object->getPassMode() ==
"nr")
857 $values[
"pass_nr"] = $this->
object->getPassNr();
861 include_once
"./Services/Notification/classes/class.ilNotification.php";
864 $this->form_gui->setValuesByArray($values);
878 global $rbacsystem,
$tpl, $ilUser;
883 if ($this->form_gui->checkInput())
885 $this->
object->setTitle($this->form_gui->getInput(
"title"));
886 $this->
object->setDescription($this->form_gui->getInput(
"desc"));
887 $this->
object->setPassMode($this->form_gui->getInput(
"pass_mode"));
888 $this->
object->setShowSubmissions($this->form_gui->getInput(
"show_submissions"));
889 if ($this->object->getPassMode() ==
"nr")
891 $this->
object->setPassNr($this->form_gui->getInput(
"pass_nr"));
911 $this->
object->update();
913 include_once
"./Services/Notification/classes/class.ilNotification.php";
917 $this->ctrl->redirect($this,
"edit");
921 $this->form_gui->setValuesByPost();
922 $tpl->setContent($this->form_gui->getHTML());
932 $this->
object->deleteFiles(
$_POST[
"delete_file"]);
937 $this->update = $this->
object->update();
941 $this->ctrl->redirect($this,
"edit");
946 $this->ctrl->redirect($this,
"view");
955 if(!$this->object->addUploadedFile($_FILES[
"zipfile"],
true))
959 $this->ctrl->redirect($this,
"edit");
969 if(!$this->object->addUploadedFile($_FILES[
"file"]))
973 $this->ctrl->redirect($this,
"edit");
986 if (
$_POST[
"downloadReturned"])
988 $this->
object->members_obj->deliverReturnedFiles(key(
$_POST[
"downloadReturned"]));
1003 case "redirectFeedbackMail":
1007 case "delete_member":
1021 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId()) &&
1022 $this->object->getShowSubmissions() &&
1023 $this->
object->getTimestamp() - time() <= 0)
1033 $this->object->getId(), (int)
$_GET[
"ass_id"], (
int)
$_GET[
"member_id"]))
1035 $this->ctrl->redirect($this,
"members");
1048 $this->object->getId(), (int)
$_GET[
"ass_id"], (
int)
$_GET[
"member_id"],
true))
1050 $this->ctrl->redirect($this,
"members");
1063 if(!count(
$_POST[
'user']))
1069 if(!$this->object->members_obj->assignMembers(
$_POST[
"user"]))
1079 $this->ctrl->redirect($this,
"members");
1091 $ilTabs->activateTab(
"grades");
1093 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
1099 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
1102 if (
$_GET[
"ass_id"] ==
"")
1105 $_GET[
"ass_id"] = $a[
"id"];
1109 if (count($ass) > 1)
1112 foreach ($ass as $a)
1114 $options[$a[
"id"]] = $a[
"title"];
1116 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1119 $si->setValue(
$_GET[
"ass_id"]);
1120 $ilToolbar->addInputItem($si);
1122 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1123 $ilToolbar->addFormButton($this->lng->txt(
"exc_select_ass"),
1124 "selectAssignment");
1125 $ilToolbar->addSeparator();
1129 $ilToolbar->addButton($this->lng->txt(
"exc_add_participant"),
1130 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
1133 $parent_id = $tree->getParentId(
$_GET[
"ref_id"]);
1136 while ($parent_id != 1 && $type !=
"crs")
1138 $parent_id = $tree->getParentId($parent_id);
1144 $this->ctrl->setParameterByClass(
'ilRepositorySearchGUI',
"list_obj", $parent_obj_id);
1145 $this->lng->loadLanguageModule(
"exercise");
1147 $ilToolbar->addButton($this->lng->txt(
"exc_crs_add_members"),
1148 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'listUsers'));
1151 if (count($ass) > 0)
1153 include_once(
"./Modules/Exercise/classes/class.ilExerciseMemberTableGUI.php");
1155 $tpl->setContent($exc_tab->getHTML());
1171 $ilTabs->activateTab(
"grades");
1186 $ilTabs->activateTab(
"grades");
1190 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
1192 $members = $this->
object->members_obj->getMembers();
1194 if (count($members) == 0)
1201 foreach ($members as $mem_id)
1205 include_once(
"./Services/User/classes/class.ilObjUser.php");
1207 $mems[$mem_id] = $name;
1213 if (
$_GET[
"part_id"] ==
"" && count($mems) > 0)
1215 $_GET[
"part_id"] = key($mems);
1219 if (count($mems) > 1)
1222 foreach ($mems as $k => $m)
1225 $m[
"lastname"].
", ".$m[
"firstname"].
" [".$m[
"login"].
"]";
1227 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1230 $si->setValue(
$_GET[
"part_id"]);
1231 $ilToolbar->addInputItem($si);
1233 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1234 $ilToolbar->addFormButton($this->lng->txt(
"exc_select_part"),
1235 "selectParticipant");
1238 if (count($mems) > 0)
1240 include_once(
"./Modules/Exercise/classes/class.ilExParticipantTableGUI.php");
1242 $this->
object,
$_GET[
"part_id"]);
1243 $tpl->setContent($part_tab->getHTML());
1258 $ilTabs->activateTab(
"grades");
1273 $ilTabs->activateTab(
"grades");
1276 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
1278 $mems = $mem_obj->getMembers();
1280 if (count($mems) > 0)
1282 $ilToolbar->addButton($lng->txt(
"exc_export_excel"),
1283 $ilCtrl->getLinkTarget($this,
"exportExcel"));
1286 include_once(
"./Modules/Exercise/classes/class.ilExGradesTableGUI.php");
1288 $this->
object, $mem_obj);
1289 $tpl->setContent($grades_tab->getHTML());
1299 if (
$_GET[
"member_id"] !=
"")
1304 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
1307 else if(count(
$_POST[
"member"]) > 0)
1309 include_once(
'./Services/User/classes/class.ilObjUser.php');
1311 foreach(
$_POST[
"member"] as $member => $val)
1316 $logins = implode($logins,
",");
1318 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
1323 $this->ctrl->redirect($this,
"members");
1335 foreach($this->object->members_obj->getMembers() as $member_id)
1339 (int)
$_GET[
"ass_id"], $member_id);
1345 $members[$member_id] = $tmp_obj->getFirstname() .
" " . $tmp_obj->getLastname();
1351 (int)
$_GET[
"ass_id"], $members);
1364 include_once
"./Modules/Group/classes/class.ilObjGroup.php";
1366 $all_members = array();
1367 foreach($a_result as $group)
1371 $members = $tmp_grp_obj->getGroupMemberIds();
1372 $all_members = array_merge($all_members,$members);
1375 $all_members = array_unique($all_members);
1376 foreach($all_members as $member)
1378 $result[] = array(
"id" => $member);
1387 include_once
"./classes/class.ilObjectFactory.php";
1389 foreach($a_result as $obj)
1392 $this->tpl->setCurrentBlock(
"OBJ_SELECT_ROW");
1393 $this->tpl->setVariable(
"OBJ_ROW_TITLE",$tmp_obj->getTitle());
1394 $this->tpl->setVariable(
"OBJ_ROW_ID",$tmp_obj->getRefId());
1395 $this->tpl->setVariable(
"OBJ_ROW_DESCRIPTION",$tmp_obj->getDescription());
1396 $this->tpl->parseCurrentBlock();
1400 $this->tpl->setCurrentBlock(
"OBJ_SELECT");
1401 $this->tpl->setVariable(
"OBJ_SELECT_TITLE",$this->lng->txt(
"title"));
1402 $this->tpl->setVariable(
"OBJ_SELECT_DESCRIPTION",$this->lng->txt(
"description"));
1404 $this->tpl->setVariable(
"OBJ_BTN1_VALUE",$this->lng->txt(
"select"));
1405 $this->tpl->setVariable(
"OBJ_BTN2_VALUE",$this->lng->txt(
"cancel"));
1406 $this->tpl->parseCurrentBlock();
1418 if(!count(
$_POST[
"member"]))
1424 $this->
object->sendAssignment($this->object->getId(),
1428 $ilCtrl->redirect($this,
"members");
1439 $ilTabs->activateTab(
"grades");
1441 if (!is_array(
$_POST[
"member"]) || count(
$_POST[
"member"]) == 0)
1444 $ilCtrl->redirect($this,
"members");
1448 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1450 $cgui->setFormAction($ilCtrl->getFormAction($this));
1451 $cgui->setHeaderText($lng->txt(
"exc_msg_sure_to_deassign_participant"));
1452 $cgui->setCancel($lng->txt(
"cancel"),
"members");
1453 $cgui->setConfirm($lng->txt(
"remove"),
"deassignMembers");
1455 include_once(
"./Services/User/classes/class.ilUserUtil.php");
1456 foreach (
$_POST[
"member"] as $k => $m)
1458 $cgui->addItem(
"member[$k]", $m,
1462 $tpl->setContent($cgui->getHTML());
1475 if(is_array(
$_POST[
"member"]))
1479 $this->
object->members_obj->deassignMember(
$usr_id);
1482 $ilCtrl->redirect($this,
"members");
1487 $ilCtrl->redirect($this,
"members");
1495 if(!isset(
$_POST[
'comments_value']))
1500 $this->
object->members_obj->setNoticeForMember(
$_GET[
"member_id"],
1525 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
1529 $saved_for = array();
1531 foreach(
$_POST[
"id"] as $key => $value)
1535 if (count(
$_POST[
"member"]) > 0 &&
$_POST[
"member"][$key] !=
"1")
1541 if (count(
$_POST[
"member"]) > 0)
1544 $saved_for[] = $uname[
"lastname"].
", ".$uname[
"firstname"];
1550 $ass_id = (int)
$_GET[
"ass_id"];
1551 $user_id = (int) $key;
1555 $ass_id = (int) $key;
1556 $user_id = (int)
$_GET[
"part_id"];
1575 if (count($saved_for) > 0)
1577 $save_for_str =
"(".implode($saved_for,
" - ").
")";
1582 $ilCtrl->redirect($this,
"members");
1586 $ilCtrl->redirect($this,
"showParticipant");
1595 for($i=0; $i<24; $i++)
1597 $hours[$i] = $i < 10 ?
"0".$i : $i;
1602 for($i=0;$i<60;$i++)
1604 $minutes[$i] = $i < 10 ?
"0".$i : $i;
1609 for($i=1; $i<32; $i++)
1611 $days[$i] = $i < 10 ?
"0".$i : $i;
1616 for($i=1; $i<13; $i++)
1618 $month[$i] = $i < 10 ?
"0".$i : $i;
1623 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
1633 foreach($a_result as
$user)
1635 if(!$this->object->members_obj->isAssigned($user[
"id"]))
1637 $filtered[] =
$user;
1641 return $filtered ? $filtered : array();
1653 $ilTabs->addSubTab(
"assignment", $lng->txt(
"exc_assignment_view"),
1654 $ilCtrl->getLinkTarget($this,
"members"));
1655 $ilTabs->addSubTab(
"participant", $lng->txt(
"exc_participant_view"),
1656 $ilCtrl->getLinkTarget($this,
"showParticipant"));
1657 $ilTabs->addSubTab(
"grades", $lng->txt(
"exc_grades_overview"),
1658 $ilCtrl->getLinkTarget($this,
"showGradesOverview"));
1659 $ilTabs->activateSubTab($a_activate);
1671 $ilTabs->addSubTab(
"content", $lng->txt(
"view"),
1672 $ilCtrl->getLinkTarget($this,
"showOverview"));
1673 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
1675 $ilTabs->addSubTab(
"list_assignments", $lng->txt(
"edit"),
1676 $ilCtrl->getLinkTarget($this,
"listAssignments"));
1678 $ilTabs->activateSubTab($a_activate);
1689 global $ilAccess, $ilUser,
$lng;
1691 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
1693 $tabs_gui->addTab(
"content",
1694 $lng->txt(
"exc_assignments"),
1695 $this->ctrl->getLinkTarget($this,
"showOverview"));
1698 $next_class = strtolower($this->ctrl->getNextClass());
1699 if ($ilAccess->checkAccess(
"visible",
"", $this->object->getRefId()))
1701 $tabs_gui->addTab(
"info",
1702 $lng->txt(
"info_short"),
1703 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
1707 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
1713 $tabs_gui->addTab(
"settings",
1714 $lng->txt(
"settings"),
1715 $this->ctrl->getLinkTarget($this,
'edit'));
1717 $tabs_gui->addTab(
"grades",
1718 $lng->txt(
"exc_submissions_and_grades"),
1719 $this->ctrl->getLinkTarget($this,
'members'));
1723 $save_sort_order =
$_GET[
"sort_order"];
1724 $save_sort_by =
$_GET[
"sort_by"];
1725 $save_offset =
$_GET[
"offset"];
1728 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
1731 $tabs_gui->addTab(
'learning_progress',
1732 $lng->txt(
'learning_progress'),
1733 $this->ctrl->getLinkTargetByClass(array(
'ilobjexercisegui',
'illearningprogressgui'),
''));
1736 $_GET[
"sort_order"] = $save_sort_order;
1737 $_GET[
"sort_by"] = $save_sort_by;
1738 $_GET[
"offset"] = $save_offset;
1741 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1743 $tabs_gui->addTab(
"export",
1744 $lng->txt(
"export"),
1745 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
1750 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->ref_id))
1752 $tabs_gui->addTab(
'permissions',
1753 $lng->txt(
"perm_settings"),
1754 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"));
1765 $this->ctrl->setCmd(
"showSummary");
1766 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1775 global $ilAccess, $ilUser, $ilTabs,
$lng;
1777 $ilTabs->activateTab(
"info");
1781 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1784 $info->enablePrivateNotes();
1786 $info->enableNews();
1787 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1789 $info->enableNewsEditing();
1790 $info->setBlockProperty(
"news",
"settings",
true);
1797 $info->addSection($this->lng->txt(
"exc_overview"));
1798 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
1802 foreach ($ass as $a)
1805 if ($a[
"mandatory"])
1810 $info->addProperty($lng->txt(
"exc_assignments"), $cnt);
1811 $info->addProperty($lng->txt(
"exc_mandatory"), $mcnt);
1812 if ($this->object->getPassMode() !=
"nr")
1814 $info->addProperty($lng->txt(
"exc_pass_mode"),
1815 $lng->txt(
"exc_msg_all_mandatory_ass"));
1819 $info->addProperty($lng->txt(
"exc_pass_mode"),
1820 sprintf($lng->txt(
"exc_msg_min_number_ass"), $this->
object->getPassNr()));
1824 include_once(
"Services/Tracking/classes/class.ilLPMarks.php");
1825 if ($ilAccess->checkAccess(
"read",
"", $this->ref_id))
1830 $st = $this->
object->determinStatusOfUser($ilUser->getId());
1831 $status = $st[
"overall_status"];
1832 if ($lpcomment !=
"" || $mark !=
"" || $status !=
"notgraded")
1834 $info->addSection($this->lng->txt(
"exc_feedback_from_tutor"));
1835 if ($lpcomment !=
"")
1837 $info->addProperty($this->lng->txt(
"exc_comment"),
1842 $info->addProperty($this->lng->txt(
"exc_mark"),
1852 if ($status !=
"notgraded")
1854 $img =
'<img border="0" src="'.ilUtil::getImagePath(
"scorm/".$status.
".gif").
'" '.
1855 ' alt="'.$lng->txt(
"exc_".$status).
'" title="'.$lng->txt(
"exc_".$status).
1856 '" style="vertical-align:middle;"/>';
1859 if ($st[
"failed_a_mandatory"])
1861 $add =
" (".$lng->txt(
"exc_msg_failed_mandatory").
")";
1863 else if ($status ==
"failed")
1865 $add =
" (".$lng->txt(
"exc_msg_missed_minimum_number").
")";
1867 $info->addProperty($this->lng->txt(
"status"),
1868 $img.
" ".$this->lng->txt(
"exc_".$status).$add);
1874 $this->ctrl->forwardCommand($info);
1887 if ($ilAccess->checkAccess(
"read",
"", $a_target))
1889 $_GET[
"ref_id"] = $a_target;
1890 $_GET[
"cmd"] =
"showOverview";
1891 $_GET[
"baseClass"] =
"ilExerciseHandlerGUI";
1892 include(
"ilias.php");
1895 else if ($ilAccess->checkAccess(
"visible",
"", $a_target))
1897 $_GET[
"ref_id"] = $a_target;
1898 $_GET[
"cmd"] =
"infoScreen";
1899 $_GET[
"baseClass"] =
"ilExerciseHandlerGUI";
1900 include(
"ilias.php");
1903 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1905 $_GET[
"cmd"] =
"frameset";
1906 $_GET[
"target"] =
"";
1907 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
1910 include(
"repository.php");
1914 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
1924 if (is_object($this->
object))
1926 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
1943 $ilTabs->activateTab(
"content");
1946 $ilToolbar->addButton($lng->txt(
"exc_add_assignment"),
1947 $ilCtrl->getLinkTarget($this,
"addAssignment"));
1949 include_once(
"./Modules/Exercise/classes/class.ilAssignmentsTableGUI.php");
1951 $tpl->setContent(
$t->getHTML());
1959 global
$tpl, $ilTabs;
1963 $ilTabs->activateTab(
"content");
1967 $tpl->setContent($this->form->getHTML());
1980 $lng->loadLanguageModule(
"form");
1981 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1983 $this->form->setTableWidth(
"600px");
1984 if ($a_mode ==
"edit")
1986 $this->form->setTitle($lng->txt(
"exc_edit_assignment"));
1990 $this->form->setTitle($lng->txt(
"exc_new_assignment"));
1992 $this->form->setFormAction($ilCtrl->getFormAction($this));
1997 $ti->setRequired(
true);
1998 $this->form->addItem($ti);
2002 $this->form->addItem($cb);
2006 $edit_date->setShowTime(
true);
2007 $cb->addSubItem($edit_date);
2012 $edit_date->setRequired(
true);
2013 $this->form->addItem($edit_date);
2017 $cb->
setInfo($this->lng->txt(
"exc_mandatory_info"));
2018 $cb->setChecked(
true);
2019 $this->form->addItem($cb);
2024 $this->form->addItem($desc_input);
2027 if ($a_mode ==
"create")
2030 $files->setFilenames(array(0 =>
''));
2031 $this->form->addItem(
$files);
2035 if ($a_mode ==
"create")
2037 $this->form->addCommandButton(
"saveAssignment", $lng->txt(
"save"));
2038 $this->form->addCommandButton(
"listAssignments", $lng->txt(
"cancel"));
2042 $this->form->addCommandButton(
"updateAssignment", $lng->txt(
"save"));
2043 $this->form->addCommandButton(
"listAssignments", $lng->txt(
"cancel"));
2057 $ilTabs->activateTab(
"content");
2061 if ($this->form->checkInput())
2063 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2066 $ass->setTitle(
$_POST[
"title"]);
2067 $ass->setInstruction(
$_POST[
"instruction"]);
2068 $ass->setExerciseId($this->object->getId());
2069 $ass->setMandatory(
$_POST[
"mandatory"]);
2071 if (
$_POST[
"start_time_cb"])
2074 $this->form->getItemByPostVar(
"start_time")->getDate();
2079 $ass->setStartTime(null);
2084 $this->form->getItemByPostVar(
"deadline")->getDate();
2090 $ass->uploadAssignmentFiles($_FILES[
"files"]);
2094 $ilCtrl->redirect($this,
"listAssignments");
2098 $this->form->setValuesByPost();
2099 $tpl->setContent($this->form->getHtml());
2113 $ilTabs->activateTab(
"ass_settings");
2117 $tpl->setContent($this->form->getHTML());
2129 $values[
"title"] = $ass->getTitle();
2130 if ($ass->getStartTime() > 0)
2132 $values[
"start_time_cb"] =
true;
2134 $values[
"mandatory"] = $ass->getMandatory();
2135 $values[
"instruction"] = $ass->getInstruction();
2137 $this->form->setValuesByArray($values);
2140 $ed_item = $this->form->getItemByPostVar(
"deadline");
2141 $ed_item->
setDate($edit_date);
2143 if ($ass->getStartTime() > 0)
2146 $ed_item = $this->form->getItemByPostVar(
"start_time");
2147 $ed_item->
setDate($edit_date);
2161 $ilTabs->activateTab(
"content");
2165 if ($this->form->checkInput())
2167 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2170 $ass->setTitle(
$_POST[
"title"]);
2171 $ass->setInstruction(
$_POST[
"instruction"]);
2172 $ass->setExerciseId($this->object->getId());
2173 $ass->setMandatory(
$_POST[
"mandatory"]);
2175 if (
$_POST[
"start_time_cb"])
2178 $this->form->getItemByPostVar(
"start_time")->getDate();
2183 $ass->setStartTime(null);
2188 $this->form->getItemByPostVar(
"deadline")->getDate();
2193 $ilCtrl->redirect($this,
"listAssignments");
2197 $this->form->setValuesByPost();
2198 $tpl->setContent($this->form->getHtml());
2212 $ilTabs->activateTab(
"content");
2215 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0)
2218 $ilCtrl->redirect($this,
"listAssignments");
2222 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
2224 $cgui->setFormAction($ilCtrl->getFormAction($this));
2225 $cgui->setHeaderText($lng->txt(
"exc_conf_del_assignments"));
2226 $cgui->setCancel($lng->txt(
"cancel"),
"listAssignments");
2227 $cgui->setConfirm($lng->txt(
"delete"),
"deleteAssignments");
2229 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2231 foreach (
$_POST[
"id"] as $i)
2236 $tpl->setContent($cgui->getHTML());
2250 if (is_array(
$_POST[
"id"]))
2252 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2253 foreach(
$_POST[
"id"] as $id)
2265 $ilCtrl->redirect($this,
"listAssignments");
2277 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2281 $ilCtrl->redirect($this,
"listAssignments");
2293 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2297 $ilCtrl->redirect($this,
"listAssignments");
2307 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2309 $tpl->setDescription(
"");
2311 $ilTabs->clearTargets();
2313 $ilTabs->setBackTarget($lng->txt(
"back"),
2314 $ilCtrl->getLinkTarget($this,
"listAssignments"));
2316 $ilTabs->addTab(
"ass_settings",
2317 $lng->txt(
"settings"),
2318 $ilCtrl->getLinkTarget($this,
"editAssignment"));
2320 $ilTabs->addTab(
"ass_files",
2322 $ilCtrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"));
2336 global
$tpl, $ilTabs, $ilUser;
2340 include_once(
"./Services/Tracking/classes/class.ilLearningProgress.php");
2342 $this->
object->getRefId(),
'exc');
2344 $ilTabs->activateTab(
"content");
2347 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2348 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
2350 $acc->setBehaviour(
"OneOpenSession");
2351 $acc->setId(
"exc_ow_".$this->object->getId());
2353 include_once(
"./Modules/Exercise/classes/class.ilExAssignmentGUI.php");
2356 foreach ($ass_data as $ass)
2358 $acc->addItem($ass_gui->getOverviewHeader($ass),
2359 $ass_gui->getOverviewBody($ass));
2362 $tpl->setContent($acc->getHTML());
2370 global
$tpl, $ilTabs;
2374 $ilTabs->activateTab(
"content");
2377 include_once(
"./Modules/Exercise/classes/class.ilPublicSubmissionsTableGUI.php");
2379 $this->
object, (
int)
$_GET[
"ass_id"]);
2380 $tpl->setContent(
$tab->getHTML());
2389 $this->
object->exportGradesExcel();
2401 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
2403 if (is_array(
$_POST[
"lcomment"]))
2405 foreach (
$_POST[
"lcomment"] as $k => $v)
2407 $marks_obj =
new ilLPMarks($this->object->getId(), (int) $k);
2410 $marks_obj->update();
2414 $ilCtrl->redirect($this,
"showGradesOverview");
2423 include_once
"./Services/Notification/classes/class.ilNotification.php";
2426 include_once
"./Modules/Exercise/classes/class.ilExerciseMailNotification.php";
2429 $not->setAssignmentId($assignment_id);
2430 $not->setRefId($this->ref_id);
2431 $not->setRecipients($users);