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"));
89 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
93 include_once(
"./Services/User/classes/class.ilUserUtil.php");
94 $noti_rec_ids = array();
97 $team_id = $this->ass->getTeamId((
int)
$_GET[
"member_id"]);
98 $feedback_id =
"t".$team_id;
100 foreach($this->ass->getTeamMembers($team_id) as $team_user_id)
103 $noti_rec_ids[] = $team_user_id;
105 $fs_title = implode(
" / ", $fs_title);
109 $feedback_id = $noti_rec_ids = (int)
$_GET[
"member_id"];
113 include_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
114 $fs_gui =
new ilFileSystemGUI($fstorage->getFeedbackPath($feedback_id));
116 $fs_gui->setAllowDirectories(
false);
117 $fs_gui->setTitle($lng->txt(
"exc_fb_files").
" - ".
120 $pcommand = $fs_gui->getLastPerformedCommand();
121 if (is_array($pcommand) && $pcommand[
"cmd"] ==
"create_file")
123 $this->
object->sendFeedbackFileNotification($pcommand[
"name"],
124 $noti_rec_ids, (
int) $_GET[
"ass_id"]);
126 $ret = $this->ctrl->forwardCommand($fs_gui);
131 $ilTabs->activateTab(
"ass_files");
132 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
135 include_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
138 $fs_gui->setAllowDirectories(
false);
139 $ret = $this->ctrl->forwardCommand($fs_gui);
143 case "ilinfoscreengui":
144 $ilTabs->activateTab(
"info");
148 case 'ilpermissiongui':
149 $ilTabs->activateTab(
"permissions");
150 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
152 $ret =& $this->ctrl->forwardCommand($perm_gui);
155 case "illearningprogressgui":
156 $ilTabs->activateTab(
"learning_progress");
157 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
160 $this->object->getRefId(),
161 $_GET[
'user_id'] ?
$_GET[
'user_id'] : $ilUser->getId());
162 $this->ctrl->forwardCommand($new_gui);
163 $this->tabs_gui->setTabActive(
'learning_progress');
166 case 'ilrepositorysearchgui':
167 $ilTabs->activateTab(
"grades");
168 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
172 $rep_search->setTitle($this->lng->txt(
"exc_add_participant"));
173 $rep_search->setCallback($this,
'addMembersObject');
176 $this->tabs_gui->setTabActive(
'members');
177 $this->ctrl->setReturn($this,
'members');
179 #$this->__setSubTabs('members');
180 #$this->tabs_gui->setSubTabActive('members');
184 $this->ctrl->saveParameterByClass(
'ilRepositorySearchGUI',
'ctx', 1);
186 $rep_search->setTitle($this->lng->txt(
"exc_team_member_add"));
187 $rep_search->setCallback($this,
'addTeamMemberActionObject');
191 $this->ctrl->setReturn($this,
'submissionScreenTeam');
193 $ret =& $this->ctrl->forwardCommand($rep_search);
196 case 'ilobjectcopygui':
197 $ilCtrl->saveParameter($this,
'new_type');
198 $ilCtrl->setReturnByClass(get_class($this),
'create');
200 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
203 $this->ctrl->forwardCommand($cp);
207 $ilTabs->activateTab(
"export");
208 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
210 $exp_gui->addFormat(
"xml");
211 $ret = $this->ctrl->forwardCommand($exp_gui);
214 case 'ilshoppurchasegui':
215 include_once
'./Services/Payment/classes/class.ilShopPurchaseGUI.php';
218 $this->ctrl->forwardCommand($sp);
221 case "ilcommonactiondispatchergui":
222 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
224 $this->ctrl->forwardCommand($gui);
227 case "ilcertificategui":
229 $this->tabs_gui->activateTab(
"settings");
230 $this->tabs_gui->activateSubTab(
"certificate");
231 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
232 include_once
"./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
234 $this->ctrl->forwardCommand($output_gui);
278 $ilUser->getId(),
$_REQUEST[
"delivered"]);
284 $ilCtrl->redirect($this,
"submissionScreen");
297 $this->tabs_gui->clearTargets();
298 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
299 $this->ctrl->getLinkTarget($this,
"submissionScreen"));
304 if (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0))
307 $ilCtrl->redirect($this,
"submissionScreen");
310 if (!is_array(
$_POST[
"delivered"]) || count(
$_POST[
"delivered"]) == 0)
313 $ilCtrl->redirect($this,
"submissionScreen");
317 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
319 $cgui->setFormAction($ilCtrl->getFormAction($this));
320 $cgui->setHeaderText($lng->txt(
"info_delete_sure"));
321 $cgui->setCancel($lng->txt(
"cancel"),
"submissionScreen");
322 $cgui->setConfirm($lng->txt(
"delete"),
"deleteDelivered");
327 foreach (
$_POST[
"delivered"] as $i)
331 foreach ($files as $f)
333 if ($f[
"returned_id"] == $i)
338 $cgui->addItem(
"delivered[]", $i,
$title);
341 $tpl->setContent($cgui->getHTML());
357 if (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0))
360 $ilCtrl->redirect($this,
"submissionScreen");
363 if (count(
$_POST[
"delivered"]) && (mktime() < $this->ass->getDeadline() ||
364 $this->ass->getDeadline() == 0))
366 $this->
object->deleteDeliveredFiles($this->object->getId(), (int)
$_GET[
"ass_id"],
367 $_POST[
"delivered"], $ilUser->id);
369 $this->
object->handleSubmission((
int)
$_GET[
'ass_id']);
377 $ilCtrl->redirect($this,
"submissionScreen");
390 $this->tabs_gui->activateTab(
"submissions");
395 if (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0))
401 $ilToolbar->addButton($this->lng->txt(
"file_add"),
402 $this->ctrl->getLinkTarget($this,
"uploadForm"));
404 $ilToolbar->addButton($this->lng->txt(
"header_zip"),
405 $this->ctrl->getLinkTarget($this,
"uploadZipForm"));
408 include_once(
"./Modules/Exercise/classes/class.ilExcDeliveredFilesTableGUI.php");
410 $this->tpl->setContent(
$tab->getHTML());
418 if (mktime() < $this->ass->getDeadline() || ($this->ass->getDeadline() == 0))
420 $this->tabs_gui->clearTargets();
421 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
422 $this->ctrl->getLinkTarget($this,
"submissionScreen"));
425 $this->tpl->setContent($this->form->getHTML());
429 $this->ctrl->redirect($this,
"submissionScreen");
438 if (mktime() < $this->ass->getDeadline() || ($this->ass->getDeadline() == 0))
440 $this->tabs_gui->clearTargets();
441 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
442 $this->ctrl->getLinkTarget($this,
"submissionScreen"));
445 $this->tpl->setContent($this->form->getHTML());
449 $this->ctrl->redirect($this,
"submissionScreen");
460 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
464 include_once(
"./Services/Form/classes/class.ilFileWizardInputGUI.php");
468 $this->form->addItem($fi);
470 $this->form->addCommandButton(
"deliverFile", $lng->txt(
"upload"));
471 $this->form->addCommandButton(
"submissionScreen", $lng->txt(
"cancel"));
473 $this->form->setTitle($lng->txt(
"file_add"));
474 $this->form->setFormAction($ilCtrl->getFormAction($this));
484 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
488 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
491 $this->form->addItem($fi);
493 $this->form->addCommandButton(
"deliverUnzip", $lng->txt(
"upload"));
494 $this->form->addCommandButton(
"submissionScreen", $lng->txt(
"cancel"));
496 $this->form->setTitle($lng->txt(
"header_zip"));
497 $this->form->setFormAction($ilCtrl->getFormAction($this));
510 foreach ($_FILES[
"deliver"][
"name"] as $k => $v)
513 "name" => $_FILES[
"deliver"][
"name"][$k],
514 "type" => $_FILES[
"deliver"][
"type"][$k],
515 "tmp_name" => $_FILES[
"deliver"][
"tmp_name"][$k],
516 "error" => $_FILES[
"deliver"][
"error"][$k],
517 "size" => $_FILES[
"deliver"][
"size"][$k],
519 if(!$this->object->deliverFile(
$file, (
int)
$_GET[
"ass_id"], $ilUser->id))
532 $this->
object->handleSubmission((
int)$_GET[
'ass_id']);
534 $ilCtrl->redirect($this,
"submissionScreen");
546 if (preg_match(
"/zip/",$_FILES[
"deliver"][
"type"]) == 1)
548 if($this->object->processUploadedFile($_FILES[
"deliver"][
"tmp_name"],
"deliverFile",
false,
549 (
int)
$_GET[
"ass_id"]))
552 $this->
object->handleSubmission((
int)$_GET[
'ass_id']);
556 $ilCtrl->redirect($this,
"submissionScreen");
574 $this->ctrl->redirect($this,
"view");
581 $feedback_id =
"t".$ass->getTeamId($ilUser->getId());
585 $feedback_id = $ilUser->getId();
589 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
591 $files = $storage->getFeedbackFiles($feedback_id);
593 foreach($files as $fb_file)
595 if($fb_file ==
$file)
603 echo
"FILE DOES NOT EXIST";
608 $not_started_yet =
false;
609 if ($ass->getStartTime() > 0 && time() - $ass->getStartTime() <= 0)
611 $not_started_yet =
true;
615 if (!$not_started_yet)
617 $p = $storage->getFeedbackFilePath($feedback_id,
$file);
639 $this->ctrl->redirect($this,
"view");
643 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
646 foreach($files as $lfile)
648 if($lfile[
"name"] ==
$file)
656 echo
"FILE DOES NOT EXIST";
662 $not_started_yet =
false;
663 if ($ass->getStartTime() > 0 && time() - $ass->getStartTime() <= 0)
665 $not_started_yet =
true;
669 if (!$not_started_yet)
671 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
673 $p = $storage->getAssignmentFilePath(
$file);
682 $a_new_object->saveData();
685 ilUtil::redirect(
"ilias.php?baseClass=ilExerciseHandlerGUI&ref_id=".$a_new_object->
getRefId().
"&cmd=addAssignment");
693 $a_form->
setTitle($this->lng->txt(
"exc_edit_exercise"));
697 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"exc_show_submissions"),
"show_submissions");
698 $cb->
setInfo($this->lng->txt(
"exc_show_submissions_info"));
705 $op1 =
new ilRadioOption($this->lng->txt(
"exc_pass_all"),
"all",
706 $this->lng->txt(
"exc_pass_all_info"));
707 $radg->addOption($op1);
708 $op2 =
new ilRadioOption($this->lng->txt(
"exc_pass_minimum_nr"),
"nr",
709 $this->lng->txt(
"exc_pass_minimum_nr_info"));
710 $radg->addOption($op2);
715 $ni->setMaxLength(4);
716 $ni->setRequired(
true);
717 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
719 $min = max($mand, 1);
720 $ni->setMinValue($min);
721 $op2->addSubItem($ni);
725 $cbox =
new ilCheckboxInputGUI($this->lng->txt(
"exc_submission_notification"),
"notification");
726 $cbox->
setInfo($this->lng->txt(
"exc_submission_notification_info"));
729 $subcompl =
new ilCheckboxInputGUI($this->lng->txt(
'exc_completion_by_submission'),
'completion_by_submission');
730 $subcompl->
setInfo($this->lng->txt(
'exc_completion_by_submission_info'));
731 $subcompl->setValue(1);
742 $a_values[
"desc"] = $this->
object->getLongDescription();
743 $a_values[
"show_submissions"] = $this->
object->getShowSubmissions();
744 $a_values[
"pass_mode"] = $this->
object->getPassMode();
745 if ($a_values[
"pass_mode"] ==
"nr")
747 $a_values[
"pass_nr"] = $this->
object->getPassNr();
750 include_once
"./Services/Notification/classes/class.ilNotification.php";
753 $this->
object->getId());
755 $a_values[
'completion_by_submission'] = $this->
object->isCompletionBySubmissionEnabled();
761 $this->
object->setShowSubmissions($a_form->
getInput(
"show_submissions"));
762 $this->
object->setPassMode($a_form->
getInput(
"pass_mode"));
763 if ($this->object->getPassMode() ==
"nr")
765 $this->
object->setPassNr($a_form->
getInput(
"pass_nr"));
768 $this->
object->setCompletionBySubmission($a_form->
getInput(
'completion_by_submission') == 1 ?
true :
false);
770 include_once
"./Services/Notification/classes/class.ilNotification.php";
772 $ilUser->getId(), $this->
object->getId(),
773 (bool)$a_form->
getInput(
"notification"));
778 $this->ctrl->redirect($this,
"view");
787 if(!$this->object->addUploadedFile($_FILES[
"zipfile"],
true))
791 $this->ctrl->redirect($this,
"edit");
801 if(!$this->object->addUploadedFile($_FILES[
"file"]))
805 $this->ctrl->redirect($this,
"edit");
818 if (
$_POST[
"downloadReturned"])
820 $this->
object->members_obj->deliverReturnedFiles(key(
$_POST[
"downloadReturned"]));
835 case "redirectFeedbackMail":
839 case "delete_member":
853 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId()) &&
854 $this->object->getShowSubmissions() &&
855 $this->
object->getTimestamp() - time() <= 0)
865 $this->object->getId(), (int)
$_GET[
"ass_id"], (
int)
$_GET[
"member_id"]))
867 $this->ctrl->redirect($this,
"members");
880 $this->object->getId(), (int)
$_GET[
"ass_id"], (
int)
$_GET[
"member_id"],
true))
882 $this->ctrl->redirect($this,
"members");
892 if(!strlen(trim(
$_POST[
'user_login'])))
898 $users = explode(
',',
$_POST[
'user_login']);
901 foreach($users as $user)
920 $user_ids[] = $user_id;
944 if(!count($a_user_ids))
950 if(!$this->object->members_obj->assignMembers($a_user_ids))
963 foreach($a_user_ids as $user_id)
965 $ass_obj->getTeamId($user_id,
true);
973 $this->ctrl->redirect($this,
"members");
985 $ilTabs->activateTab(
"grades");
987 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
993 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
996 if (
$_GET[
"ass_id"] ==
"")
999 $_GET[
"ass_id"] = $a[
"id"];
1003 if (count($ass) > 1)
1006 foreach ($ass as $a)
1008 $options[$a[
"id"]] = $a[
"title"];
1010 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1012 $si->setOptions($options);
1014 $ilToolbar->addInputItem(
$si);
1016 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1017 $ilToolbar->addFormButton($this->lng->txt(
"exc_select_ass"),
1018 "selectAssignment");
1019 $ilToolbar->addSeparator();
1023 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
1028 'auto_complete_name' => $lng->txt(
'user'),
1029 'submit_name' => $lng->txt(
'add')
1033 $ilToolbar->addSpacer();
1035 $ilToolbar->addButton(
1036 $lng->txt(
"exc_search_users"),
1037 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
''));
1038 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1041 $parent_id = $tree->getParentId(
$_GET[
"ref_id"]);
1044 while ($parent_id != 1 && $type !=
"crs")
1046 $parent_id = $tree->getParentId($parent_id);
1052 $this->ctrl->setParameterByClass(
'ilRepositorySearchGUI',
"list_obj", $parent_obj_id);
1053 $this->lng->loadLanguageModule(
"exercise");
1055 $ilToolbar->addButton($this->lng->txt(
"exc_crs_add_members"),
1056 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'listUsers'));
1059 if (count($ass) > 0)
1061 include_once(
"./Modules/Exercise/classes/class.ilExerciseMemberTableGUI.php");
1063 $tpl->setContent($exc_tab->getHTML());
1079 $ilTabs->activateTab(
"grades");
1094 $ilTabs->activateTab(
"grades");
1098 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
1100 $members = $this->
object->members_obj->getMembers();
1102 if (count($members) == 0)
1109 foreach ($members as $mem_id)
1113 include_once(
"./Services/User/classes/class.ilObjUser.php");
1115 $mems[$mem_id] = $name;
1121 if (
$_GET[
"part_id"] ==
"" && count($mems) > 0)
1123 $_GET[
"part_id"] = key($mems);
1127 if (count($mems) > 1)
1130 foreach ($mems as $k => $m)
1133 $m[
"lastname"].
", ".$m[
"firstname"].
" [".$m[
"login"].
"]";
1135 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1137 $si->setOptions($options);
1139 $ilToolbar->addInputItem(
$si);
1141 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1142 $ilToolbar->addFormButton($this->lng->txt(
"exc_select_part"),
1143 "selectParticipant");
1146 if (count($mems) > 0)
1148 include_once(
"./Modules/Exercise/classes/class.ilExParticipantTableGUI.php");
1150 $this->
object,
$_GET[
"part_id"]);
1151 $tpl->setContent($part_tab->getHTML());
1166 $ilTabs->activateTab(
"grades");
1181 $ilTabs->activateTab(
"grades");
1184 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
1186 $mems = $mem_obj->getMembers();
1188 if (count($mems) > 0)
1190 $ilToolbar->addButton($lng->txt(
"exc_export_excel"),
1191 $ilCtrl->getLinkTarget($this,
"exportExcel"));
1194 include_once(
"./Modules/Exercise/classes/class.ilExGradesTableGUI.php");
1196 $this->
object, $mem_obj);
1197 $tpl->setContent($grades_tab->getHTML());
1209 if (
$_GET[
"member_id"] !=
"")
1217 $members = array(
$_GET[
"member_id"]);
1220 else if(count(
$_POST[
"member"]) > 0)
1224 foreach(array_keys(
$_POST[
"member"]) as $user_id)
1228 $members = array_unique($members);
1232 $members = array_keys(
$_POST[
"member"]);
1239 foreach($members as $user_id)
1244 $logins = implode($logins,
",");
1246 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
1251 $this->ctrl->redirect($this,
"members");
1263 foreach($this->object->members_obj->getMembers() as $member_id)
1267 (int)
$_GET[
"ass_id"], $member_id);
1273 $members[$member_id] = $tmp_obj->getFirstname() .
" " . $tmp_obj->getLastname();
1279 (int)
$_GET[
"ass_id"], $members);
1292 include_once
"./Modules/Group/classes/class.ilObjGroup.php";
1294 $all_members = array();
1295 foreach($a_result as $group)
1299 $members = $tmp_grp_obj->getGroupMemberIds();
1300 $all_members = array_merge($all_members,$members);
1303 $all_members = array_unique($all_members);
1304 foreach($all_members as $member)
1306 $result[] = array(
"id" => $member);
1315 include_once
"./Services/Object/classes/class.ilObjectFactory.php";
1317 foreach($a_result as $obj)
1320 $this->tpl->setCurrentBlock(
"OBJ_SELECT_ROW");
1321 $this->tpl->setVariable(
"OBJ_ROW_TITLE",$tmp_obj->getTitle());
1322 $this->tpl->setVariable(
"OBJ_ROW_ID",$tmp_obj->getRefId());
1323 $this->tpl->setVariable(
"OBJ_ROW_DESCRIPTION",$tmp_obj->getDescription());
1324 $this->tpl->parseCurrentBlock();
1328 $this->tpl->setCurrentBlock(
"OBJ_SELECT");
1329 $this->tpl->setVariable(
"OBJ_SELECT_TITLE",$this->lng->txt(
"title"));
1330 $this->tpl->setVariable(
"OBJ_SELECT_DESCRIPTION",$this->lng->txt(
"description"));
1332 $this->tpl->setVariable(
"OBJ_BTN1_VALUE",$this->lng->txt(
"select"));
1333 $this->tpl->setVariable(
"OBJ_BTN2_VALUE",$this->lng->txt(
"cancel"));
1334 $this->tpl->parseCurrentBlock();
1346 if(!count(
$_POST[
"member"]))
1356 foreach(
$_POST[
"member"] as $user_id => $value)
1359 foreach($tmembers as $tuser_id)
1361 $members[$tuser_id] = 1;
1367 $members =
$_POST[
"member"];
1370 $this->
object->sendAssignment($this->object->getId(),
1371 (int)
$_GET[
"ass_id"], $members);
1375 $ilCtrl->redirect($this,
"members");
1386 $ilTabs->activateTab(
"grades");
1388 if (!is_array(
$_POST[
"member"]) || count(
$_POST[
"member"]) == 0)
1391 $ilCtrl->redirect($this,
"members");
1395 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1397 $cgui->setFormAction($ilCtrl->getFormAction($this));
1398 $cgui->setHeaderText($lng->txt(
"exc_msg_sure_to_deassign_participant"));
1399 $cgui->setCancel($lng->txt(
"cancel"),
"members");
1400 $cgui->setConfirm($lng->txt(
"remove"),
"deassignMembers");
1406 foreach(
$_POST[
"member"] as $user_id => $value)
1409 foreach($tmembers as $tuser_id)
1411 $members[$tuser_id] = 1;
1417 $members =
$_POST[
"member"];
1420 include_once(
"./Services/User/classes/class.ilUserUtil.php");
1421 foreach ($members as $k => $m)
1423 $cgui->addItem(
"member[$k]", $m,
1427 $tpl->setContent($cgui->getHTML());
1440 if(is_array(
$_POST[
"member"]))
1444 $this->
object->members_obj->deassignMember((
int)
$usr_id);
1447 $ilCtrl->redirect($this,
"members");
1452 $ilCtrl->redirect($this,
"members");
1460 if(!isset(
$_POST[
'comments_value']))
1465 $this->
object->members_obj->setNoticeForMember(
$_GET[
"member_id"],
1490 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
1494 $saved_for = array();
1496 foreach(
$_POST[
"id"] as $key => $value)
1500 if (count(
$_POST[
"member"]) > 0 &&
$_POST[
"member"][$key] !=
"1")
1506 if (count(
$_POST[
"member"]) > 0)
1509 $saved_for[] = $uname[
"lastname"].
", ".$uname[
"firstname"];
1515 $ass_id = (int)
$_GET[
"ass_id"];
1516 $user_id = (int) $key;
1520 $ass_id = (int) $key;
1521 $user_id = (int)
$_GET[
"part_id"];
1527 $team_id = $this->ass->getTeamId($user_id);
1528 $user_ids = $this->ass->getTeamMembers($team_id);
1530 if (count(
$_POST[
"member"]) > 0)
1532 foreach($user_ids as $user_id)
1534 if($user_id != $key)
1537 $saved_for[] = $uname[
"lastname"].
", ".$uname[
"firstname"];
1544 $user_ids = array($user_id);
1547 foreach($user_ids as $user_id)
1567 if (count($saved_for) > 0)
1569 $save_for_str =
"(".implode($saved_for,
" - ").
")";
1574 $ilCtrl->redirect($this,
"members");
1578 $ilCtrl->redirect($this,
"showParticipant");
1587 for($i=0; $i<24; $i++)
1589 $hours[$i] = $i < 10 ?
"0".$i : $i;
1594 for($i=0;$i<60;$i++)
1596 $minutes[$i] = $i < 10 ?
"0".$i : $i;
1601 for($i=1; $i<32; $i++)
1603 $days[$i] = $i < 10 ?
"0".$i : $i;
1608 for($i=1; $i<13; $i++)
1610 $month[$i] = $i < 10 ?
"0".$i : $i;
1615 for($i = date(
"Y",time());$i < date(
"Y",time()) + 3;++$i)
1625 foreach($a_result as $user)
1627 if(!$this->object->members_obj->isAssigned($user[
"id"]))
1629 $filtered[] = $user;
1633 return $filtered ? $filtered : array();
1645 $ilTabs->addSubTab(
"assignment", $lng->txt(
"exc_assignment_view"),
1646 $ilCtrl->getLinkTarget($this,
"members"));
1647 $ilTabs->addSubTab(
"participant", $lng->txt(
"exc_participant_view"),
1648 $ilCtrl->getLinkTarget($this,
"showParticipant"));
1649 $ilTabs->addSubTab(
"grades", $lng->txt(
"exc_grades_overview"),
1650 $ilCtrl->getLinkTarget($this,
"showGradesOverview"));
1651 $ilTabs->activateSubTab($a_activate);
1663 $ilTabs->addSubTab(
"content", $lng->txt(
"view"),
1664 $ilCtrl->getLinkTarget($this,
"showOverview"));
1665 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
1667 $ilTabs->addSubTab(
"list_assignments", $lng->txt(
"edit"),
1668 $ilCtrl->getLinkTarget($this,
"listAssignments"));
1670 $ilTabs->activateSubTab($a_activate);
1683 $ilHelp->setScreenIdComponent(
"exc");
1685 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
1687 $tabs_gui->addTab(
"content",
1688 $lng->txt(
"exc_assignments"),
1689 $this->ctrl->getLinkTarget($this,
"showOverview"));
1692 $next_class = strtolower($this->ctrl->getNextClass());
1693 if ($ilAccess->checkAccess(
"visible",
"", $this->object->getRefId()))
1695 $tabs_gui->addTab(
"info",
1696 $lng->txt(
"info_short"),
1697 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
1701 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
1707 $tabs_gui->addTab(
"settings",
1708 $lng->txt(
"settings"),
1709 $this->ctrl->getLinkTarget($this,
'edit'));
1711 $tabs_gui->addTab(
"grades",
1712 $lng->txt(
"exc_submissions_and_grades"),
1713 $this->ctrl->getLinkTarget($this,
'members'));
1717 $save_sort_order =
$_GET[
"sort_order"];
1718 $save_sort_by =
$_GET[
"sort_by"];
1719 $save_offset =
$_GET[
"offset"];
1722 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
1725 $tabs_gui->addTab(
'learning_progress',
1726 $lng->txt(
'learning_progress'),
1727 $this->ctrl->getLinkTargetByClass(array(
'ilobjexercisegui',
'illearningprogressgui'),
''));
1730 $_GET[
"sort_order"] = $save_sort_order;
1731 $_GET[
"sort_by"] = $save_sort_by;
1732 $_GET[
"offset"] = $save_offset;
1735 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1737 $tabs_gui->addTab(
"export",
1738 $lng->txt(
"export"),
1739 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
1744 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->ref_id))
1746 $tabs_gui->addTab(
'permissions',
1747 $lng->txt(
"perm_settings"),
1748 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"));
1759 $this->ctrl->setCmd(
"showSummary");
1760 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1771 $ilTabs->activateTab(
"info");
1775 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1778 $info->enablePrivateNotes();
1780 $info->enableNews();
1781 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1783 $info->enableNewsEditing();
1784 $info->setBlockProperty(
"news",
"settings",
true);
1791 $info->addSection($this->lng->txt(
"exc_overview"));
1792 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
1796 foreach ($ass as $a)
1799 if ($a[
"mandatory"])
1804 $info->addProperty($lng->txt(
"exc_assignments"), $cnt);
1805 $info->addProperty($lng->txt(
"exc_mandatory"), $mcnt);
1806 if ($this->object->getPassMode() !=
"nr")
1808 $info->addProperty($lng->txt(
"exc_pass_mode"),
1809 $lng->txt(
"exc_msg_all_mandatory_ass"));
1813 $info->addProperty($lng->txt(
"exc_pass_mode"),
1814 sprintf($lng->txt(
"exc_msg_min_number_ass"), $this->
object->getPassNr()));
1818 include_once(
"Services/Tracking/classes/class.ilLPMarks.php");
1819 if ($ilAccess->checkAccess(
"read",
"", $this->ref_id))
1824 $st = $this->
object->determinStatusOfUser($ilUser->getId());
1825 $status = $st[
"overall_status"];
1826 if ($lpcomment !=
"" || $mark !=
"" || $status !=
"notgraded")
1828 $info->addSection($this->lng->txt(
"exc_feedback_from_tutor"));
1829 if ($lpcomment !=
"")
1831 $info->addProperty($this->lng->txt(
"exc_comment"),
1836 $info->addProperty($this->lng->txt(
"exc_mark"),
1846 if ($status !=
"notgraded")
1848 $img =
'<img border="0" src="'.ilUtil::getImagePath(
"scorm/".$status.
".png").
'" '.
1849 ' alt="'.$lng->txt(
"exc_".$status).
'" title="'.$lng->txt(
"exc_".$status).
1850 '" style="vertical-align:middle;"/>';
1853 if ($st[
"failed_a_mandatory"])
1855 $add =
" (".$lng->txt(
"exc_msg_failed_mandatory").
")";
1857 else if ($status ==
"failed")
1859 $add =
" (".$lng->txt(
"exc_msg_missed_minimum_number").
")";
1861 $info->addProperty($this->lng->txt(
"status"),
1862 $img.
" ".$this->lng->txt(
"exc_".$status).$add);
1868 $this->ctrl->forwardCommand($info);
1874 $this->tabs_gui->activateSubTab(
"edit");
1880 $this->tabs_gui->addSubTab(
"edit",
1881 $this->lng->txt(
"general_settings"),
1882 $this->ctrl->getLinkTarget($this,
"edit"));
1884 include_once
"Services/Certificate/classes/class.ilCertificate.php";
1887 $this->tabs_gui->addSubTab(
"certificate",
1888 $this->lng->txt(
"certificate"),
1889 $this->ctrl->getLinkTarget($this,
"certificate"));
1902 if ($ilAccess->checkAccess(
"read",
"", $a_target))
1904 $_GET[
"ref_id"] = $a_target;
1905 $_GET[
"cmd"] =
"showOverview";
1906 $_GET[
"baseClass"] =
"ilExerciseHandlerGUI";
1907 include(
"ilias.php");
1910 else if ($ilAccess->checkAccess(
"visible",
"", $a_target))
1912 $_GET[
"ref_id"] = $a_target;
1913 $_GET[
"cmd"] =
"infoScreen";
1914 $_GET[
"baseClass"] =
"ilExerciseHandlerGUI";
1915 include(
"ilias.php");
1918 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1925 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
1935 if (is_object($this->
object))
1937 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
1954 $ilTabs->activateTab(
"content");
1957 $ilToolbar->addButton($lng->txt(
"exc_add_assignment"),
1958 $ilCtrl->getLinkTarget($this,
"addAssignment"));
1960 include_once(
"./Modules/Exercise/classes/class.ilAssignmentsTableGUI.php");
1962 $tpl->setContent(
$t->getHTML());
1970 global
$tpl, $ilTabs;
1974 $ilTabs->activateTab(
"content");
1978 $tpl->setContent($this->form->getHTML());
1991 $lng->loadLanguageModule(
"form");
1992 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1994 $this->form->setTableWidth(
"600px");
1995 if ($a_mode ==
"edit")
1997 $this->form->setTitle($lng->txt(
"exc_edit_assignment"));
2001 $this->form->setTitle($lng->txt(
"exc_new_assignment"));
2003 $this->form->setFormAction($ilCtrl->getFormAction($this));
2006 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2009 if(!$ilSetting->get(
'disable_wsp_blogs'))
2013 if($ilSetting->get(
'user_portfolios'))
2017 if(
sizeof($types) > 1)
2021 $ty->setRequired(
true);
2028 $this->form->addItem($ty);
2033 $ti->setRequired(
true);
2034 $this->form->addItem($ti);
2038 $this->form->addItem($cb);
2042 $edit_date->setShowTime(
true);
2043 $cb->addSubItem($edit_date);
2049 $this->form->addItem($dcb);
2054 $dcb->addSubItem($edit_date);
2058 $cb->
setInfo($this->lng->txt(
"exc_mandatory_info"));
2059 $cb->setChecked(
true);
2060 $this->form->addItem($cb);
2065 $this->form->addItem($desc_input);
2068 if ($a_mode ==
"create")
2072 $this->form->addItem($files);
2076 if ($a_mode ==
"create")
2078 $this->form->addCommandButton(
"saveAssignment", $lng->txt(
"save"));
2079 $this->form->addCommandButton(
"listAssignments", $lng->txt(
"cancel"));
2083 $this->form->addCommandButton(
"updateAssignment", $lng->txt(
"save"));
2084 $this->form->addCommandButton(
"listAssignments", $lng->txt(
"cancel"));
2098 $ilTabs->activateTab(
"content");
2102 if ($this->form->checkInput())
2104 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2111 $this->form->getItemByPostVar(
"start_time")->getDate();
2113 $this->form->getItemByPostVar(
"deadline")->getDate();
2118 $this->form->getItemByPostVar(
"start_time")
2119 ->setAlert($lng->txt(
"exc_start_date_should_be_before_end_date"));
2120 $this->form->getItemByPostVar(
"deadline")
2121 ->setAlert($lng->txt(
"exc_start_date_should_be_before_end_date"));
2122 $this->form->setValuesByPost();
2123 $tpl->setContent($this->form->getHtml());
2129 $ass->setTitle(
$_POST[
"title"]);
2130 $ass->setInstruction(
$_POST[
"instruction"]);
2131 $ass->setExerciseId($this->object->getId());
2132 $ass->setMandatory(
$_POST[
"mandatory"]);
2133 $ass->setType(
$_POST[
"type"]);
2135 if (
$_POST[
"start_time_cb"])
2138 $this->form->getItemByPostVar(
"start_time")->getDate();
2143 $ass->setStartTime(null);
2147 if (
$_POST[
"deadline_cb"])
2150 $this->form->getItemByPostVar(
"deadline")->getDate();
2155 $ass->setDeadline(null);
2161 $ass->uploadAssignmentFiles($_FILES[
"files"]);
2165 $ilCtrl->redirect($this,
"listAssignments");
2169 $this->form->setValuesByPost();
2170 $tpl->setContent($this->form->getHtml());
2184 $ilTabs->activateTab(
"ass_settings");
2188 $tpl->setContent($this->form->getHTML());
2200 $values[
"title"] = $ass->getTitle();
2201 if ($ass->getStartTime() > 0)
2203 $values[
"start_time_cb"] =
true;
2205 $values[
"mandatory"] = $ass->getMandatory();
2206 $values[
"instruction"] = $ass->getInstruction();
2207 $values[
"type"] = $ass->getType();
2208 if ($ass->getDeadline() > 0)
2210 $values[
"deadline_cb"] =
true;
2212 $this->form->setValuesByArray($values);
2214 if ($ass->getDeadline() > 0)
2217 $ed_item = $this->form->getItemByPostVar(
"deadline");
2218 $ed_item->
setDate($edit_date);
2221 if ($ass->getStartTime() > 0)
2224 $ed_item = $this->form->getItemByPostVar(
"start_time");
2225 $ed_item->
setDate($edit_date);
2231 $this->form->getItemByPostVar(
"type")->setDisabled(
true);
2246 $ilTabs->activateTab(
"content");
2250 if ($this->form->checkInput())
2252 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2259 $this->form->getItemByPostVar(
"start_time")->getDate();
2261 $this->form->getItemByPostVar(
"deadline")->getDate();
2266 $this->form->getItemByPostVar(
"start_time")
2267 ->setAlert($lng->txt(
"exc_start_date_should_be_before_end_date"));
2268 $this->form->getItemByPostVar(
"deadline")
2269 ->setAlert($lng->txt(
"exc_start_date_should_be_before_end_date"));
2270 $this->form->setValuesByPost();
2271 $tpl->setContent($this->form->getHtml());
2278 $ass->setTitle(
$_POST[
"title"]);
2279 $ass->setInstruction(
$_POST[
"instruction"]);
2280 $ass->setExerciseId($this->object->getId());
2281 $ass->setMandatory(
$_POST[
"mandatory"]);
2282 $ass->setType(
$_POST[
"type"]);
2284 if (
$_POST[
"start_time_cb"])
2287 $this->form->getItemByPostVar(
"start_time")->getDate();
2292 $ass->setStartTime(null);
2296 if (
$_POST[
"deadline_cb"])
2299 $this->form->getItemByPostVar(
"deadline")->getDate();
2304 $ass->setDeadline(null);
2309 $ilCtrl->redirect($this,
"listAssignments");
2313 $this->form->setValuesByPost();
2314 $tpl->setContent($this->form->getHtml());
2328 $ilTabs->activateTab(
"content");
2331 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0)
2334 $ilCtrl->redirect($this,
"listAssignments");
2338 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
2340 $cgui->setFormAction($ilCtrl->getFormAction($this));
2341 $cgui->setHeaderText($lng->txt(
"exc_conf_del_assignments"));
2342 $cgui->setCancel($lng->txt(
"cancel"),
"listAssignments");
2343 $cgui->setConfirm($lng->txt(
"delete"),
"deleteAssignments");
2345 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2347 foreach (
$_POST[
"id"] as $i)
2352 $tpl->setContent($cgui->getHTML());
2366 if (is_array(
$_POST[
"id"]))
2368 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2369 foreach(
$_POST[
"id"] as $id)
2381 $ilCtrl->redirect($this,
"listAssignments");
2393 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2397 $ilCtrl->redirect($this,
"listAssignments");
2409 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2413 $ilCtrl->redirect($this,
"listAssignments");
2423 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2425 $tpl->setDescription(
"");
2427 $ilTabs->clearTargets();
2428 $ilHelp->setScreenIdComponent(
"exc");
2430 $ilTabs->setBackTarget($lng->txt(
"back"),
2431 $ilCtrl->getLinkTarget($this,
"listAssignments"));
2433 $ilTabs->addTab(
"ass_settings",
2434 $lng->txt(
"settings"),
2435 $ilCtrl->getLinkTarget($this,
"editAssignment"));
2437 $ilTabs->addTab(
"ass_files",
2439 $ilCtrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"));
2457 include_once(
"./Services/Tracking/classes/class.ilLearningProgress.php");
2459 $this->
object->getRefId(),
'exc');
2461 $ilTabs->activateTab(
"content");
2465 if($this->object->hasUserCertificate($ilUser->getId()))
2467 include_once
"./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
2468 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
2472 $ilToolbar->addButton($this->lng->txt(
"certificate"),
2473 $this->ctrl->getLinkTarget($this,
"outCertificate"));
2477 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
2478 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
2480 $acc->setId(
"exc_ow_".$this->object->getId());
2482 include_once(
"./Modules/Exercise/classes/class.ilExAssignmentGUI.php");
2485 foreach ($ass_data as $ass)
2487 $acc->addItem($ass_gui->getOverviewHeader($ass),
2488 $ass_gui->getOverviewBody($ass));
2491 if (count($ass_data) < 2)
2493 $acc->setBehaviour(
"FirstOpen");
2497 $acc->setBehaviour(
"OneOpenSession");
2501 $tpl->setContent($acc->getHTML());
2509 global
$tpl, $ilTabs;
2513 $ilTabs->activateTab(
"content");
2516 include_once(
"./Modules/Exercise/classes/class.ilPublicSubmissionsTableGUI.php");
2518 $this->
object, (
int)
$_GET[
"ass_id"]);
2519 $tpl->setContent(
$tab->getHTML());
2528 $this->
object->exportGradesExcel();
2540 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
2542 if (is_array(
$_POST[
"lcomment"]))
2544 foreach (
$_POST[
"lcomment"] as $k => $v)
2546 $marks_obj =
new ilLPMarks($this->object->getId(), (int) $k);
2549 $marks_obj->update();
2553 $ilCtrl->redirect($this,
"showGradesOverview");
2562 include_once
"./Services/Notification/classes/class.ilNotification.php";
2565 include_once
"./Modules/Exercise/classes/class.ilExerciseMailNotification.php";
2568 $not->setAssignmentId($assignment_id);
2569 $not->setRefId($this->ref_id);
2570 $not->setRecipients($users);
2582 $this->tabs_gui->setTabActive(
"content");
2585 if (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0))
2590 $tpl =
new ilTemplate(
"tpl.exc_select_resource.html",
true,
true,
"Modules/Exercise");
2591 $tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"exc_create_blog").
": ".$this->ass->getTitle());
2593 $tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2594 $tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
2595 $tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2596 $tpl->setVariable(
"CMD_SUBMIT",
"saveBlog");
2597 $tpl->setVariable(
"CMD_CANCEL",
"showOverview");
2601 $this->tpl->setContent(
$tpl->get());
2610 $this->tabs_gui->clearTargets();
2611 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this,
"showOverview"));
2616 if (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0))
2621 $tpl =
new ilTemplate(
"tpl.exc_select_resource.html",
true,
true,
"Modules/Exercise");
2622 $tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"exc_select_blog").
": ".$this->ass->getTitle());
2624 $tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2625 $tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
2626 $tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2627 $tpl->setVariable(
"CMD_SUBMIT",
"setSelectedBlog");
2628 $tpl->setVariable(
"CMD_CANCEL",
"showOverview");
2632 $this->tpl->setContent(
$tpl->get());
2645 $parent_node =
$_POST[
"node"];
2647 include_once
"Modules/Blog/classes/class.ilObjBlog.php";
2648 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
2649 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
2652 $blog->setTitle($this->object->getTitle().
" - ".$this->ass->getTitle());
2657 $node_id =
$tree->insertObject($parent_node, $blog->getId());
2660 $access_handler->setPermissions($parent_node, $node_id);
2662 $this->
object->addResourceObject($node_id, $this->ass->getId(), $ilUser->getId());
2665 $this->ctrl->redirect($this,
"showOverview");
2674 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
2677 if($node && $node[
"type"] ==
"blog")
2680 $this->
object->addResourceObject($node[
"wsp_id"], $this->ass->getId(), $ilUser->getId());
2683 $this->ctrl->setParameter($this,
"blog_id", $node[
"wsp_id"]);
2684 $this->ctrl->redirect($this,
"askDirectionSubmission");
2703 foreach($submitted as $item)
2705 $files[] = $item[
"returned_id"];
2715 $this->tabs_gui->setTabActive(
"content");
2718 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
2724 $this->ctrl->setParameter($this,
"blog_id",
$_REQUEST[
"blog_id"]);
2725 $txt = $this->lng->txt(
"exc_direct_submit_blog");
2729 $this->ctrl->setParameter($this,
"prtf_id",
$_REQUEST[
"prtf_id"]);
2730 $txt = $this->lng->txt(
"exc_direct_submit_portfolio");
2732 $conf->setFormAction($this->ctrl->getFormAction($this,
"directSubmit"));
2734 $conf->setHeaderText($txt);
2735 $conf->setConfirm($this->lng->txt(
"submit"),
"directSubmit");
2736 $conf->setCancel($this->lng->txt(
"cancel"),
"showOverview");
2738 $tpl->setContent($conf->getHTML());
2751 $this->ctrl->setParameter($this,
"blog_id",
"");
2757 $this->ctrl->setParameter($this,
"prtf_id",
"");
2768 $this->ctrl->redirect($this,
"showOverview");
2781 if($this->
object && $this->ass)
2783 $blog_id = $a_blog_id;
2785 include_once
"Modules/Blog/classes/class.ilObjBlogGUI.php";
2787 if($blog_gui->object)
2789 $file = $blog_gui->buildExportFile();
2797 "tmp_name" =>
$file,
2800 $this->
object->deliverFile($meta, $this->ass->getId(), $ilUser->getId(),
true);
2803 $this->
object->handleSubmission($this->ass->getId());
2821 if($this->
object && $this->ass)
2823 $prtf_id = $a_portfolio_id;
2825 include_once
"Services/Portfolio/classes/class.ilObjPortfolio.php";
2827 if($prtf->getTitle())
2829 include_once
"Services/Portfolio/classes/class.ilPortfolioHTMLExport.php";
2831 $file = $export->buildExportFile();
2839 "tmp_name" =>
$file,
2842 $this->
object->deliverFile($meta, $this->ass->getId(), $ilUser->getId(),
true);
2845 $this->
object->handleSubmission($this->ass->getId());
2859 $this->tabs_gui->clearTargets();
2860 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this,
"showOverview"));
2865 if (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0))
2870 $tpl =
new ilTemplate(
"tpl.exc_select_resource.html",
true,
true,
"Modules/Exercise");
2872 include_once
"Services/Portfolio/classes/class.ilObjPortfolio.php";
2876 $tpl->setCurrentBlock(
"item");
2877 foreach($portfolios as $portfolio)
2879 $tpl->setVariable(
"ITEM_ID", $portfolio[
"id"]);
2880 $tpl->setVariable(
"ITEM_TITLE", $portfolio[
"title"]);
2881 $tpl->parseCurrentBlock();
2885 $tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"exc_select_portfolio").
": ".$this->ass->getTitle());
2886 $tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2887 $tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
2888 $tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2889 $tpl->setVariable(
"CMD_SUBMIT",
"setSelectedPortfolio");
2890 $tpl->setVariable(
"CMD_CANCEL",
"showOverview");
2894 $this->tpl->setContent(
$tpl->get());
2903 include_once
"Services/Portfolio/classes/class.ilObjPortfolio.php";
2905 $portfolio->setTitle($this->object->getTitle().
" - ".$this->ass->getTitle());
2906 $portfolio->create();
2908 $this->
object->addResourceObject($portfolio->getId(), $this->ass->getId(), $ilUser->getId());
2911 $this->ctrl->redirect($this,
"showOverview");
2921 $this->
object->addResourceObject(
$_POST[
"item"], $this->ass->getId(), $ilUser->getId());
2924 $this->ctrl->setParameter($this,
"prtf_id",
$_POST[
"item"]);
2925 $this->ctrl->redirect($this,
"askDirectionSubmission");
2936 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
2937 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
2938 require_once
'Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php';
2943 'exc_wspexpand',
$tree, $access_handler);
2944 $exp->setTargetGet(
'wsp_id');
2946 if($a_cmd ==
"selectBlog")
2948 $exp->removeAllFormItemTypes();
2949 $exp->addFilter(
'blog');
2950 $exp->addFormItemForType(
'blog');
2953 if(
$_GET[
'exc_wspexpand'] ==
'')
2956 $expanded =
$tree->readRootId();
2960 $expanded =
$_GET[
'exc_wspexpand'];
2963 $exp->setExpandTarget($this->ctrl->getLinkTarget($this, $a_cmd));
2964 $exp->setPostVar(
'node');
2965 $exp->setExpand($expanded);
2968 return $exp->getOutput();
2974 $this->tabs_gui->activateTab(
"settings");
2975 $this->tabs_gui->activateSubTab(
"certificate");
2977 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
2978 include_once
"./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
2980 $output_gui->certificateEditor();
2987 if($this->object->hasUserCertificate($ilUser->getId()))
2993 include_once
"./Services/Certificate/classes/class.ilCertificate.php";
2994 include_once
"./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
2996 $certificate->outCertificate(array(
"user_id" => $ilUser->getId()));
3007 $this->ctrl->redirect($this,
"submissionScreen");
3010 $this->tabs_gui->clearTargets();
3011 $ilHelp->setScreenIdComponent(
"exc");
3012 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
3013 $this->ctrl->getLinkTarget($this, $a_back_cmd));
3017 $this->tabs_gui->addTab(
"submissions", $this->lng->txt(
"files"),
3018 $this->ctrl->getLinkTarget($this,
"submissionScreen"));
3020 $this->tabs_gui->addTab(
"team", $this->lng->txt(
"exc_team"),
3021 $this->ctrl->getLinkTarget($this,
"submissionScreenTeam"));
3023 $this->tabs_gui->addTab(
"log", $this->lng->txt(
"exc_team_log"),
3024 $this->ctrl->getLinkTarget($this,
"submissionScreenTeamLog"));
3026 $this->tabs_gui->activateTab(
"team");
3028 $team_id = $this->ass->getTeamId($ilUser->getId());
3032 $team_id = $this->ass->getTeamId($ilUser->getId(),
true);
3035 if (!$this->object->members_obj->isAssigned($ilUser->getId()))
3037 $this->
object->members_obj->assignMember($ilUser->getId());
3045 $ilHelp->setScreenId(
"submissions");
3064 $read_only = (mktime() > $this->ass->getDeadline() && ($this->ass->getDeadline() != 0));
3072 $this->ctrl->setParameterByClass(
'ilRepositorySearchGUI',
'ctx', 1);
3073 $this->ctrl->setParameter($this,
'ctx', 1);
3076 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
3081 'auto_complete_name' => $this->lng->txt(
'user'),
3082 'submit_name' => $this->lng->txt(
'add')
3086 $ilToolbar->addSpacer();
3088 $ilToolbar->addButton(
3089 $this->lng->txt(
"exc_search_users"),
3090 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
''));
3091 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
3093 $parent_container_id = $this->
object->getParentContainerId();
3094 if ($parent_container_id)
3096 $this->ctrl->setParameterByClass(
'ilRepositorySearchGUI',
"list_obj", $parent_container_id);
3097 $this->lng->loadLanguageModule(
"exercise");
3099 $ilToolbar->addSpacer();
3105 $ilToolbar->addButton($this->lng->txt(
"exc_team_member_container_add"),
3106 $this->ctrl->getLinkTarget($this,
"addTeamMemberContainer"));
3110 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamTableGUI.php";
3114 $this->tpl->setContent($tbl->getHTML());
3121 $members = $this->
object->getParentMemberIds();
3124 $this->ctrl->redirect($this,
"submissionScreenTeam");
3127 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamTableGUI.php";
3131 $this->tpl->setContent($tbl->getHTML());
3143 $this->ctrl->redirect($this,
"submissionScreenTeam");
3146 $team_id = $this->ass->getTeamId($ilUser->getId());
3147 $has_files = $this->ass->getDeliveredFiles($this->object->getId(),
3148 $this->ass->getId(),
3151 foreach($ids as $user_id)
3153 $this->ass->addTeamMember($team_id, $user_id, $this->ref_id);
3158 if (!$this->object->members_obj->isAssigned($user_id))
3160 $this->
object->members_obj->assignMember($user_id);
3170 $this->ctrl->redirect($this,
"submissionScreenTeam");
3179 if(!count($a_user_ids))
3185 $team_id = $this->ass->getTeamId($ilUser->getId());
3186 $has_files = $this->ass->getDeliveredFiles($this->object->getId(),
3187 $this->ass->getId(),
3189 $all_members = $this->ass->getMembersOfAllTeams();
3190 $members = $this->ass->getTeamMembers($team_id);
3192 foreach($a_user_ids as $user_id)
3194 if(!in_array($user_id, $all_members))
3196 $this->ass->addTeamMember($team_id, $user_id, $this->ref_id);
3201 if (!$this->object->members_obj->isAssigned($user_id))
3203 $this->
object->members_obj->assignMember($user_id);
3211 else if(!in_array($user_id, $members))
3218 $this->ctrl->redirect($this,
"submissionScreenTeam");
3230 $this->ctrl->redirect($this,
"submissionScreenTeam");
3233 $team_id = $this->ass->getTeamId($ilUser->getId());
3234 $members = $this->ass->getTeamMembers($team_id);
3236 $team_deleted =
false;
3237 if(
sizeof($members) <=
sizeof($ids))
3239 if(
sizeof($members) == 1 && $members[0] == $ilUser->getId())
3247 $this->ctrl->redirect($this,
"submissionScreenTeam");
3255 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
3257 $cgui->setFormAction($this->ctrl->getFormAction($this));
3258 $cgui->setHeaderText($this->lng->txt(
"exc_team_member_remove_sure"));
3259 $cgui->setCancel($this->lng->txt(
"cancel"),
"submissionScreenTeam");
3260 $cgui->setConfirm($this->lng->txt(
"remove"),
"removeTeamMember");
3263 $this->ass->getId(), $ilUser->getId());
3265 include_once
"Services/User/classes/class.ilUserUtil.php";
3267 foreach($ids as $id)
3270 foreach ($files as
$file)
3272 if($file[
"owner_id"] == $id)
3274 $details[] = $file[
"filetitle"];
3278 if(
sizeof($details))
3280 $uname .=
": ".implode(
", ", $details);
3282 $cgui->addItem(
"id[]", $id, $uname);
3285 $tpl->setContent($cgui->getHTML());
3297 $this->ctrl->redirect($this,
"submissionScreenTeam");
3300 $team_id = $this->ass->getTeamId($ilUser->getId());
3301 $members = $this->ass->getTeamMembers($team_id);
3303 $team_deleted =
false;
3304 if(
sizeof($members) <=
sizeof($ids))
3306 if(
sizeof($members) == 1 && $members[0] == $ilUser->getId())
3308 $team_deleted =
true;
3313 $this->ctrl->redirect($this,
"submissionScreenTeam");
3317 foreach($ids as $user_id)
3319 $this->ass->removeTeamMember($team_id, $user_id, $this->ref_id);
3331 $this->ctrl->redirect($this,
"submissionScreenTeam");
3335 $this->ctrl->redirect($this,
"showOverview");
3342 $this->tabs_gui->activateTab(
"log");
3344 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamLogTableGUI.php";
3348 $this->tpl->setContent($tbl->getHTML());
3353 if(isset(
$_GET[
"lmem"]))
3355 $user_id =
$_GET[
"lmem"];
3360 $user_id =
$_GET[
"lpart"];
3361 $cmd =
"showParticipant";
3365 $this->ass->getTeamId($user_id,
true);
3368 $this->ctrl->redirect($this,
$cmd);
3374 $this->tabs_gui->activateTab(
"grades");
3376 if(isset(
$_GET[
"lmem"]))
3380 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
3381 $this->ctrl->getLinkTarget($this,
"members"));
3385 $this->ctrl->saveParameter($this,
"lmem");
3391 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
3392 $this->ctrl->getLinkTarget($this,
"showParticipant"));
3396 $this->ctrl->saveParameter($this,
"lpart");
3399 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamLogTableGUI.php";
3403 $this->tpl->setContent($tbl->getHTML());