53 $this->toolbar = $DIC->toolbar();
54 $this->
user = $DIC->user();
56 $ilTabs = $DIC->tabs();
57 $lng = $DIC->language();
60 $this->exercise = $a_exercise;
61 $this->submission = $a_submission;
66 $this->tabs_gui = $ilTabs;
75 $class =
$ilCtrl->getNextClass($this);
76 $cmd =
$ilCtrl->getCmd(
"submissionScreenTeam");
78 if (!$this->assignment->hasTeam() ||
79 !$this->submission->canView()) {
82 $this->team = $this->submission->getTeam();
84 if (!$this->submission->isTutor()) {
86 $this->tabs_gui->activateTab(
"team");
90 case 'ilrepositorysearchgui':
91 $this->ctrl->setReturn($this,
'submissionScreenTeam');
92 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
94 if (!$this->submission->isTutor()) {
97 $rep_search->setTitle($this->lng->txt(
"exc_team_member_add"));
98 $rep_search->setCallback($this,
'addTeamMemberActionObject');
99 $this->ctrl->forwardCommand($rep_search);
103 $this->{$cmd .
"Object"}();
112 $lng = $DIC->language();
121 $team_members = $a_submission->
getTeam()->getMembers();
122 if (
sizeof($team_members)) {
124 foreach ($team_members as $member_id) {
126 include_once(
"./Services/User/classes/class.ilUserUtil.php");
136 $button->setCaption(
"exc_delete_team");
137 $button->setUrl(
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"confirmDeleteTeam"));
138 $team .=
" " . $button->render();
141 $button->setCaption(
"exc_manage_team");
142 $button->setUrl(
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"submissionScreenTeam"));
145 $button->setCaption(
"exc_team_log");
146 $button->setUrl(
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"submissionScreenTeamLog"));
148 $team .=
"<br><br>" . $button->render();
153 if (!
$state->hasSubmissionEnded()) {
155 $team_info =
$lng->txt(
"exc_no_team_yet_notice");
157 $team_info =
'<span class="warning">' .
$lng->txt(
"exc_no_team_yet_notice") .
'</span>';
162 $button->setPrimary(
true);
163 $button->setCaption(
"exc_create_team");
164 $button->setUrl(
$ilCtrl->getLinkTargetByClass(array(
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"createTeam"));
165 $team_info .=
" " . $button->render();
167 $team_info .=
'<div class="ilFormInfo">' .
$lng->txt(
"exc_no_team_yet_info") .
'</div>';
169 $team_info .=
'<div class="ilFormInfo">' .
$lng->txt(
"exc_no_team_yet_info_tutor") .
'</div>';
172 $team_info =
'<span class="warning">' .
$lng->txt(
"exc_create_team_times_up_warning") .
'</span>';
181 $this->ctrl->returnToParent($this);
188 $ilTabs = $DIC->tabs();
190 $lng = $DIC->language();
194 $lng->txt(
"exc_team"),
195 $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"submissionScreenTeam")
200 $lng->txt(
"exc_team_log"),
201 $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"submissionScreenTeamLog")
207 return (($this->submission->canSubmit() &&
208 !$this->submission->getAssignment()->getTeamTutor()) ||
209 $this->submission->isTutor());
224 if ($this->submission->getAssignment()->afterDeadlineStrict(
false)) {
226 } elseif (!$read_only) {
227 $add_search = $this->submission->isTutor();
229 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
234 'auto_complete_name' => $this->lng->txt(
'user'),
235 'submit_name' => $this->lng->txt(
'add'),
236 'add_search' => $add_search,
237 'add_from_container' => $this->exercise->getRefId()
240 } elseif ($this->submission->getAssignment()->getTeamTutor()) {
244 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamTableGUI.php";
247 "submissionScreenTeam",
249 $this->exercise->getRefId(),
254 $this->tpl->setContent(
$tbl->getHTML());
260 $this->ctrl->redirect(
"submissionScreenTeam");
263 if (!count($a_user_ids)) {
270 foreach ($a_user_ids as $user_id) {
271 if ($this->team->addTeamMember($user_id, $this->exercise->getRefId())) {
272 $new_users[] = $user_id;
275 if (!$this->exercise->members_obj->isAssigned($user_id)) {
276 $this->exercise->members_obj->assignMember($user_id);
284 if (
sizeof($new_users)) {
286 $this->exercise->processExerciseStatus(
288 $this->team->getMembers(),
289 $this->submission->hasSubmitted(),
290 $this->submission->validatePeerReviews()
293 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
296 $this->ctrl->redirect($this,
"submissionScreenTeam");
309 if (!$this->submission->isTutor()) {
311 if ((
bool) $a_full_delete) {
312 $ids = $this->team->getMembers();
313 } elseif (isset(
$_POST[
"id"]) && is_array(
$_POST[
"id"])) {
316 $ids = array_filter(array_map(
'intval', $ids));
320 $this->ctrl->redirect($this,
"submissionScreenTeam");
323 $ids = array_filter(array_map(
'intval', array(
$_GET[
"id"])));
324 if (0 === count($ids)) {
329 $members = $this->team->getMembers();
330 if (
sizeof($members) <=
sizeof($ids)) {
331 if (
sizeof($members) == 1 && $members[0] ==
$ilUser->getId()) {
336 $this->ctrl->redirect($this,
"submissionScreenTeam");
340 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
342 $cgui->setFormAction($this->ctrl->getFormAction($this));
343 $cgui->setHeaderText($this->lng->txt(
"exc_team_member_remove_sure"));
344 $cgui->setConfirm($this->lng->txt(
"remove"),
"removeTeamMember");
345 $cgui->setCancel($this->lng->txt(
"cancel"), $this->submission->isTutor()
347 :
"submissionScreenTeam");
349 $files = $this->submission->getFiles();
351 include_once
"Services/User/classes/class.ilUserUtil.php";
353 foreach ($ids as
$id) {
355 foreach (
$files as $file) {
356 if ($file[
"owner_id"] == $id) {
357 $details[] = $file[
"filetitle"];
361 if (
sizeof($details)) {
362 $uname .=
": " . implode(
", ", $details);
364 $cgui->addItem(
"id[]", $id, $uname);
367 $tpl->setContent($cgui->getHTML());
374 $cancel_cmd = $this->submission->isTutor()
376 :
"submissionScreenTeam";
379 if ((
bool) $a_full_delete) {
380 $ids = $this->team->getMembers();
381 } elseif (isset(
$_POST[
"id"]) && is_array(
$_POST[
"id"])) {
384 $ids = array_filter(array_map(
'intval', $ids));
388 $this->ctrl->redirect($this, $cancel_cmd);
391 $team_deleted = (bool) $a_full_delete;
392 if (!$team_deleted) {
393 $members = $this->team->getMembers();
394 if (
sizeof($members) <=
sizeof($ids)) {
395 if (
sizeof($members) == 1 && $members[0] ==
$ilUser->getId()) {
396 $team_deleted =
true;
399 $this->ctrl->redirect($this, $cancel_cmd);
404 foreach ($ids as $user_id) {
405 $this->team->removeTeamMember($user_id, $this->exercise->getRefId());
409 $this->exercise->processExerciseStatus(
415 if (!$team_deleted) {
417 $this->exercise->processExerciseStatus(
419 $this->team->getMembers(),
420 $this->submission->hasSubmitted(),
421 $this->submission->validatePeerReviews()
425 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
426 if (!$team_deleted) {
427 $this->ctrl->redirect($this, $cancel_cmd);
429 $this->ctrl->redirect($this,
"returnToParent");
435 $this->tabs_gui->activateTab(
"log");
437 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamLogTableGUI.php";
440 "submissionScreenTeamLog",
444 $this->tpl->setContent(
$tbl->getHTML());
450 $this->assignment->getId(),
451 $this->submission->getUserId(),
454 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
460 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamLogTableGUI.php";
462 $this->tpl->setContent(
$tbl->getHTML());
472 if ($this->submission->canSubmit()) {
475 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
477 $form->setTitle(
$lng->txt(
"exc_team_assignment_adopt_user"));
478 $form->setFormAction(
$ilCtrl->getFormAction($this,
"createAdoptedTeam"));
483 $teams->addOption(
new ilRadioOption(
$lng->txt(
"exc_team_assignment_adopt_none_user"), -1));
487 include_once
"Services/User/classes/class.ilUserUtil.php";
491 foreach ($item[
"user_team"] as $user_id) {
494 if (array_key_exists($user_id, $current_map)) {
495 $members[$user_id] .=
" (" .
$lng->txt(
"exc_team_assignment_adopt_already_assigned") .
")";
501 $members = implode(
"<br />", $members);
503 $option->setInfo($members);
505 $option->setDisabled(
true);
507 $teams->addOption($option);
510 $form->addItem($teams);
512 $form->addCommandButton(
"createAdoptedTeam",
$lng->txt(
"save"));
513 $form->addCommandButton(
"returnToParent",
$lng->txt(
"cancel"));
522 if (!$this->exercise->members_obj->isAssigned(
$ilUser->getId())) {
523 $this->exercise->members_obj->assignMember(
$ilUser->getId());
526 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
529 $ilCtrl->redirect($this,
"returnToParent");
538 if ($this->submission->canSubmit()) {
539 $src_ass_id = (int)
$_POST[
"ass_adpt"];
540 if ($src_ass_id > 0) {
546 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
549 $ilCtrl->redirect($this,
"returnToParent");
558 if (!strlen(trim(
$_POST[
'user_login']))) {
575 $user_ids[] = $user_id;
This class represents an option in a radio group.
createSingleMemberTeamObject()
List all log entries of team.
__construct(ilObjExercise $a_exercise, ilExSubmission $a_submission)
static getAssignmentTeamMap($a_ass_id)
Get team structure for assignment.
static getTeamId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
Get team id for member id.
const PRIVACY_MODE_RESPECT_USER_SETTING
if(!array_key_exists('StateId', $_REQUEST)) $id
static _lookupId($a_user_str)
Lookup id by login.
static adoptTeams($a_source_ass_id, $a_target_ass_id, $a_user_id=null, $a_exc_ref_id=null)
static getInstanceByIds($a_ass_id, $a_user_id=0)
Get instance by IDs (recommended for consumer code)
static getAdoptableTeamAssignments($a_exercise_id, $a_exclude_ass_id=null, $a_user_id=null)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
submissionScreenTeamLogObject()
submissionScreenTeamObject()
Displays a form which allows members to manage team uploads.
if(isset($_POST['submit'])) $form
List all team members of an assignment.
getLastSubmission()
Get the date of the last submission of a user for the assignment.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
addUserFromAutoCompleteObject()
Add user as member.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
removeTeamMemberObject($a_full_delete=false)
confirmDeleteTeamObject()
addProperty($a_name, $a_value, $a_link="")
add a property to current section
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
confirmRemoveTeamMemberObject($a_full_delete=false)
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
addTeamMemberActionObject($a_user_ids=array())
createAdoptedTeamObject()
Confirmation screen class.