5 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
33 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
35 $lng->loadLanguageModule(
"exercise");
36 $lng->loadLanguageModule(
"exc");
37 $this->ctrl->saveParameter($this,
38 array(
"ass_id",
"part_id",
"fsmode"));
40 if (
$_GET[
"ass_id"] > 0)
42 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
49 return $this->files ? $this->files : array();
54 $this->files = $a_files;
61 $next_class = $this->ctrl->getNextClass($this);
62 $cmd = $this->ctrl->getCmd();
68 case "ilfilesystemgui":
71 if (
$_GET[
"fsmode"] ==
"feedback" ||
72 $_GET[
"fsmode"] ==
"feedbackpart")
74 $ilCtrl->saveParameter($this, array(
"member_id"));
77 $ilTabs->clearTargets();
79 if (
$_GET[
"fsmode"] !=
"feedbackpart")
81 $ilTabs->setBackTarget($lng->txt(
"back"),
82 $ilCtrl->getLinkTarget($this,
"members"));
86 $ilTabs->setBackTarget($lng->txt(
"back"),
87 $ilCtrl->getLinkTarget($this,
"showParticipant"));
92 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
96 include_once(
"./Services/User/classes/class.ilUserUtil.php");
97 $noti_rec_ids = array();
100 $team_id = $this->ass->getTeamId((
int)
$_GET[
"member_id"]);
101 $feedback_id =
"t".$team_id;
103 foreach($this->ass->getTeamMembers($team_id) as $team_user_id)
106 $noti_rec_ids[] = $team_user_id;
108 $fs_title = implode(
" / ", $fs_title);
112 $feedback_id = $noti_rec_ids = (int)
$_GET[
"member_id"];
116 include_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
117 $fs_gui =
new ilFileSystemGUI($fstorage->getFeedbackPath($feedback_id));
119 $fs_gui->setAllowDirectories(
false);
120 $fs_gui->setTitle($lng->txt(
"exc_fb_files").
" - ".
123 $pcommand = $fs_gui->getLastPerformedCommand();
124 if (is_array($pcommand) && $pcommand[
"cmd"] ==
"create_file")
126 $this->
object->sendFeedbackFileNotification($pcommand[
"name"],
127 $noti_rec_ids, (
int) $_GET[
"ass_id"]);
129 $ret = $this->ctrl->forwardCommand($fs_gui);
134 $ilTabs->activateTab(
"ass_files");
135 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
138 include_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
140 $fs_gui->
setTitle($lng->txt(
"exc_instruction_files"));
141 $fs_gui->setTableId(
"excassfil".
$_GET[
"ass_id"]);
142 $fs_gui->setAllowDirectories(
false);
143 $ret = $this->ctrl->forwardCommand($fs_gui);
147 case "ilinfoscreengui":
148 $ilTabs->activateTab(
"info");
152 case 'ilpermissiongui':
153 $ilTabs->activateTab(
"permissions");
154 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
156 $ret =& $this->ctrl->forwardCommand($perm_gui);
159 case "illearningprogressgui":
160 $ilTabs->activateTab(
"learning_progress");
161 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
164 $this->object->getRefId(),
165 $_GET[
'user_id'] ?
$_GET[
'user_id'] : $ilUser->getId());
166 $this->ctrl->forwardCommand($new_gui);
167 $this->tabs_gui->setTabActive(
'learning_progress');
170 case 'ilrepositorysearchgui':
171 $ilTabs->activateTab(
"grades");
172 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
176 $rep_search->setTitle($this->lng->txt(
"exc_add_participant"));
177 $rep_search->setCallback($this,
'addMembersObject');
180 $this->tabs_gui->setTabActive(
'members');
181 $this->ctrl->setReturn($this,
'members');
183 #$this->__setSubTabs('members');
184 #$this->tabs_gui->setSubTabActive('members');
188 $this->ctrl->saveParameterByClass(
'ilRepositorySearchGUI',
'ctx', 1);
190 $rep_search->setTitle($this->lng->txt(
"exc_team_member_add"));
191 $rep_search->setCallback($this,
'addTeamMemberActionObject');
195 $this->ctrl->setReturn($this,
'submissionScreenTeam');
197 $ret =& $this->ctrl->forwardCommand($rep_search);
200 case 'ilobjectcopygui':
201 $ilCtrl->saveParameter($this,
'new_type');
202 $ilCtrl->setReturnByClass(get_class($this),
'create');
204 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
207 $this->ctrl->forwardCommand($cp);
211 $ilTabs->activateTab(
"export");
212 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
214 $exp_gui->addFormat(
"xml");
215 $ret = $this->ctrl->forwardCommand($exp_gui);
218 case 'ilshoppurchasegui':
219 include_once
'./Services/Payment/classes/class.ilShopPurchaseGUI.php';
222 $this->ctrl->forwardCommand($sp);
225 case "ilcommonactiondispatchergui":
226 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
228 $this->ctrl->forwardCommand($gui);
231 case "ilcertificategui":
233 $this->tabs_gui->activateTab(
"settings");
234 $this->tabs_gui->activateSubTab(
"certificate");
235 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
236 include_once
"./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
238 $this->ctrl->forwardCommand($output_gui);
242 $this->ass->updatePeerReviewTimestamp((
int)
$_REQUEST[
"peer_id"]);
244 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
246 $rating_gui->setObject($this->ass->getId(),
"ass",
247 (int)$_REQUEST[
"peer_id"],
"peer");
248 $this->ctrl->forwardCommand($rating_gui);
249 $ilCtrl->redirect($this,
"editPeerReview");
293 $ilUser->getId(),
$_REQUEST[
"delivered"]);
299 $ilCtrl->redirect($this,
"submissionScreen");
312 $this->tabs_gui->clearTargets();
313 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
314 $this->ctrl->getLinkTarget($this,
"submissionScreen"));
319 if (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0))
322 $ilCtrl->redirect($this,
"submissionScreen");
325 if (!is_array(
$_POST[
"delivered"]) || count(
$_POST[
"delivered"]) == 0)
328 $ilCtrl->redirect($this,
"submissionScreen");
332 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
334 $cgui->setFormAction($ilCtrl->getFormAction($this));
335 $cgui->setHeaderText($lng->txt(
"info_delete_sure"));
336 $cgui->setCancel($lng->txt(
"cancel"),
"submissionScreen");
337 $cgui->setConfirm($lng->txt(
"delete"),
"deleteDelivered");
342 foreach (
$_POST[
"delivered"] as $i)
346 foreach ($files as $f)
348 if ($f[
"returned_id"] == $i)
350 $title = $f[
"filetitle"];
353 $cgui->addItem(
"delivered[]", $i, $title);
356 $tpl->setContent($cgui->getHTML());
372 if (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0))
375 $ilCtrl->redirect($this,
"submissionScreen");
378 if (count(
$_POST[
"delivered"]) && (mktime() < $this->ass->getDeadline() ||
379 $this->ass->getDeadline() == 0))
381 $this->
object->deleteDeliveredFiles($this->object->getId(), (int)
$_GET[
"ass_id"],
382 $_POST[
"delivered"], $ilUser->id);
384 $this->
object->handleSubmission((
int)
$_GET[
'ass_id']);
392 $ilCtrl->redirect($this,
"submissionScreen");
405 $this->tabs_gui->activateTab(
"submissions");
410 if (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0))
416 $ilToolbar->addButton($this->lng->txt(
"file_add"),
417 $this->ctrl->getLinkTarget($this,
"uploadForm"));
419 $ilToolbar->addButton($this->lng->txt(
"header_zip"),
420 $this->ctrl->getLinkTarget($this,
"uploadZipForm"));
423 include_once(
"./Modules/Exercise/classes/class.ilExcDeliveredFilesTableGUI.php");
425 $this->tpl->setContent(
$tab->getHTML());
433 if (mktime() < $this->ass->getDeadline() || ($this->ass->getDeadline() == 0))
435 $this->tabs_gui->clearTargets();
436 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
437 $this->ctrl->getLinkTarget($this,
"submissionScreen"));
440 $this->tpl->setContent($this->form->getHTML());
444 $this->ctrl->redirect($this,
"submissionScreen");
453 if (mktime() < $this->ass->getDeadline() || ($this->ass->getDeadline() == 0))
455 $this->tabs_gui->clearTargets();
456 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
457 $this->ctrl->getLinkTarget($this,
"submissionScreen"));
460 $this->tpl->setContent($this->form->getHTML());
464 $this->ctrl->redirect($this,
"submissionScreen");
475 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
479 include_once(
"./Services/Form/classes/class.ilFileWizardInputGUI.php");
483 $this->form->addItem($fi);
485 $this->form->addCommandButton(
"deliverFile", $lng->txt(
"upload"));
486 $this->form->addCommandButton(
"submissionScreen", $lng->txt(
"cancel"));
488 $this->form->setTitle($lng->txt(
"file_add"));
489 $this->form->setFormAction($ilCtrl->getFormAction($this));
499 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
503 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
506 $this->form->addItem($fi);
508 $this->form->addCommandButton(
"deliverUnzip", $lng->txt(
"upload"));
509 $this->form->addCommandButton(
"submissionScreen", $lng->txt(
"cancel"));
511 $this->form->setTitle($lng->txt(
"header_zip"));
512 $this->form->setFormAction($ilCtrl->getFormAction($this));
525 if (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0))
532 foreach ($_FILES[
"deliver"][
"name"] as $k => $v)
535 "name" => $_FILES[
"deliver"][
"name"][$k],
536 "type" => $_FILES[
"deliver"][
"type"][$k],
537 "tmp_name" => $_FILES[
"deliver"][
"tmp_name"][$k],
538 "error" => $_FILES[
"deliver"][
"error"][$k],
539 "size" => $_FILES[
"deliver"][
"size"][$k],
541 if(!$this->object->deliverFile(
$file, (
int)
$_GET[
"ass_id"], $ilUser->id))
554 $this->
object->handleSubmission((
int)$_GET[
'ass_id']);
556 $ilCtrl->redirect($this,
"submissionScreen");
569 if (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0))
575 if (preg_match(
"/zip/",$_FILES[
"deliver"][
"type"]) == 1)
577 if($this->object->processUploadedFile($_FILES[
"deliver"][
"tmp_name"],
"deliverFile",
false,
578 (
int)
$_GET[
"ass_id"]))
581 $this->
object->handleSubmission((
int)$_GET[
'ass_id']);
585 $ilCtrl->redirect($this,
"submissionScreen");
603 $this->ctrl->redirect($this,
"view");
610 $feedback_id =
"t".$ass->getTeamId($ilUser->getId());
614 $feedback_id = $ilUser->getId();
618 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
620 $files = $storage->getFeedbackFiles($feedback_id);
622 foreach($files as $fb_file)
624 if($fb_file ==
$file)
632 echo
"FILE DOES NOT EXIST";
637 $not_started_yet =
false;
638 if ($ass->getStartTime() > 0 && time() - $ass->getStartTime() <= 0)
640 $not_started_yet =
true;
644 if (!$not_started_yet)
646 $p = $storage->getFeedbackFilePath($feedback_id,
$file);
668 $this->ctrl->redirect($this,
"view");
672 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
675 foreach($files as $lfile)
677 if($lfile[
"name"] ==
$file)
685 echo
"FILE DOES NOT EXIST";
691 $not_started_yet =
false;
692 if ($ass->getStartTime() > 0 && time() - $ass->getStartTime() <= 0)
694 $not_started_yet =
true;
698 if (!$not_started_yet)
700 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
702 $p = $storage->getAssignmentFilePath(
$file);
711 $a_new_object->saveData();
714 ilUtil::redirect(
"ilias.php?baseClass=ilExerciseHandlerGUI&ref_id=".$a_new_object->
getRefId().
"&cmd=addAssignment");
722 $a_form->
setTitle($this->lng->txt(
"exc_edit_exercise"));
725 $section->setTitle($this->lng->txt(
'exc_passing_exc'));
731 $op1 =
new ilRadioOption($this->lng->txt(
"exc_pass_all"),
"all",
732 $this->lng->txt(
"exc_pass_all_info"));
733 $radg->addOption($op1);
734 $op2 =
new ilRadioOption($this->lng->txt(
"exc_pass_minimum_nr"),
"nr",
735 $this->lng->txt(
"exc_pass_minimum_nr_info"));
736 $radg->addOption($op2);
741 $ni->setMaxLength(4);
742 $ni->setRequired(
true);
743 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
745 $min = max($mand, 1);
746 $ni->setMinValue($min);
747 $ni->setInfo($this->lng->txt(
"exc_min_nr_info"));
748 $op2->addSubItem($ni);
753 $subcompl =
new ilRadioGroupInputGUI($this->lng->txt(
"exc_passed_status_determination"),
"completion_by_submission");
754 $op1 =
new ilRadioOption($this->lng->txt(
"exc_completion_by_tutor"), 0,
"");
755 $subcompl->addOption($op1);
756 $op2 =
new ilRadioOption($this->lng->txt(
"exc_completion_by_submission"), 1,$this->lng->txt(
"exc_completion_by_submission_info"));
757 $subcompl->addOption($op2);
766 $section->setTitle($this->lng->txt(
'exc_publishing'));
770 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"exc_show_submissions"),
"show_submissions");
771 $cb->
setInfo($this->lng->txt(
"exc_show_submissions_info"));
775 $section->setTitle($this->lng->txt(
'exc_notification'));
779 $cbox =
new ilCheckboxInputGUI($this->lng->txt(
"exc_submission_notification"),
"notification");
780 $cbox->
setInfo($this->lng->txt(
"exc_submission_notification_info"));
792 $a_values[
"desc"] = $this->
object->getLongDescription();
793 $a_values[
"show_submissions"] = $this->
object->getShowSubmissions();
794 $a_values[
"pass_mode"] = $this->
object->getPassMode();
795 if ($a_values[
"pass_mode"] ==
"nr")
797 $a_values[
"pass_nr"] = $this->
object->getPassNr();
800 include_once
"./Services/Notification/classes/class.ilNotification.php";
803 $this->
object->getId());
805 $a_values[
'completion_by_submission'] = (int) $this->object->isCompletionBySubmissionEnabled();
811 $this->
object->setShowSubmissions($a_form->
getInput(
"show_submissions"));
812 $this->
object->setPassMode($a_form->
getInput(
"pass_mode"));
813 if ($this->object->getPassMode() ==
"nr")
815 $this->
object->setPassNr($a_form->
getInput(
"pass_nr"));
818 $this->
object->setCompletionBySubmission($a_form->
getInput(
'completion_by_submission') == 1 ?
true :
false);
820 include_once
"./Services/Notification/classes/class.ilNotification.php";
822 $ilUser->getId(), $this->
object->getId(),
823 (bool)$a_form->
getInput(
"notification"));
828 $this->ctrl->redirect($this,
"view");
837 if(!$this->object->addUploadedFile($_FILES[
"zipfile"],
true))
841 $this->ctrl->redirect($this,
"edit");
851 if(!$this->object->addUploadedFile($_FILES[
"file"]))
855 $this->ctrl->redirect($this,
"edit");
868 if (
$_POST[
"downloadReturned"])
870 $this->
object->members_obj->deliverReturnedFiles(key(
$_POST[
"downloadReturned"]));
885 case "redirectFeedbackMail":
889 case "delete_member":
903 $peer_review_mask_filename =
false;
905 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
907 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId()) &&
908 $this->object->getShowSubmissions() &&
909 $this->
object->getTimestamp() - time() <= 0)
917 if(!($ilAccess->checkAccess(
"read",
"", $this->object->getRefId()) &&
918 $ass->hasPeerReviewAccess((
int) $_GET[
"member_id"])))
924 $peer_review_mask_filename =
true;
930 $this->object->getId(), (int)
$_GET[
"ass_id"], (
int)
$_GET[
"member_id"],
931 false, $peer_review_mask_filename))
933 $this->ctrl->redirect($this,
"members");
945 $peer_review_mask_filename =
false;
947 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
951 if(!($ilAccess->checkAccess(
"read",
"", $this->object->getRefId()) &&
952 $ass->hasPeerReviewAccess((
int) $_GET[
"member_id"])))
958 $peer_review_mask_filename =
true;
963 $this->object->getId(), (int)
$_GET[
"ass_id"], (
int)
$_GET[
"member_id"],
964 true, $peer_review_mask_filename))
966 $this->ctrl->redirect($this,
"members");
976 if(!strlen(trim(
$_POST[
'user_login'])))
982 $users = explode(
',',
$_POST[
'user_login']);
985 foreach($users as $user)
1004 $user_ids[] = $user_id;
1028 if(!count($a_user_ids))
1034 if(!$this->object->members_obj->assignMembers($a_user_ids))
1047 foreach($a_user_ids as $user_id)
1049 $ass_obj->getTeamId($user_id,
true);
1057 $this->ctrl->redirect($this,
"members");
1069 $ilTabs->activateTab(
"grades");
1071 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
1077 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
1080 if (
$_GET[
"ass_id"] ==
"")
1083 $_GET[
"ass_id"] = $a[
"id"];
1087 if (count($ass) > 1)
1090 foreach ($ass as $a)
1094 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1098 $ilToolbar->addInputItem(
$si);
1100 $ilToolbar->addFormButton($this->lng->txt(
"exc_select_ass"),
1101 "selectAssignment");
1102 $ilToolbar->addSeparator();
1106 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
1111 'auto_complete_name' => $lng->txt(
'user'),
1112 'submit_name' => $lng->txt(
'add'),
1113 'add_search' =>
true,
1114 'add_from_container' =>
$_GET[
"ref_id"]
1119 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1121 $ilToolbar->addSeparator();
1124 $ilToolbar->addButton($this->lng->txt(
"exc_multi_feedback"),
1125 $this->ctrl->getLinkTarget($this,
"showMultiFeedback"));
1127 if (count($ass) > 0)
1130 foreach($ass as $item)
1132 if($item[
"id"] ==
$_GET[
"ass_id"])
1134 $ctype = $item[
"type"];
1139 $ilToolbar->addSeparator();
1140 $ilToolbar->addFormButton($lng->txt(
"exc_list_text_assignment"),
"listTextAssignment");
1144 $ilToolbar->addSeparator();
1145 $ilToolbar->addFormButton($lng->txt(
"download_all_returned_files"),
"downloadAll");
1148 include_once(
"./Modules/Exercise/classes/class.ilExerciseMemberTableGUI.php");
1150 $tpl->setContent($exc_tab->getHTML());
1166 $ilTabs->activateTab(
"grades");
1181 $ilTabs->activateTab(
"grades");
1185 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
1187 $members = $this->
object->members_obj->getMembers();
1189 if (count($members) == 0)
1196 foreach ($members as $mem_id)
1200 include_once(
"./Services/User/classes/class.ilObjUser.php");
1202 $mems[$mem_id] = $name;
1208 if (
$_GET[
"part_id"] ==
"" && count($mems) > 0)
1210 $_GET[
"part_id"] = key($mems);
1214 if (count($mems) > 1)
1217 foreach ($mems as $k => $m)
1220 $m[
"lastname"].
", ".$m[
"firstname"].
" [".$m[
"login"].
"]";
1222 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1226 $ilToolbar->addInputItem(
$si);
1228 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1229 $ilToolbar->addFormButton($this->lng->txt(
"exc_select_part"),
1230 "selectParticipant");
1233 if (count($mems) > 0)
1235 include_once(
"./Modules/Exercise/classes/class.ilExParticipantTableGUI.php");
1237 $this->
object,
$_GET[
"part_id"]);
1238 $tpl->setContent($part_tab->getHTML());
1253 $ilTabs->activateTab(
"grades");
1268 $ilTabs->activateTab(
"grades");
1271 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
1273 $mems = $mem_obj->getMembers();
1275 if (count($mems) > 0)
1277 $ilToolbar->addButton($lng->txt(
"exc_export_excel"),
1278 $ilCtrl->getLinkTarget($this,
"exportExcel"));
1281 include_once(
"./Modules/Exercise/classes/class.ilExGradesTableGUI.php");
1283 $this->
object, $mem_obj);
1284 $tpl->setContent($grades_tab->getHTML());
1296 if (
$_GET[
"member_id"] !=
"")
1304 $members = array(
$_GET[
"member_id"]);
1307 else if(count(
$_POST[
"member"]) > 0)
1311 foreach(array_keys(
$_POST[
"member"]) as $user_id)
1315 $members = array_unique($members);
1319 $members = array_keys(
$_POST[
"member"]);
1326 foreach($members as $user_id)
1331 $logins = implode($logins,
",");
1333 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
1338 $this->ctrl->redirect($this,
"members");
1350 foreach($this->object->members_obj->getMembers() as $member_id)
1354 (int)
$_GET[
"ass_id"], $member_id);
1360 $members[$member_id] = $tmp_obj->getFirstname() .
" " . $tmp_obj->getLastname();
1366 (int)
$_GET[
"ass_id"], $members);
1379 include_once
"./Modules/Group/classes/class.ilObjGroup.php";
1381 $all_members = array();
1382 foreach($a_result as $group)
1386 $members = $tmp_grp_obj->getGroupMemberIds();
1387 $all_members = array_merge($all_members,$members);
1390 $all_members = array_unique($all_members);
1391 foreach($all_members as $member)
1393 $result[] = array(
"id" => $member);
1402 include_once
"./Services/Object/classes/class.ilObjectFactory.php";
1404 foreach($a_result as $obj)
1407 $this->tpl->setCurrentBlock(
"OBJ_SELECT_ROW");
1408 $this->tpl->setVariable(
"OBJ_ROW_TITLE",$tmp_obj->getTitle());
1409 $this->tpl->setVariable(
"OBJ_ROW_ID",$tmp_obj->getRefId());
1410 $this->tpl->setVariable(
"OBJ_ROW_DESCRIPTION",$tmp_obj->getDescription());
1411 $this->tpl->parseCurrentBlock();
1415 $this->tpl->setCurrentBlock(
"OBJ_SELECT");
1416 $this->tpl->setVariable(
"OBJ_SELECT_TITLE",$this->lng->txt(
"title"));
1417 $this->tpl->setVariable(
"OBJ_SELECT_DESCRIPTION",$this->lng->txt(
"description"));
1419 $this->tpl->setVariable(
"OBJ_BTN1_VALUE",$this->lng->txt(
"select"));
1420 $this->tpl->setVariable(
"OBJ_BTN2_VALUE",$this->lng->txt(
"cancel"));
1421 $this->tpl->parseCurrentBlock();
1433 if(!count(
$_POST[
"member"]))
1443 foreach(array_keys(
$_POST[
"member"]) as $user_id)
1446 foreach($tmembers as $tuser_id)
1448 $members[$tuser_id] = 1;
1454 $members =
$_POST[
"member"];
1457 $this->
object->sendAssignment($this->object->getId(),
1458 (int)
$_GET[
"ass_id"], $members);
1462 $ilCtrl->redirect($this,
"members");
1473 $ilTabs->activateTab(
"grades");
1475 if (!is_array(
$_POST[
"member"]) || count(
$_POST[
"member"]) == 0)
1478 $ilCtrl->redirect($this,
"members");
1482 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1484 $cgui->setFormAction($ilCtrl->getFormAction($this));
1485 $cgui->setHeaderText($lng->txt(
"exc_msg_sure_to_deassign_participant"));
1486 $cgui->setCancel($lng->txt(
"cancel"),
"members");
1487 $cgui->setConfirm($lng->txt(
"remove"),
"deassignMembers");
1493 foreach(array_keys(
$_POST[
"member"]) as $user_id)
1496 foreach($tmembers as $tuser_id)
1498 $members[$tuser_id] = 1;
1504 $members =
$_POST[
"member"];
1507 include_once(
"./Services/User/classes/class.ilUserUtil.php");
1508 foreach ($members as $k => $m)
1510 $cgui->addItem(
"member[$k]", $m,
1514 $tpl->setContent($cgui->getHTML());
1527 if(is_array(
$_POST[
"member"]))
1531 $this->
object->members_obj->deassignMember((
int) $usr_id);
1534 $ilCtrl->redirect($this,
"members");
1539 $ilCtrl->redirect($this,
"members");
1547 if(!isset(
$_POST[
'comments_value']))
1552 $this->
object->members_obj->setNoticeForMember(
$_GET[
"member_id"],
1581 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
1585 $saved_for = array();
1587 foreach(
$_POST[
"id"] as $key => $value)
1591 if (!$a_force_all &&
$_POST[
"member"][$key] !=
"1")
1598 $saved_for[] = $uname[
"lastname"].
", ".$uname[
"firstname"];
1603 $ass_id = (int)
$_GET[
"ass_id"];
1604 $user_id = (int) $key;
1608 $ass_id = (int) $key;
1609 $user_id = (int)
$_GET[
"part_id"];
1615 $team_id = $this->ass->getTeamId($user_id);
1616 $user_ids = $this->ass->getTeamMembers($team_id);
1618 if (count(
$_POST[
"member"]) > 0)
1620 foreach($user_ids as $user_id)
1622 if($user_id != $key)
1625 $saved_for[] = $uname[
"lastname"].
", ".$uname[
"firstname"];
1632 $user_ids = array($user_id);
1635 foreach($user_ids as $user_id)
1655 if (count($saved_for) > 0)
1657 $save_for_str =
"(".implode($saved_for,
" - ").
")";
1659 if($save_for_str || $a_part_view)
1665 $ilCtrl->redirect($this,
"members");
1669 $ilCtrl->redirect($this,
"showParticipant");
1678 for($i=0; $i<24; $i++)
1680 $hours[$i] = $i < 10 ?
"0".$i : $i;
1685 for($i=0;$i<60;$i++)
1687 $minutes[$i] = $i < 10 ?
"0".$i : $i;
1692 for($i=1; $i<32; $i++)
1694 $days[$i] = $i < 10 ?
"0".$i : $i;
1699 for($i=1; $i<13; $i++)
1701 $month[$i] = $i < 10 ?
"0".$i : $i;
1706 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
1716 foreach($a_result as $user)
1718 if(!$this->object->members_obj->isAssigned($user[
"id"]))
1720 $filtered[] = $user;
1724 return $filtered ? $filtered : array();
1736 $ilTabs->addSubTab(
"assignment", $lng->txt(
"exc_assignment_view"),
1737 $ilCtrl->getLinkTarget($this,
"members"));
1738 $ilTabs->addSubTab(
"participant", $lng->txt(
"exc_participant_view"),
1739 $ilCtrl->getLinkTarget($this,
"showParticipant"));
1740 $ilTabs->addSubTab(
"grades", $lng->txt(
"exc_grades_overview"),
1741 $ilCtrl->getLinkTarget($this,
"showGradesOverview"));
1742 $ilTabs->activateSubTab($a_activate);
1754 $ilTabs->addSubTab(
"content", $lng->txt(
"view"),
1755 $ilCtrl->getLinkTarget($this,
"showOverview"));
1756 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
1758 $ilTabs->addSubTab(
"list_assignments", $lng->txt(
"edit"),
1759 $ilCtrl->getLinkTarget($this,
"listAssignments"));
1761 $ilTabs->activateSubTab($a_activate);
1774 $ilHelp->setScreenIdComponent(
"exc");
1776 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
1778 $tabs_gui->addTab(
"content",
1779 $lng->txt(
"exc_assignments"),
1780 $this->ctrl->getLinkTarget($this,
"showOverview"));
1783 $next_class = strtolower($this->ctrl->getNextClass());
1784 if ($ilAccess->checkAccess(
"visible",
"", $this->object->getRefId()))
1786 $tabs_gui->addTab(
"info",
1787 $lng->txt(
"info_short"),
1788 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
1792 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
1798 $tabs_gui->addTab(
"settings",
1799 $lng->txt(
"settings"),
1800 $this->ctrl->getLinkTarget($this,
'edit'));
1802 $tabs_gui->addTab(
"grades",
1803 $lng->txt(
"exc_submissions_and_grades"),
1804 $this->ctrl->getLinkTarget($this,
'members'));
1808 $save_sort_order =
$_GET[
"sort_order"];
1809 $save_sort_by =
$_GET[
"sort_by"];
1810 $save_offset =
$_GET[
"offset"];
1813 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
1816 $tabs_gui->addTab(
'learning_progress',
1817 $lng->txt(
'learning_progress'),
1818 $this->ctrl->getLinkTargetByClass(array(
'ilobjexercisegui',
'illearningprogressgui'),
''));
1821 $_GET[
"sort_order"] = $save_sort_order;
1822 $_GET[
"sort_by"] = $save_sort_by;
1823 $_GET[
"offset"] = $save_offset;
1826 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1828 $tabs_gui->addTab(
"export",
1829 $lng->txt(
"export"),
1830 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
1835 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->ref_id))
1837 $tabs_gui->addTab(
'permissions',
1838 $lng->txt(
"perm_settings"),
1839 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"));
1850 $this->ctrl->setCmd(
"showSummary");
1851 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1862 $ilTabs->activateTab(
"info");
1866 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1869 $info->enablePrivateNotes();
1871 $info->enableNews();
1872 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1874 $info->enableNewsEditing();
1875 $info->setBlockProperty(
"news",
"settings",
true);
1882 $info->addSection($this->lng->txt(
"exc_overview"));
1883 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
1887 foreach ($ass as $a)
1890 if ($a[
"mandatory"])
1895 $info->addProperty($lng->txt(
"exc_assignments"), $cnt);
1896 $info->addProperty($lng->txt(
"exc_mandatory"), $mcnt);
1897 if ($this->object->getPassMode() !=
"nr")
1899 $info->addProperty($lng->txt(
"exc_pass_mode"),
1900 $lng->txt(
"exc_msg_all_mandatory_ass"));
1904 $info->addProperty($lng->txt(
"exc_pass_mode"),
1905 sprintf($lng->txt(
"exc_msg_min_number_ass"), $this->
object->getPassNr()));
1909 include_once(
"Services/Tracking/classes/class.ilLPMarks.php");
1910 if ($ilAccess->checkAccess(
"read",
"", $this->ref_id))
1915 $st = $this->
object->determinStatusOfUser($ilUser->getId());
1916 $status = $st[
"overall_status"];
1917 if ($lpcomment !=
"" || $mark !=
"" || $status !=
"notgraded")
1919 $info->addSection($this->lng->txt(
"exc_feedback_from_tutor"));
1920 if ($lpcomment !=
"")
1922 $info->addProperty($this->lng->txt(
"exc_comment"),
1927 $info->addProperty($this->lng->txt(
"exc_mark"),
1937 if ($status !=
"notgraded")
1939 $img =
'<img src="'.ilUtil::getImagePath(
"scorm/".$status.
".png").
'" '.
1940 ' alt="'.$lng->txt(
"exc_".$status).
'" title="'.$lng->txt(
"exc_".$status).
1944 if ($st[
"failed_a_mandatory"])
1946 $add =
" (".$lng->txt(
"exc_msg_failed_mandatory").
")";
1948 else if ($status ==
"failed")
1950 $add =
" (".$lng->txt(
"exc_msg_missed_minimum_number").
")";
1952 $info->addProperty($this->lng->txt(
"status"),
1953 $img.
" ".$this->lng->txt(
"exc_".$status).$add);
1959 $this->ctrl->forwardCommand($info);
1965 $this->tabs_gui->activateSubTab(
"edit");
1971 $this->tabs_gui->addSubTab(
"edit",
1972 $this->lng->txt(
"general_settings"),
1973 $this->ctrl->getLinkTarget($this,
"edit"));
1975 include_once
"Services/Certificate/classes/class.ilCertificate.php";
1978 $this->tabs_gui->addSubTab(
"certificate",
1979 $this->lng->txt(
"certificate"),
1980 $this->ctrl->getLinkTarget($this,
"certificate"));
1994 $parts = explode(
"_", $a_raw);
1995 if(
sizeof($parts) == 2)
1997 $ass_id = (int)$parts[1];
2000 if ($ilAccess->checkAccess(
"read",
"", $a_target))
2004 $_GET[
"ass_id_goto"] = $ass_id;
2006 $_GET[
"ref_id"] = $a_target;
2007 $_GET[
"cmd"] =
"showOverview";
2008 $_GET[
"baseClass"] =
"ilExerciseHandlerGUI";
2009 include(
"ilias.php");
2012 else if ($ilAccess->checkAccess(
"visible",
"", $a_target))
2014 $_GET[
"ref_id"] = $a_target;
2015 $_GET[
"cmd"] =
"infoScreen";
2016 $_GET[
"baseClass"] =
"ilExerciseHandlerGUI";
2017 include(
"ilias.php");
2020 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
2027 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
2037 if (is_object($this->
object))
2039 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
2056 $ilTabs->activateTab(
"content");
2059 $ilToolbar->addButton($lng->txt(
"exc_add_assignment"),
2060 $ilCtrl->getLinkTarget($this,
"addAssignment"));
2062 include_once(
"./Modules/Exercise/classes/class.ilAssignmentsTableGUI.php");
2064 $tpl->setContent(
$t->getHTML());
2072 global
$tpl, $ilTabs;
2076 $ilTabs->activateTab(
"content");
2080 $tpl->setContent($this->form->getHTML());
2093 $lng->loadLanguageModule(
"form");
2094 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
2096 $this->form->setTableWidth(
"600px");
2097 if ($a_mode ==
"edit")
2099 $this->form->setTitle($lng->txt(
"exc_edit_assignment"));
2103 $this->form->setTitle($lng->txt(
"exc_new_assignment"));
2105 $this->form->setFormAction($ilCtrl->getFormAction($this));
2108 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2112 if(!$ilSetting->get(
'disable_wsp_blogs'))
2116 if($ilSetting->get(
'user_portfolios'))
2120 if(
sizeof($types) > 1)
2122 $ty =
new ilSelectInputGUI($this->lng->txt(
"exc_assignment_type"),
"type");
2124 $ty->setRequired(
true);
2131 $this->form->addItem($ty);
2136 $ti->setRequired(
true);
2137 $this->form->addItem($ti);
2141 $this->form->addItem($cb);
2145 $edit_date->setShowTime(
true);
2146 $cb->addSubItem($edit_date);
2152 $this->form->addItem($dcb);
2157 $dcb->addSubItem($edit_date);
2161 $cb->
setInfo($this->lng->txt(
"exc_mandatory_info"));
2162 $cb->setChecked(
true);
2163 $this->form->addItem($cb);
2168 $desc_input->setUseRte(
true);
2169 $desc_input->setRteTagSet(
"mini");
2170 $this->form->addItem($desc_input);
2173 if ($a_mode ==
"create")
2177 $this->form->addItem($files);
2182 $peer->
setInfo($this->lng->txt(
"exc_peer_review_ass_setting_info"));
2183 $this->form->addItem($peer);
2185 if ($a_mode ==
"create")
2187 $peer->setInfo($lng->txt(
"exc_peer_review_info"));
2190 $peer_min =
new ilNumberInputGUI($lng->txt(
"exc_peer_review_min_number"),
"peer_min");
2191 $peer_min->
setInfo($lng->txt(
"exc_peer_review_min_number_info"));
2192 $peer_min->setRequired(
true);
2193 $peer_min->setValue(5);
2194 $peer_min->setSize(3);
2195 $peer_min->setValue(2);
2196 $peer->addSubItem($peer_min);
2199 $peer_dl->
setInfo($lng->txt(
"exc_peer_review_deadline_info"));
2200 $peer_dl->enableDateActivation(
"",
"peer_dl_tgl");
2201 $peer_dl->setShowTime(
true);
2202 $peer->addSubItem($peer_dl);
2208 $this->form->addItem($fb);
2210 $fb_file =
new ilFileInputGUi($lng->txt(
"file"),
"fb_file");
2213 $fb->addSubItem($fb_file);
2216 if($a_mode !=
"create" &&
2218 $this->ass->getFeedbackFile())
2220 $fb_file->setRequired(
false);
2223 $fb_cron =
new ilCheckboxInputGUI($lng->txt(
"exc_global_feedback_file_cron"),
"fb_cron");
2224 $fb_cron->
setInfo($lng->txt(
"exc_global_feedback_file_cron_info"));
2225 $fb->addSubItem($fb_cron);
2228 if ($a_mode ==
"create")
2230 $this->form->addCommandButton(
"saveAssignment", $lng->txt(
"save"));
2231 $this->form->addCommandButton(
"listAssignments", $lng->txt(
"cancel"));
2235 $this->form->addCommandButton(
"updateAssignment", $lng->txt(
"save"));
2236 $this->form->addCommandButton(
"listAssignments", $lng->txt(
"cancel"));
2250 $ilTabs->activateTab(
"content");
2254 if ($this->form->checkInput())
2256 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2266 $this->form->getItemByPostVar(
"start_time")->getDate();
2268 $this->form->getItemByPostVar(
"deadline")->getDate();
2272 $this->form->getItemByPostVar(
"start_time")
2273 ->setAlert($lng->txt(
"exc_start_date_should_be_before_end_date"));
2274 $this->form->getItemByPostVar(
"deadline")
2275 ->setAlert($lng->txt(
"exc_start_date_should_be_before_end_date"));
2282 $this->form->getItemByPostVar(
"peer")
2283 ->setAlert($lng->txt(
"exc_team_upload_not_supported"));
2287 if(!
$_POST[
"deadline_cb"])
2291 $this->form->getItemByPostVar(
"peer")
2292 ->setAlert($lng->txt(
"exc_needs_deadline"));
2297 $this->form->getItemByPostVar(
"fb")
2298 ->setAlert($lng->txt(
"exc_needs_deadline"));
2308 $peer_dl = $this->form->getItemByPostVar(
"peer_dl")->getDate();
2310 $end_date = $this->form->getItemByPostVar(
"deadline")->getDate();
2314 if ($peer_dl < $end_date)
2316 $this->form->getItemByPostVar(
"peer_dl")
2317 ->setAlert($lng->txt(
"exc_peer_deadline_mismatch"));
2326 $this->form->setValuesByPost();
2327 $tpl->setContent($this->form->getHtml());
2332 $ass->setTitle(
$_POST[
"title"]);
2333 $ass->setInstruction(
$_POST[
"instruction"]);
2334 $ass->setExerciseId($this->object->getId());
2335 $ass->setMandatory(
$_POST[
"mandatory"]);
2336 $ass->setType(
$_POST[
"type"]);
2338 if (
$_POST[
"start_time_cb"])
2341 $this->form->getItemByPostVar(
"start_time")->getDate();
2346 $ass->setStartTime(null);
2350 if (
$_POST[
"deadline_cb"])
2353 $this->form->getItemByPostVar(
"deadline")->getDate();
2358 $ass->setDeadline(null);
2363 $ass->setPeerReview(
$_POST[
"peer"]);
2364 $ass->setPeerReviewMin(
$_POST[
"peer_min"]);
2366 if(
$_POST[
"peer_dl_tgl"])
2368 $peer_dl = $this->form->getItemByPostVar(
"peer_dl")->getDate();
2369 $ass->setPeerReviewDeadline($peer_dl->get(
IL_CAL_UNIX));
2373 $ass->setPeerReviewDeadline(null);
2378 $ass->setFeedbackCron(
$_POST[
"fb_cron"]);
2383 $ass->uploadAssignmentFiles($_FILES[
"files"]);
2385 if($_FILES[
"fb_file"][
"tmp_name"])
2387 $ass->handleFeedbackFileUpload($_FILES[
"fb_file"]);
2392 $ilCtrl->redirect($this,
"listAssignments");
2396 $this->form->setValuesByPost();
2397 $tpl->setContent($this->form->getHtml());
2411 $ilTabs->activateTab(
"ass_settings");
2415 $tpl->setContent($this->form->getHTML());
2427 $values[
"title"] = $ass->getTitle();
2428 if ($ass->getStartTime() > 0)
2430 $values[
"start_time_cb"] =
true;
2432 $values[
"mandatory"] = $ass->getMandatory();
2433 $values[
"instruction"] = $ass->getInstruction();
2434 $values[
"type"] = $ass->getType();
2435 if ($ass->getDeadline() > 0)
2437 $values[
"deadline_cb"] =
true;
2441 $this->form->removeItemByPostVar(
"peer");
2442 $this->form->removeItemByPostVar(
"peer_min");
2443 $this->form->removeItemByPostVar(
"peer_dl");
2447 $values[
"peer"] = $ass->getPeerReview();
2448 $values[
"peer_min"] = $ass->getPeerReviewMin();
2450 if ($ass->getPeerReviewDeadline() > 0)
2452 $values[
"peer_dl_tgl"] =
true;
2454 $peer_dl = $this->form->getItemByPostVar(
"peer_dl");
2455 $peer_dl->
setDate($peer_dl_date);
2458 $this->form->setValuesByArray($values);
2460 if ($ass->getDeadline() > 0)
2463 $ed_item = $this->form->getItemByPostVar(
"deadline");
2464 $ed_item->
setDate($edit_date);
2467 if ($ass->getStartTime() > 0)
2470 $ed_item = $this->form->getItemByPostVar(
"start_time");
2471 $ed_item->
setDate($edit_date);
2474 if($ass->getFeedbackFile())
2476 $this->form->getItemByPostVar(
"fb")->setChecked(
true);
2477 $this->form->getItemByPostVar(
"fb_cron")->setChecked($ass->hasFeedbackCron());
2478 $this->form->getItemByPostVar(
"fb_file")->setValue(basename($ass->getFeedbackFilePath()));
2485 $this->form->getItemByPostVar(
"type")->setDisabled(
true);
2499 $ilTabs->activateTab(
"content");
2503 if ($this->form->checkInput())
2505 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2515 $this->form->getItemByPostVar(
"start_time")->getDate();
2517 $this->form->getItemByPostVar(
"deadline")->getDate();
2521 $this->form->getItemByPostVar(
"start_time")
2522 ->setAlert($lng->txt(
"exc_start_date_should_be_before_end_date"));
2523 $this->form->getItemByPostVar(
"deadline")
2524 ->setAlert($lng->txt(
"exc_start_date_should_be_before_end_date"));
2529 if(!
$_POST[
"deadline_cb"])
2533 $this->form->getItemByPostVar(
"peer")
2534 ->setAlert($lng->txt(
"exc_needs_deadline"));
2539 $this->form->getItemByPostVar(
"fb")
2540 ->setAlert($lng->txt(
"exc_needs_deadline"));
2550 $peer_dl = $this->form->getItemByPostVar(
"peer_dl")->getDate();
2552 $end_date = $this->form->getItemByPostVar(
"deadline")->getDate();
2556 if ($peer_dl < $end_date)
2558 $this->form->getItemByPostVar(
"peer_dl")
2559 ->setAlert($lng->txt(
"exc_peer_deadline_mismatch"));
2568 $this->form->setValuesByPost();
2569 $tpl->setContent($this->form->getHtml());
2574 $ass->setTitle(
$_POST[
"title"]);
2575 $ass->setInstruction(
$_POST[
"instruction"]);
2576 $ass->setExerciseId($this->object->getId());
2577 $ass->setMandatory(
$_POST[
"mandatory"]);
2578 $ass->setType(
$_POST[
"type"]);
2580 if (
$_POST[
"start_time_cb"])
2583 $this->form->getItemByPostVar(
"start_time")->getDate();
2588 $ass->setStartTime(null);
2592 if (
$_POST[
"deadline_cb"])
2594 $date = $this->form->getItemByPostVar(
"deadline")->getDate();
2599 $ass->setDeadline(null);
2604 $ass->setPeerReview(
$_POST[
"peer"]);
2605 $ass->setPeerReviewMin(
$_POST[
"peer_min"]);
2607 if(
$_POST[
"peer_dl_tgl"])
2609 $peer_dl = $this->form->getItemByPostVar(
"peer_dl")->getDate();
2610 $ass->setPeerReviewDeadline($peer_dl->get(
IL_CAL_UNIX));
2614 $ass->setPeerReviewDeadline(null);
2619 $this->form->getItemByPostVar(
"fb_file")->getDeletionFlag())
2621 $ass->deleteFeedbackFile();
2622 $ass->setFeedbackFile(null);
2624 else if($_FILES[
"fb_file"][
"tmp_name"])
2626 $ass->handleFeedbackFileUpload($_FILES[
"fb_file"]);
2630 $ass->setFeedbackCron(
$_POST[
"fb_cron"]);
2634 $ilCtrl->redirect($this,
"editAssignment");
2638 $this->form->setValuesByPost();
2639 $tpl->setContent($this->form->getHtml());
2653 $ilTabs->activateTab(
"content");
2656 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0)
2659 $ilCtrl->redirect($this,
"listAssignments");
2663 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
2665 $cgui->setFormAction($ilCtrl->getFormAction($this));
2666 $cgui->setHeaderText($lng->txt(
"exc_conf_del_assignments"));
2667 $cgui->setCancel($lng->txt(
"cancel"),
"listAssignments");
2668 $cgui->setConfirm($lng->txt(
"delete"),
"deleteAssignments");
2670 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2672 foreach (
$_POST[
"id"] as $i)
2677 $tpl->setContent($cgui->getHTML());
2691 if (is_array(
$_POST[
"id"]))
2693 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2694 foreach(
$_POST[
"id"] as $id)
2706 $ilCtrl->redirect($this,
"listAssignments");
2718 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2722 $ilCtrl->redirect($this,
"listAssignments");
2734 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2738 $ilCtrl->redirect($this,
"listAssignments");
2748 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2750 $tpl->setDescription(
"");
2752 $ilTabs->clearTargets();
2753 $ilHelp->setScreenIdComponent(
"exc");
2755 $ilTabs->setBackTarget($lng->txt(
"back"),
2756 $ilCtrl->getLinkTarget($this,
"listAssignments"));
2758 $ilTabs->addTab(
"ass_settings",
2759 $lng->txt(
"settings"),
2760 $ilCtrl->getLinkTarget($this,
"editAssignment"));
2762 $ilTabs->addTab(
"ass_files",
2763 $lng->txt(
"exc_instruction_files"),
2764 $ilCtrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"));
2782 include_once(
"./Services/Tracking/classes/class.ilLearningProgress.php");
2784 $this->
object->getRefId(),
'exc');
2786 $ilTabs->activateTab(
"content");
2790 if($this->object->hasUserCertificate($ilUser->getId()))
2792 include_once
"./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
2793 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
2797 $ilToolbar->addButton($this->lng->txt(
"certificate"),
2798 $this->ctrl->getLinkTarget($this,
"outCertificate"));
2802 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2803 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
2805 $acc->setId(
"exc_ow_".$this->object->getId());
2807 include_once(
"./Modules/Exercise/classes/class.ilExAssignmentGUI.php");
2810 foreach ($ass_data as $ass)
2813 $force_open =
false;
2814 if(isset(
$_GET[
"ass_id_goto"]) &&
2815 (
int)
$_GET[
"ass_id_goto"] == $ass[
"id"])
2820 $acc->addItem($ass_gui->getOverviewHeader($ass),
2821 $ass_gui->getOverviewBody($ass),
2825 if (count($ass_data) < 2)
2827 $acc->setBehaviour(
"FirstOpen");
2831 $acc->setBehaviour(
"OneOpenSession");
2835 $tpl->setContent($acc->getHTML());
2843 global
$tpl, $ilTabs;
2847 if(!$this->object->getShowSubmissions())
2849 $this->ctrl->redirect($this,
"view");
2852 $ilTabs->activateTab(
"content");
2857 include_once(
"./Modules/Exercise/classes/class.ilPublicSubmissionsTableGUI.php");
2859 $this->
object, (
int)
$_GET[
"ass_id"]);
2860 $tpl->setContent(
$tab->getHTML());
2865 include_once
"Modules/Exercise/classes/class.ilExAssignmentListTextTableGUI.php";
2867 $tpl->setContent($tbl->getHTML());
2877 $this->
object->exportGradesExcel();
2889 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
2891 if (is_array(
$_POST[
"lcomment"]))
2893 foreach (
$_POST[
"lcomment"] as $k => $v)
2895 $marks_obj =
new ilLPMarks($this->object->getId(), (int) $k);
2898 $marks_obj->update();
2902 $ilCtrl->redirect($this,
"showGradesOverview");
2911 include_once
"./Services/Notification/classes/class.ilNotification.php";
2914 include_once
"./Modules/Exercise/classes/class.ilExerciseMailNotification.php";
2917 $not->setAssignmentId($assignment_id);
2918 $not->setRefId($this->ref_id);
2919 $not->setRecipients($users);
2931 $this->tabs_gui->setTabActive(
"content");
2934 if (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0))
2939 $tpl =
new ilTemplate(
"tpl.exc_select_resource.html",
true,
true,
"Modules/Exercise");
2940 $tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"exc_create_blog").
": ".$this->ass->getTitle());
2942 $tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2943 $tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
2944 $tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2945 $tpl->setVariable(
"CMD_SUBMIT",
"saveBlog");
2946 $tpl->setVariable(
"CMD_CANCEL",
"showOverview");
2950 $this->tpl->setContent(
$tpl->get());
2959 $this->tabs_gui->clearTargets();
2960 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this,
"showOverview"));
2965 if (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0))
2970 $tpl =
new ilTemplate(
"tpl.exc_select_resource.html",
true,
true,
"Modules/Exercise");
2971 $tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"exc_select_blog").
": ".$this->ass->getTitle());
2973 $tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2974 $tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
2975 $tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2976 $tpl->setVariable(
"CMD_SUBMIT",
"setSelectedBlog");
2977 $tpl->setVariable(
"CMD_CANCEL",
"showOverview");
2981 $this->tpl->setContent(
$tpl->get());
2994 $parent_node =
$_POST[
"node"];
2996 include_once
"Modules/Blog/classes/class.ilObjBlog.php";
2997 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
2998 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
3001 $blog->setTitle($this->object->getTitle().
" - ".$this->ass->getTitle());
3006 $node_id =
$tree->insertObject($parent_node, $blog->getId());
3009 $access_handler->setPermissions($parent_node, $node_id);
3011 $this->
object->addResourceObject($node_id, $this->ass->getId(), $ilUser->getId());
3014 $this->ctrl->redirect($this,
"showOverview");
3023 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
3026 if($node && $node[
"type"] ==
"blog")
3029 $this->
object->addResourceObject($node[
"wsp_id"], $this->ass->getId(), $ilUser->getId());
3032 $this->ctrl->setParameter($this,
"blog_id", $node[
"wsp_id"]);
3033 $this->ctrl->redirect($this,
"askDirectionSubmission");
3052 foreach($submitted as $item)
3054 $files[] = $item[
"returned_id"];
3064 $this->tabs_gui->setTabActive(
"content");
3067 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
3073 $this->ctrl->setParameter($this,
"blog_id",
$_REQUEST[
"blog_id"]);
3074 $txt = $this->lng->txt(
"exc_direct_submit_blog");
3078 $this->ctrl->setParameter($this,
"prtf_id",
$_REQUEST[
"prtf_id"]);
3079 $txt = $this->lng->txt(
"exc_direct_submit_portfolio");
3081 $conf->setFormAction($this->ctrl->getFormAction($this,
"directSubmit"));
3083 $conf->setHeaderText($txt);
3084 $conf->setConfirm($this->lng->txt(
"submit"),
"directSubmit");
3085 $conf->setCancel($this->lng->txt(
"cancel"),
"showOverview");
3087 $tpl->setContent($conf->getHTML());
3100 $this->ctrl->setParameter($this,
"blog_id",
"");
3106 $this->ctrl->setParameter($this,
"prtf_id",
"");
3117 $this->ctrl->redirect($this,
"showOverview");
3130 if($this->
object && $this->ass)
3132 $blog_id = $a_blog_id;
3134 include_once
"Modules/Blog/classes/class.ilObjBlogGUI.php";
3136 if($blog_gui->object)
3138 $file = $blog_gui->buildExportFile();
3146 "tmp_name" =>
$file,
3149 $this->
object->deliverFile($meta, $this->ass->getId(), $ilUser->getId(),
true);
3152 $this->
object->handleSubmission($this->ass->getId());
3170 if($this->
object && $this->ass)
3172 $prtf_id = $a_portfolio_id;
3174 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
3176 if($prtf->getTitle())
3178 include_once
"Modules/Portfolio/classes/class.ilPortfolioHTMLExport.php";
3180 $file = $export->buildExportFile();
3188 "tmp_name" =>
$file,
3191 $this->
object->deliverFile($meta, $this->ass->getId(), $ilUser->getId(),
true);
3194 $this->
object->handleSubmission($this->ass->getId());
3208 $this->tabs_gui->clearTargets();
3209 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this,
"showOverview"));
3214 if (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0))
3219 $tpl =
new ilTemplate(
"tpl.exc_select_resource.html",
true,
true,
"Modules/Exercise");
3221 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
3225 $tpl->setCurrentBlock(
"item");
3226 foreach($portfolios as $portfolio)
3228 $tpl->setVariable(
"ITEM_ID", $portfolio[
"id"]);
3229 $tpl->setVariable(
"ITEM_TITLE", $portfolio[
"title"]);
3230 $tpl->parseCurrentBlock();
3234 $tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"exc_select_portfolio").
": ".$this->ass->getTitle());
3235 $tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
3236 $tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
3237 $tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
3238 $tpl->setVariable(
"CMD_SUBMIT",
"setSelectedPortfolio");
3239 $tpl->setVariable(
"CMD_CANCEL",
"showOverview");
3243 $this->tpl->setContent(
$tpl->get());
3248 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
3250 $form->setTitle($this->lng->txt(
"exc_create_portfolio").
": ".$this->ass->getTitle());
3251 $form->setFormAction($this->ctrl->getFormAction($this,
"setSelectedPortfolioTemplate"));
3255 $prtt->addOption(
new ilRadioOption($this->lng->txt(
"exc_create_portfolio_no_template"), -1));
3256 foreach($a_templates as $id => $title)
3260 $prtt->setValue(-1);
3261 $form->addItem($prtt);
3263 $form->addCommandButton(
"setSelectedPortfolioTemplate", $this->lng->txt(
"save"));
3264 $form->addCommandButton(
"showOverview", $this->lng->txt(
"cancel"));
3273 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
3275 if(!
sizeof($templates))
3277 $this->ctrl->redirect($this,
"showOverview");
3280 $this->tabs_gui->clearTargets();
3281 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this,
"showOverview"));
3288 $this->tpl->setContent($a_form->getHTML());
3295 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
3297 if(!
sizeof($templates))
3299 $this->ctrl->redirect($this,
"showOverview");
3303 if($form->checkInput())
3305 $prtt = $form->getInput(
"prtt");
3306 if($prtt > 0 && array_key_exists($prtt, $templates))
3308 $title = $this->
object->getTitle().
" - ".$this->ass->getTitle();
3309 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"exc_id", $this->object->getRefId());
3310 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"ass_id", $this->ass->getId());
3311 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"pt", $title);
3312 $this->ctrl->setParameterByClass(
"ilObjPortfolioGUI",
"prtt", $prtt);
3313 $this->ctrl->redirectByClass(array(
"ilPersonalDesktopGUI",
"ilPortfolioRepositoryGUI",
"ilObjPortfolioGUI"),
"createPortfolioFromTemplate");
3322 $form->setValuesByPost();
3332 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
3334 $portfolio->setTitle($this->object->getTitle().
" - ".$this->ass->getTitle());
3335 $portfolio->create();
3337 $this->
object->addResourceObject($portfolio->getId(), $this->ass->getId(), $ilUser->getId());
3340 $this->ctrl->redirect($this,
"showOverview");
3350 $this->
object->addResourceObject(
$_POST[
"item"], $this->ass->getId(), $ilUser->getId());
3353 $this->ctrl->setParameter($this,
"prtf_id",
$_POST[
"item"]);
3354 $this->ctrl->redirect($this,
"askDirectionSubmission");
3365 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
3366 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
3367 require_once
'Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php';
3372 'exc_wspexpand',
$tree, $access_handler);
3373 $exp->setTargetGet(
'wsp_id');
3375 if($a_cmd ==
"selectBlog")
3377 $exp->removeAllFormItemTypes();
3378 $exp->addFilter(
'blog');
3379 $exp->addFormItemForType(
'blog');
3382 if(
$_GET[
'exc_wspexpand'] ==
'')
3385 $expanded =
$tree->readRootId();
3389 $expanded =
$_GET[
'exc_wspexpand'];
3392 $exp->setExpandTarget($this->ctrl->getLinkTarget($this, $a_cmd));
3393 $exp->setPostVar(
'node');
3394 $exp->setExpand($expanded);
3397 return $exp->getOutput();
3403 $this->tabs_gui->activateTab(
"settings");
3404 $this->tabs_gui->activateSubTab(
"certificate");
3406 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
3407 include_once
"./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
3409 $output_gui->certificateEditor();
3416 if($this->object->hasUserCertificate($ilUser->getId()))
3422 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
3423 include_once
"./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
3425 $certificate->outCertificate(array(
"user_id" => $ilUser->getId()));
3436 $this->ctrl->redirect($this,
"submissionScreen");
3439 $this->tabs_gui->clearTargets();
3440 $ilHelp->setScreenIdComponent(
"exc");
3441 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
3442 $this->ctrl->getLinkTarget($this, $a_back_cmd));
3446 $this->tabs_gui->addTab(
"submissions", $this->lng->txt(
"files"),
3447 $this->ctrl->getLinkTarget($this,
"submissionScreen"));
3449 $this->tabs_gui->addTab(
"team", $this->lng->txt(
"exc_team"),
3450 $this->ctrl->getLinkTarget($this,
"submissionScreenTeam"));
3452 $this->tabs_gui->addTab(
"log", $this->lng->txt(
"exc_team_log"),
3453 $this->ctrl->getLinkTarget($this,
"submissionScreenTeamLog"));
3455 $this->tabs_gui->activateTab(
"team");
3457 $team_id = $this->ass->getTeamId($ilUser->getId());
3461 $team_id = $this->ass->getTeamId($ilUser->getId(),
true);
3464 if (!$this->object->members_obj->isAssigned($ilUser->getId()))
3466 $this->
object->members_obj->assignMember($ilUser->getId());
3474 $ilHelp->setScreenId(
"submissions");
3493 $read_only = (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0));
3501 $this->ctrl->setParameterByClass(
'ilRepositorySearchGUI',
'ctx', 1);
3502 $this->ctrl->setParameter($this,
'ctx', 1);
3505 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
3510 'auto_complete_name' => $this->lng->txt(
'user'),
3511 'submit_name' => $this->lng->txt(
'add'),
3512 'add_search' =>
true,
3513 'add_from_container' => $this->
object->getRefId()
3518 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamTableGUI.php";
3522 $this->tpl->setContent($tbl->getHTML());
3531 if(!count($a_user_ids))
3537 $team_id = $this->ass->getTeamId($ilUser->getId());
3538 $has_files = $this->ass->getDeliveredFiles($this->object->getId(),
3539 $this->ass->getId(),
3541 $all_members = $this->ass->getMembersOfAllTeams();
3542 $members = $this->ass->getTeamMembers($team_id);
3544 foreach($a_user_ids as $user_id)
3546 if(!in_array($user_id, $all_members))
3548 $this->ass->addTeamMember($team_id, $user_id, $this->ref_id);
3551 if (!$this->object->members_obj->isAssigned($user_id))
3553 $this->
object->members_obj->assignMember($user_id);
3565 else if(!in_array($user_id, $members))
3572 $this->ctrl->redirect($this,
"submissionScreenTeam");
3584 $this->ctrl->redirect($this,
"submissionScreenTeam");
3587 $team_id = $this->ass->getTeamId($ilUser->getId());
3588 $members = $this->ass->getTeamMembers($team_id);
3590 $team_deleted =
false;
3591 if(
sizeof($members) <=
sizeof($ids))
3593 if(
sizeof($members) == 1 && $members[0] == $ilUser->getId())
3601 $this->ctrl->redirect($this,
"submissionScreenTeam");
3609 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
3611 $cgui->setFormAction($this->ctrl->getFormAction($this));
3612 $cgui->setHeaderText($this->lng->txt(
"exc_team_member_remove_sure"));
3613 $cgui->setCancel($this->lng->txt(
"cancel"),
"submissionScreenTeam");
3614 $cgui->setConfirm($this->lng->txt(
"remove"),
"removeTeamMember");
3617 $this->ass->getId(), $ilUser->getId());
3619 include_once
"Services/User/classes/class.ilUserUtil.php";
3621 foreach($ids as $id)
3624 foreach ($files as
$file)
3626 if($file[
"owner_id"] == $id)
3628 $details[] = $file[
"filetitle"];
3632 if(
sizeof($details))
3634 $uname .=
": ".implode(
", ", $details);
3636 $cgui->addItem(
"id[]", $id, $uname);
3639 $tpl->setContent($cgui->getHTML());
3651 $this->ctrl->redirect($this,
"submissionScreenTeam");
3654 $team_id = $this->ass->getTeamId($ilUser->getId());
3655 $members = $this->ass->getTeamMembers($team_id);
3657 $team_deleted =
false;
3658 if(
sizeof($members) <=
sizeof($ids))
3660 if(
sizeof($members) == 1 && $members[0] == $ilUser->getId())
3662 $team_deleted =
true;
3667 $this->ctrl->redirect($this,
"submissionScreenTeam");
3671 foreach($ids as $user_id)
3673 $this->ass->removeTeamMember($team_id, $user_id, $this->ref_id);
3685 $this->ctrl->redirect($this,
"submissionScreenTeam");
3689 $this->ctrl->redirect($this,
"showOverview");
3696 $this->tabs_gui->activateTab(
"log");
3698 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamLogTableGUI.php";
3702 $this->tpl->setContent($tbl->getHTML());
3707 if(isset(
$_GET[
"lmem"]))
3709 $user_id =
$_GET[
"lmem"];
3714 $user_id =
$_GET[
"lpart"];
3715 $cmd =
"showParticipant";
3719 $this->ass->getTeamId($user_id,
true);
3722 $this->ctrl->redirect($this,
$cmd);
3728 $this->tabs_gui->activateTab(
"grades");
3730 if(isset(
$_GET[
"lmem"]))
3734 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
3735 $this->ctrl->getLinkTarget($this,
"members"));
3739 $this->ctrl->saveParameter($this,
"lmem");
3745 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
3746 $this->ctrl->getLinkTarget($this,
"showParticipant"));
3750 $this->ctrl->saveParameter($this,
"lpart");
3753 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamLogTableGUI.php";
3757 $this->tpl->setContent($tbl->getHTML());
3764 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
3766 $form->setTitle($this->lng->txt(
"exc_assignment").
" \"".$a_ass->
getTitle().
"\"");
3773 $form->addItem($text);
3776 $text->setUseRte(
true);
3777 $text->setRTESupport($ilUser->getId(),
"exca~",
"exc_ass");
3780 $text->disableButtons(array(
3797 $form->setFormAction($ilCtrl->getFormAction($this,
"updateAssignmentText"));
3798 $form->addCommandButton(
"updateAssignmentTextAndReturn", $this->lng->txt(
"save_return"));
3799 $form->addCommandButton(
"updateAssignmentText", $this->lng->txt(
"save"));
3804 $form->addItem($text);
3806 if(!$a_peer_review_cmd)
3808 $form->setFormAction($ilCtrl->getFormAction($this,
"showOverview"));
3813 $rating->
setHtml($a_peer_rating_html);
3814 $form->addItem($rating);
3819 $form->addItem($comm);
3821 $form->setFormAction($ilCtrl->getFormAction($this, $a_peer_review_cmd));
3822 $form->addCommandButton($a_peer_review_cmd, $this->lng->txt(
"save"));
3825 $form->addCommandButton($a_cancel_cmd, $this->lng->txt(
"cancel"));
3836 ($this->ass->getDeadline() && $this->ass->getDeadline() - time() < 0))
3838 $ilCtrl->redirect($this,
"showOverview");
3843 $ilTabs->activateTab(
"content");
3846 if($this->ass->getDeadline())
3859 $files = array_shift($files);
3860 if(trim($files[
"atext"]))
3862 $text = $a_form->getItemByPostVar(
"atxt");
3869 $this->tpl->setContent($a_form->getHTML());
3881 $times_up = ($this->ass->getDeadline() && $this->ass->getDeadline() - time() < 0);
3891 $ilCtrl->redirect($this,
"showOverview");
3900 include_once(
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php");
3901 $rte = $form->getItemByPostVar(
"atxt");
3904 if($form->checkInput())
3906 $text = trim($form->getInput(
"atxt"));
3909 $this->ass->getId(), $ilUser->getId());
3911 $returned_id = $this->
object->updateTextSubmission(
3912 $this->ass->getExerciseId(),
3913 $this->ass->getId(),
3925 $this->
object->handleSubmission($this->ass->getId());
3929 include_once
"Services/MediaObjects/classes/class.ilObjMediaObject.php";
3931 foreach(
$mobs as $mob)
3944 $ilCtrl->redirect($this,
"showOverview");
3948 $ilCtrl->redirect($this,
"editAssignmentText");
3952 $form->setValuesByPost();
3963 $ilCtrl->redirect($this,
"showOverview");
3969 if((
int)
$_GET[
"grd"])
3973 if((
int)$_GET[
"grd"] == 1)
3975 $user_id = (int)$_GET[
"member_id"];
3976 $cancel_cmd =
"members";
3980 $user_id = (int)$_GET[
"part_id"];
3981 $cancel_cmd =
"showParticipant";
3985 else if($this->ass->hasPeerReviewAccess((
int)$_GET[
"member_id"]))
3989 $user_id = (int)$_GET[
"member_id"];
3990 $cancel_cmd =
"editPeerReview";
3993 $add_rating =
"updatePeerReviewText";
3994 $ilCtrl->setParameter($this,
"peer_id", $user_id);
3995 include_once
'./Services/Rating/classes/class.ilRatingGUI.php';
3997 $rating->setObject($this->ass->getId(),
"ass", $user_id,
"peer");
3998 $rating->setUserId($ilUser->getId());
3999 $rating =
'<div id="rtr_widget">'.$rating->getHTML(
false,
true,
4000 "il.ExcPeerReview.saveSingleRating(".$user_id.
", %rating%)").
'</div>';
4002 $ilCtrl->setParameter($this,
"ssrtg", 1);
4003 $tpl->addJavaScript(
"Modules/Exercise/js/ilExcPeerReview.js");
4004 $tpl->addOnLoadCode(
"il.ExcPeerReview.setAjax('".
4005 $ilCtrl->getLinkTarget($this,
"updatePeerReviewComments",
"",
true,
false).
4007 $ilCtrl->setParameter($this,
"ssrtg",
"");
4014 $user_id = $ilUser->getId();
4015 $cancel_cmd =
"showOverview";
4018 $this->tabs_gui->clearTargets();
4019 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this, $cancel_cmd));
4023 if(($user_id != $ilUser->getId() || (bool)$_GET[
"grd"]))
4025 if(!stristr($cancel_cmd,
"peer"))
4027 include_once
"Services/User/classes/class.ilUserUtil.php";
4032 $a_form->setDescription($lng->txt(
"id").
": ".(int)$_GET[
"seq"]);
4034 foreach($this->ass->getPeerReviewsByPeerId($user_id) as $item)
4036 if($item[
"giver_id"] == $ilUser->getId())
4038 $a_form->getItemByPostVar(
"comm")->setValue($item[
"pcomment"]);
4048 $files = array_shift($files);
4049 if(trim($files[
"atext"]))
4051 $text = $a_form->getItemByPostVar(
"atxt");
4057 $this->tpl->setContent($a_form->getHTML());
4073 $ilCtrl->redirect($this,
"member");
4076 $ilTabs->clearTargets();
4077 $ilTabs->setBackTarget($lng->txt(
"back"),
4078 $ilCtrl->getLinkTarget($this,
"members"));
4080 if($a_show_peer_review)
4082 $cmd =
"listTextAssignmentWithPeerReview";
4086 $cmd =
"listTextAssignment";
4088 include_once
"Modules/Exercise/classes/class.ilExAssignmentListTextTableGUI.php";
4090 $tpl->setContent($tbl->getHTML());
4096 return ($this->ass &&
4097 $this->ass->getPeerReview() &&
4098 $this->ass->getDeadline() &&
4099 $this->ass->getDeadline() < time() &&
4100 (!$this->ass->getPeerReviewDeadline() ||
4101 $this->ass->getPeerReviewDeadline() > time()));
4110 $ilCtrl->redirect($this,
"showOverview");
4115 $this->tabs_gui->clearTargets();
4116 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this,
"showOverview"));
4118 $peer_items = $this->ass->getPeerReviewsByGiver($ilUser->getId());
4119 if(!
sizeof($peer_items))
4122 $ilCtrl->redirect($this,
"showOverview");
4128 $dl = $this->ass->getPeerReviewDeadline();
4129 if(!$dl || $dl < time())
4131 ilUtil::sendInfo(sprintf($this->lng->txt(
"exc_peer_review_missing_info"), $missing));
4135 ilUtil::sendInfo(sprintf($this->lng->txt(
"exc_peer_review_missing_info_deadline"), $missing,
4140 $tpl->addJavaScript(
"Modules/Exercise/js/ilExcPeerReview.js");
4141 $tpl->addOnLoadCode(
"il.ExcPeerReview.setAjax('".
4142 $ilCtrl->getLinkTarget($this,
"updatePeerReviewComments",
"",
true,
false).
4145 include_once
"Modules/Exercise/classes/class.ilExAssignmentPeerReviewTableGUI.php";
4148 $tpl->setContent($tbl->getHTML());
4158 $ilCtrl->redirect($this,
"showOverview");
4163 $peer_items = $this->ass->getPeerReviewsByGiver($ilUser->getId());
4164 if(!
sizeof($peer_items))
4167 $ilCtrl->redirect($this,
"showOverview");
4170 foreach(
$_POST[
"pc"] as $idx => $value)
4172 $idx = explode(
"__", $idx);
4174 if($idx[0] == $ilUser->getId() && trim($value))
4181 $ilCtrl->redirect($this,
"editPeerReview");
4190 !$ilCtrl->isAsynch())
4195 $rating_peer_id =
$_POST[
"rating_peer_id"];
4196 $giver_id = $ilUser->getId();
4199 include_once
'./Services/Rating/classes/class.ilRating.php';
4201 $rating_peer_id,
"peer", $giver_id,
$_POST[
"rating"]);
4204 foreach(
$_POST[
"pc"] as $peer_id => $value)
4215 $ilCtrl->setParameter($this->parent_obj,
"peer_id", $rating_peer_id);
4217 include_once
'./Services/Rating/classes/class.ilRatingGUI.php';
4219 $rating->setObject($this->ass->getId(),
"ass", $rating_peer_id,
"peer");
4220 $rating->setUserId($giver_id);
4224 echo $rating->getHTML(
false,
true,
4225 "il.ExcPeerReview.saveComments(".$rating_peer_id.
", %rating%)");
4229 echo
'<div id="rtr_widget">'.$rating->getHTML(
false,
true,
4230 "il.ExcPeerReview.saveSingleRating(".$rating_peer_id.
", %rating%)").
'</div>';
4233 echo $tpl->getOnLoadCodeForAsynch();
4244 $ilCtrl->redirect($this,
"editPeerReview");
4250 $ilCtrl->redirect($this,
"editPeerReview");
4258 !$this->ass->getPeerReview() ||
4259 !$this->ass->getDeadline() ||
4260 $this->ass->getDeadline()-time() > 0)
4262 $ilCtrl->redirect($this,
"showOverview");
4266 if((
int)
$_GET[
"grd"])
4270 if((
int)$_GET[
"grd"] == 1)
4272 $user_id = (int)$_GET[
"member_id"];
4273 $cancel_cmd =
"members";
4277 $user_id = (int)$_GET[
"part_id"];
4278 $cancel_cmd =
"showParticipant";
4286 $user_id = $ilUser->getId();
4287 $cancel_cmd =
"showOverview";
4290 $this->tabs_gui->clearTargets();
4291 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this, $cancel_cmd));
4293 $peer_items = $this->ass->getPeerReviewsByPeerId($user_id,
true);
4294 if(!
sizeof($peer_items))
4298 $ilCtrl->redirect($this,
"showOverview");
4301 include_once
"Modules/Exercise/classes/class.ilExAssignmentPeerReviewTableGUI.php";
4303 $this->ass, $user_id, $peer_items,
"exc_peer_review_show", $cancel_cmd,
true);
4305 $tpl->setContent($tbl->getHTML());
4313 !$this->ass->getFeedbackFile() ||
4314 !$this->ass->getDeadline() ||
4315 $this->ass->getDeadline() > time())
4317 $ilCtrl->redirect($this,
"showOverview");
4331 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
4333 $form->addCommandButton(
"uploadMultiFeedback", $lng->txt(
"upload"));
4334 $form->addCommandButton(
"members", $lng->txt(
"cancel"));
4337 $fi =
new ilFileInputGUI($lng->txt(
"exc_multi_feedback_file"),
"mfzip");
4339 $fi->setRequired(
true);
4340 $form->addItem($fi);
4343 $form->setFormAction($this->ctrl->getFormAction($this,
"uploadMultiFeedback"));
4356 global $ilTabs, $ilToolbar,
$lng,
$tpl;
4358 $ass_id = (int)
$_GET[
"ass_id"];
4362 $ilTabs->activateTab(
"grades");
4366 $ilToolbar->addButton($lng->txt(
"exc_download_zip_structure"),
4367 $this->ctrl->getLinkTarget($this,
"downloadMultiFeedbackZip"));
4374 $tpl->setContent($a_form->getHTML());
4383 $ass->sendMultiFeedbackStructureFile($this->
object);
4391 $ass_id = (int)
$_GET[
"ass_id"];
4395 if($form->checkInput())
4401 $this->ctrl->redirect($this,
"showMultiFeedbackConfirmationTable");
4406 $this->ctrl->redirect($this,
"showMultiFeedback");
4410 $form->setValuesByPost();
4422 global $ilTabs,
$tpl;
4424 $ilTabs->activateTab(
"grades");
4429 include_once(
"./Modules/Exercise/classes/class.ilFeedbackConfirmationTable2GUI.php");
4431 $tpl->setContent(
$tab->getHTML());
4441 $ass->clearMultiFeedbackDirectory();
4443 $this->ctrl->redirect($this,
"members");
4453 $ass->saveMultiFeedbackFiles(
$_POST[
"file"]);
4456 $this->ctrl->redirect($this,
"members");