ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilExSubmissionTeamGUI Class Reference

Submission team. More...

+ Collaboration diagram for ilExSubmissionTeamGUI:

Public Member Functions

 executeCommand ()
 
 buildSubmissionPropertiesAndActions (\ILIAS\Exercise\Assignment\PropertyAndActionBuilderUI $builder)
 
 returnToParentObject ()
 
 submissionScreenTeamObject ()
 Displays a form which allows members to manage team uploads. More...
 
 addTeamMemberActionObject (array $a_user_ids=array())
 
 confirmDeleteTeamObject ()
 
 confirmRemoveTeamMemberObject (bool $a_full_delete=false)
 
 removeTeamMemberObject (bool $a_full_delete=false)
 
 submissionScreenTeamLogObject ()
 
 createSingleMemberTeamObject ()
 
 showTeamLogObject ()
 
 getAdoptForm ()
 Get Adopt form. More...
 
 createTeamObject ()
 
 createAdoptedTeamObject ()
 
 addUserFromAutoCompleteObject ()
 Add user as member. More...
 

Static Public Member Functions

static getOverviewContent (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 
static handleTabs ()
 

Protected Member Functions

 canEditTeam ()
 

Protected Attributes

ILIAS Exercise InternalGUIService $gui
 
ILIAS Exercise InternalDomainService $domain
 
ilCtrl $ctrl
 
ilTabsGUI $tabs_gui
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilToolbarGUI $toolbar
 
ilObjUser $user
 
ilObjExercise $exercise
 
ilExAssignment $assignment
 
ilExSubmission $submission
 
ilExAssignmentTeam $team = null
 
array $requested_team_ids = []
 
GUIRequest $request
 

Detailed Description

Member Function Documentation

◆ addTeamMemberActionObject()

ilExSubmissionTeamGUI::addTeamMemberActionObject ( array  $a_user_ids = array())
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 364 of file class.ilExSubmissionTeamGUI.php.

366 : void {
367 if (!$this->canEditTeam()) {
368 $this->ctrl->redirect($this, "submissionScreenTeam");
369 }
370
371 if ($a_user_ids === []) {
372 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"));
373 return;
374 }
375
376 $new_users = [];
377
378 foreach ($a_user_ids as $user_id) {
379 if ($this->team->addTeamMember($user_id, $this->exercise->getRefId())) {
380 $new_users[] = $user_id;
381
382 // #14277
383 if (!$this->exercise->members_obj->isAssigned($user_id)) {
384 $this->exercise->members_obj->assignMember($user_id);
385 }
386 } else {
387 // #11959
388 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("exc_members_already_assigned_team"), true);
389 }
390 }
391
392 if ($new_users !== []) {
393 // re-evaluate complete team, as new member could have already submitted
394 $this->exercise->processExerciseStatus(
395 $this->assignment,
396 $this->team->getMembers(),
397 $this->submission->hasSubmitted(),
398 $this->submission->validatePeerReviews()
399 );
400 // :TODO: notification?
401 $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
402 }
403
404 $this->ctrl->redirect($this, "submissionScreenTeam");
405 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ addUserFromAutoCompleteObject()

ilExSubmissionTeamGUI::addUserFromAutoCompleteObject ( )

Add user as member.

Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 683 of file class.ilExSubmissionTeamGUI.php.

683 : void
684 {
685 $user_login = $this->request->getUserLogin();
686 if ($user_login == "") {
687 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_search_string'));
689 return;
690 }
691
692 $users = explode(',', $user_login);
693
694 $user_ids = array();
695 foreach ($users as $user) {
697
698 if (!$user_id) {
699 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('user_not_known'));
701 return;
702 }
703
704 $user_ids[] = $user_id;
705 }
706
707 $this->addTeamMemberActionObject($user_ids);
708 }
addTeamMemberActionObject(array $a_user_ids=array())
submissionScreenTeamObject()
Displays a form which allows members to manage team uploads.
static _lookupId(string|array $a_user_str)

References $user_id, ilObjUser\_lookupId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ buildSubmissionPropertiesAndActions()

ilExSubmissionTeamGUI::buildSubmissionPropertiesAndActions ( \ILIAS\Exercise\Assignment\PropertyAndActionBuilderUI  $builder)

Definition at line 195 of file class.ilExSubmissionTeamGUI.php.

195 : void
196 {
198 $f = $this->gui->ui()->factory();
199 $ilCtrl = $this->ctrl;
201
202 if (!$submission->getAssignment()->hasTeam()) {
203 return;
204 }
205
206 $state = $this->domain->assignment()->state($submission->getAssignment()->getId(), $submission->getUserId());
207
208 $team_members = $submission->getTeam()->getMembers();
209 if ($team_members !== []) { // we have a team
210 $team = array();
211 foreach ($team_members as $member_id) {
212 //$team[] = ilObjUser::_lookupFullname($member_id);
213 $team[] = ilUserUtil::getNamePresentation($member_id, false, false, "", false);
214 }
215 $team = implode("; ", $team);
216
217 if (!$submission->getAssignment()->getTeamTutor()) {
218 #23685
219 // any team member upload?
220 if (!$submission->getLastSubmission() && !$state->hasSubmissionEnded()) {
221 $button = $f->button()->standard(
222 $this->lng->txt("exc_delete_team"),
223 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionTeamGUI"), "confirmDeleteTeam")
224 );
225 $builder->addAction(
226 $builder::SEC_TEAM,
227 $button
228 );
229 }
230 $button = $f->button()->standard(
231 $this->lng->txt("exc_manage_team"),
232 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionTeamGUI"), "submissionScreenTeam")
233 );
234 $builder->addAction(
235 $builder::SEC_TEAM,
236 $button
237 );
238 } else {
239 $button = $f->button()->standard(
240 $this->lng->txt("exc_team_log"),
241 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionTeamGUI"), "submissionScreenTeamLog")
242 );
243 $builder->addAction(
244 $builder::SEC_TEAM,
245 $button
246 );
247 }
248 $builder->addProperty(
249 $builder::SEC_TEAM,
250 $lng->txt("exc_team_members"),
251 $team
252 );
253 } else {
254 //if($a_submission->getAssignment()->beforeDeadline()) // this was "for all users"
255 if (!$state->hasSubmissionEnded()) { // this is for current user/team -> no team creation, if no submission possible
256 if (!$submission->hasSubmitted()) {
257 $team_info = $this->lng->txt("exc_no_team_yet_notice");
258 } else {
259 $team_info = '<span class="warning">' . $this->lng->txt("exc_no_team_yet_notice") . '</span>';
260 }
261
262 if (!$submission->getAssignment()->getTeamTutor()) {
263 $button = $f->button()->primary(
264 $this->lng->txt("exc_create_team"),
265 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionTeamGUI"), "createTeam")
266 );
267 $builder->setMainAction(
268 $builder::SEC_TEAM,
269 $button
270 );
271 $team_info .= '<div class="ilFormInfo">' . $lng->txt("exc_no_team_yet_info") . '</div>';
272 } else {
273 $team_info .= '<div class="ilFormInfo">' . $lng->txt("exc_no_team_yet_info_tutor") . '</div>';
274 }
275 } else {
276 $team_info = $lng->txt("exc_create_team_times_up_warning");
277 }
278
279 $builder->addProperty(
280 $builder::SEC_TEAM,
281 $lng->txt("exc_team_members"),
282 $team_info
283 );
284 }
285 }
getLastSubmission()
TODO -> get rid of getTableUserWhere and move to repository class Get the date of the last submission...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:

References Vendor\Package\$f, $lng, ilExSubmission\getAssignment(), ilExSubmission\getLastSubmission(), ilUserUtil\getNamePresentation(), ilExSubmission\getTeam(), ilExSubmission\getUserId(), ilExSubmission\hasSubmitted(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ canEditTeam()

ilExSubmissionTeamGUI::canEditTeam ( )
protected

Definition at line 313 of file class.ilExSubmissionTeamGUI.php.

313 : bool
314 {
315 return (($this->submission->canSubmit() &&
316 !$this->submission->getAssignment()->getTeamTutor()) ||
317 $this->submission->isTutor());
318 }

◆ confirmDeleteTeamObject()

ilExSubmissionTeamGUI::confirmDeleteTeamObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 410 of file class.ilExSubmissionTeamGUI.php.

410 : void
411 {
413 }
confirmRemoveTeamMemberObject(bool $a_full_delete=false)

◆ confirmRemoveTeamMemberObject()

ilExSubmissionTeamGUI::confirmRemoveTeamMemberObject ( bool  $a_full_delete = false)
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 418 of file class.ilExSubmissionTeamGUI.php.

420 : void {
421 $ilUser = $this->user;
423
424 if (!$this->submission->isTutor()) {
425 $ids = $a_full_delete ? $this->team->getMembers() : $this->requested_team_ids;
426
427 if ([] === $ids) {
428 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("select_one"), true);
429 $this->ctrl->redirect($this, "submissionScreenTeam");
430 }
431 } else {
433 if ([] === $ids) {
434 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("select_one"), true);
435 $this->returnToParentObject();
436 }
437 }
438
439 $members = $this->team->getMembers();
440 if (count($members) <= count($ids)) {
441 if (count($members) == 1 && $members[0] == $ilUser->getId()) {
442 // direct team deletion - no confirmation
443 $this->removeTeamMemberObject($a_full_delete);
444 return;
445 } else {
446 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("exc_team_at_least_one"), true);
447 $this->ctrl->redirect($this, "submissionScreenTeam");
448 }
449 }
450
451 $cgui = new ilConfirmationGUI();
452 $cgui->setFormAction($this->ctrl->getFormAction($this));
453 $cgui->setHeaderText($this->lng->txt("exc_team_member_remove_sure"));
454 $cgui->setConfirm($this->lng->txt("remove"), "removeTeamMember");
455 $cgui->setCancel($this->lng->txt("cancel"), $this->submission->isTutor()
456 ? "returnToParent"
457 : "submissionScreenTeam");
458
459 $subs = $this->domain->submission($this->assignment->getId())
460 ->getSubmissionsOfUser($this->submission->getUserId());
461
462 foreach ($ids as $id) {
463 $details = array();
464 foreach ($subs as $sub) {
465 if ($sub->getUserId() === $id) {
466 $details[] = $sub->getTitle();
467 }
468 }
470 if ($details !== []) {
471 $uname .= ": " . implode(", ", $details);
472 }
473 $cgui->addItem("id[]", $id, $uname);
474 }
475
476 $tpl->setContent($cgui->getHTML());
477 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
removeTeamMemberObject(bool $a_full_delete=false)
setContent(string $a_html)
Sets content for standard template.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\UICore\GlobalTemplate\setOnScreenMessage().

+ Here is the call graph for this function:

◆ createAdoptedTeamObject()

ilExSubmissionTeamGUI::createAdoptedTeamObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 657 of file class.ilExSubmissionTeamGUI.php.

657 : void
658 {
659 $ilCtrl = $this->ctrl;
660 $ilUser = $this->user;
662
663 $form = $this->getAdoptForm();
664 $form->checkInput();
665 if ($this->submission->canSubmit()) {
666 $src_ass_id = $form->getInput("ass_adpt");
667 if ($src_ass_id > 0) {
668 ilExAssignmentTeam::adoptTeams($src_ass_id, $this->assignment->getId(), $ilUser->getId(), $this->exercise->getRefId());
669 } else {
670 ilExAssignmentTeam::getTeamId($this->assignment->getId(), $ilUser->getId(), true);
671 }
672
673 $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
674 }
675
676 $ilCtrl->redirect($this, "returnToParent");
677 }
static adoptTeams(int $a_source_ass_id, int $a_target_ass_id, ?int $a_user_id=null, ?int $a_exc_ref_id=null)
static getTeamId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)

References $lng, ilExAssignmentTeam\adoptTeams(), and ilExAssignmentTeam\getTeamId().

+ Here is the call graph for this function:

◆ createSingleMemberTeamObject()

ilExSubmissionTeamGUI::createSingleMemberTeamObject ( )

Definition at line 559 of file class.ilExSubmissionTeamGUI.php.

559 : void
560 {
562 $this->assignment->getId(),
563 $this->submission->getUserId(),
564 true
565 );
566 $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
567 $this->returnToParentObject();
568 }

References ilExAssignmentTeam\getTeamId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ createTeamObject()

ilExSubmissionTeamGUI::createTeamObject ( )

Definition at line 627 of file class.ilExSubmissionTeamGUI.php.

627 : void
628 {
629 $ilCtrl = $this->ctrl;
630 $ilUser = $this->user;
632
633 if ($this->submission->canSubmit()) {
634 $options = ilExAssignmentTeam::getAdoptableTeamAssignments($this->assignment->getExerciseId(), $this->assignment->getId(), $ilUser->getId());
635 if ($options !== []) {
636 $form = $this->getAdoptForm();
637 $tpl->setContent($form->getHTML());
638 return;
639 }
640
641 ilExAssignmentTeam::getTeamId($this->assignment->getId(), $ilUser->getId(), true);
642
643 // #18046
644 if (!$this->exercise->members_obj->isAssigned($ilUser->getId())) {
645 $this->exercise->members_obj->assignMember($ilUser->getId());
646 }
647
648 $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
649 }
650
651 $ilCtrl->redirect($this, "returnToParent");
652 }
static getAdoptableTeamAssignments(int $a_exercise_id, ?int $a_exclude_ass_id=null, ?int $a_user_id=null)

References ilExAssignmentTeam\getAdoptableTeamAssignments(), ilExAssignmentTeam\getTeamId(), ILIAS\Repository\lng(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ executeCommand()

ilExSubmissionTeamGUI::executeCommand ( )
Exceptions
ilCtrlException

Definition at line 82 of file class.ilExSubmissionTeamGUI.php.

82 : void
83 {
84 $ilCtrl = $this->ctrl;
85
86 $class = $ilCtrl->getNextClass($this);
87 $cmd = $ilCtrl->getCmd("submissionScreenTeam");
88
89 if (!$this->assignment->hasTeam() ||
90 !$this->submission->canView()) {
91 return;
92 }
93 $this->team = $this->submission->getTeam();
94
95 if (!$this->submission->isTutor()) {
97 $this->tabs_gui->activateTab("team");
98 }
99
100 switch ($class) {
101 case 'ilrepositorysearchgui':
102 $this->ctrl->setReturn($this, 'submissionScreenTeam');
103 $rep_search = new ilRepositorySearchGUI();
104 if (!$this->submission->isTutor()) {
106 }
107 $rep_search->setTitle($this->lng->txt("exc_team_member_add"));
108 $rep_search->setCallback($this, 'addTeamMemberActionObject');
109 $this->ctrl->forwardCommand($rep_search);
110 break;
111
112 default:
113 $this->{$cmd . "Object"}();
114 break;
115 }
116 }
getNextClass($a_gui_class=null)
@inheritDoc

References $ctrl, ILIAS\Repository\ctrl(), ilCtrl\getNextClass(), handleTabs(), ILIAS\Repository\lng(), and ilUserAutoComplete\PRIVACY_MODE_RESPECT_USER_SETTING.

+ Here is the call graph for this function:

◆ getAdoptForm()

ilExSubmissionTeamGUI::getAdoptForm ( )

Get Adopt form.

Definition at line 579 of file class.ilExSubmissionTeamGUI.php.

580 {
583 $ilUser = $this->user;
584
585 $form = new ilPropertyFormGUI();
586 $form->setTitle($lng->txt("exc_team_assignment_adopt_user"));
587 $form->setFormAction($ctrl->getFormAction($this, "createAdoptedTeam"));
588
589 $teams = new ilRadioGroupInputGUI($lng->txt("exc_assignment"), "ass_adpt");
590 $teams->setValue(-1);
591
592 $teams->addOption(new ilRadioOption($lng->txt("exc_team_assignment_adopt_none_user"), -1));
593
594 $current_map = ilExAssignmentTeam::getAssignmentTeamMap($this->assignment->getId());
595
596 $options = ilExAssignmentTeam::getAdoptableTeamAssignments($this->assignment->getExerciseId(), $this->assignment->getId(), $ilUser->getId());
597 foreach ($options as $id => $item) {
598 $members = array();
599 $free = false;
600 foreach ($item["user_team"] as $user_id) {
602
603 if (array_key_exists($user_id, $current_map)) {
604 $members[$user_id] .= " (" . $lng->txt("exc_team_assignment_adopt_already_assigned") . ")";
605 } else {
606 $free = true;
607 }
608 }
609 asort($members);
610 $members = implode("<br />", $members);
611 $option = new ilRadioOption($item["title"], $id);
612 $option->setInfo($members);
613 if (!$free) {
614 $option->setDisabled(true);
615 }
616 $teams->addOption($option);
617 }
618
619 $form->addItem($teams);
620
621 $form->addCommandButton("createAdoptedTeam", $lng->txt("save"));
622 $form->addCommandButton("returnToParent", $lng->txt("cancel"));
623
624 return $form;
625 }
getFormAction(object $a_gui_obj, ?string $a_fallback_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
static getAssignmentTeamMap(int $a_ass_id)
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.

References $id, $lng, $user_id, ilExAssignmentTeam\getAdoptableTeamAssignments(), ilExAssignmentTeam\getAssignmentTeamMap(), ilCtrl\getFormAction(), and ilUserUtil\getNamePresentation().

+ Here is the call graph for this function:

◆ getOverviewContent()

static ilExSubmissionTeamGUI::getOverviewContent ( ilInfoScreenGUI  $a_info,
ilExSubmission  $a_submission 
)
static

Definition at line 118 of file class.ilExSubmissionTeamGUI.php.

121 : void {
122 global $DIC;
123
124 $lng = $DIC->language();
125 $ilCtrl = $DIC->ctrl();
126 $gui = $DIC->exercise()->internal()->gui();
127
128 if (!$a_submission->getAssignment()->hasTeam()) {
129 return;
130 }
131
132 $state = ilExcAssMemberState::getInstanceByIds($a_submission->getAssignment()->getId(), $a_submission->getUserId());
133
134 $team_members = $a_submission->getTeam()->getMembers();
135 if ($team_members !== []) { // we have a team
136 $team = array();
137 foreach ($team_members as $member_id) {
138 //$team[] = ilObjUser::_lookupFullname($member_id);
139 $team[] = ilUserUtil::getNamePresentation($member_id, false, false, "", false);
140 }
141 $team = implode("; ", $team);
142
143 if (!$a_submission->getAssignment()->getTeamTutor()) {
144 #23685
145 // any team member upload?
146 if (!$a_submission->getLastSubmission()) {
147 $link = $gui->link(
148 $lng->txt("exc_delete_team"),
149 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionTeamGUI"), "confirmDeleteTeam")
150 )->emphasised();
151 $team .= " " . $link->render();
152 }
153 $link = $gui->link(
154 $lng->txt("exc_manage_team"),
155 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionTeamGUI"), "submissionScreenTeam")
156 )->emphasised();
157 } else {
158 $link = $gui->link(
159 $lng->txt("exc_team_log"),
160 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionTeamGUI"), "submissionScreenTeamLog")
161 )->emphasised();
162 }
163 $team .= "<br><br>" . $link->render();
164
165 $a_info->addProperty($lng->txt("exc_team_members"), $team);
166 } else {
167 //if($a_submission->getAssignment()->beforeDeadline()) // this was "for all users"
168 if (!$state->hasSubmissionEnded()) { // this is for current user/team -> no team creation, if no submission possible
169 if (!$a_submission->hasSubmitted()) {
170 $team_info = $lng->txt("exc_no_team_yet_notice");
171 } else {
172 $team_info = '<span class="warning">' . $lng->txt("exc_no_team_yet_notice") . '</span>';
173 }
174
175 if (!$a_submission->getAssignment()->getTeamTutor()) {
176 $button = $gui->button(
177 $lng->txt("exc_create_team"),
178 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class, "ilExSubmissionGUI", "ilExSubmissionTeamGUI"), "createTeam")
179 )->primary();
180
181 $team_info .= " " . $button->render();
182
183 $team_info .= '<div class="ilFormInfo">' . $lng->txt("exc_no_team_yet_info") . '</div>';
184 } else {
185 $team_info .= '<div class="ilFormInfo">' . $lng->txt("exc_no_team_yet_info_tutor") . '</div>';
186 }
187 } else {
188 $team_info = '<span class="warning">' . $lng->txt("exc_create_team_times_up_warning") . '</span>';
189 }
190
191 $a_info->addProperty($lng->txt("exc_team_members"), $team_info);
192 }
193 }
ILIAS Exercise InternalGUIService $gui
static getInstanceByIds(int $a_ass_id, int $a_user_id=0)
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section
global $DIC
Definition: shib_login.php:26

◆ handleTabs()

static ilExSubmissionTeamGUI::handleTabs ( )
static

Definition at line 292 of file class.ilExSubmissionTeamGUI.php.

292 : void
293 {
294 global $DIC;
295
296 $ilTabs = $DIC->tabs();
297 $ilCtrl = $DIC->ctrl();
298 $lng = $DIC->language();
299
300 $ilTabs->addTab(
301 "team",
302 $lng->txt("exc_team"),
303 $ilCtrl->getLinkTargetByClass("ilExSubmissionTeamGUI", "submissionScreenTeam")
304 );
305
306 $ilTabs->addTab(
307 "log",
308 $lng->txt("exc_team_log"),
309 $ilCtrl->getLinkTargetByClass("ilExSubmissionTeamGUI", "submissionScreenTeamLog")
310 );
311 }

References $DIC, and $lng.

Referenced by executeCommand(), and ilExSubmissionBaseGUI\handleTabs().

+ Here is the caller graph for this function:

◆ removeTeamMemberObject()

ilExSubmissionTeamGUI::removeTeamMemberObject ( bool  $a_full_delete = false)
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 482 of file class.ilExSubmissionTeamGUI.php.

484 : void {
485 $ilUser = $this->user;
486
487 $cancel_cmd = $this->submission->isTutor()
488 ? "returnToParent"
489 : "submissionScreenTeam";
490
491 $ids = [];
492 if ($a_full_delete) {
493 $ids = $this->team->getMembers();
494 } else {
496 }
497 $ids = array_filter(array_map('intval', $ids));
498
499 if ([] === $ids && !$this->canEditTeam()) {
500 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("select_one"), true);
501 $this->ctrl->redirect($this, $cancel_cmd);
502 }
503
504 $team_deleted = $a_full_delete;
505 if (!$team_deleted) {
506 $members = $this->team->getMembers();
507 if (count($members) <= count($ids)) {
508 if (count($members) == 1 && $members[0] == $ilUser->getId()) {
509 $team_deleted = true;
510 } else {
511 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("exc_team_at_least_one"), true);
512 $this->ctrl->redirect($this, $cancel_cmd);
513 }
514 }
515 }
516
517 foreach ($ids as $user_id) {
518 $this->team->removeTeamMember($user_id, $this->exercise->getRefId());
519 }
520
521 // reset ex team members, as any submission is not valid without team
522 $this->exercise->processExerciseStatus(
523 $this->assignment,
524 $ids,
525 false
526 );
527
528 if (!$team_deleted) {
529 // re-evaluate complete team, as removed member might have had submitted
530 $this->exercise->processExerciseStatus(
531 $this->assignment,
532 $this->team->getMembers(),
533 $this->submission->hasSubmitted(),
534 $this->submission->validatePeerReviews()
535 );
536 }
537
538 $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
539 if (!$team_deleted) {
540 $this->ctrl->redirect($this, $cancel_cmd);
541 } else {
542 $this->ctrl->redirect($this, "returnToParent");
543 }
544 }

◆ returnToParentObject()

ilExSubmissionTeamGUI::returnToParentObject ( )

Definition at line 287 of file class.ilExSubmissionTeamGUI.php.

287 : void
288 {
289 $this->ctrl->returnToParent($this);
290 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ showTeamLogObject()

ilExSubmissionTeamGUI::showTeamLogObject ( )

Definition at line 570 of file class.ilExSubmissionTeamGUI.php.

570 : void
571 {
572 $tbl = new ilExAssignmentTeamLogTableGUI($this, "showTeamLog", $this->team);
573 $this->tpl->setContent($tbl->getHTML());
574 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ submissionScreenTeamLogObject()

ilExSubmissionTeamGUI::submissionScreenTeamLogObject ( )

Definition at line 546 of file class.ilExSubmissionTeamGUI.php.

546 : void
547 {
548 $this->tabs_gui->activateTab("log");
549
551 $this,
552 "submissionScreenTeamLog",
553 $this->team
554 );
555
556 $this->tpl->setContent($tbl->getHTML());
557 }

◆ submissionScreenTeamObject()

ilExSubmissionTeamGUI::submissionScreenTeamObject ( )

Displays a form which allows members to manage team uploads.

Definition at line 323 of file class.ilExSubmissionTeamGUI.php.

323 : void
324 {
325 $ilToolbar = $this->toolbar;
326
327 // #13414
328 $read_only = !$this->canEditTeam();
329
330 if ($this->submission->getAssignment()->afterDeadlineStrict(false)) {
331 $this->tpl->setOnScreenMessage('info', $this->lng->txt("exercise_time_over"));
332 } elseif (!$read_only) {
333 $add_search = $this->submission->isTutor();
334 // add member
336 $this,
337 $ilToolbar,
338 array(
339 'auto_complete_name' => $this->lng->txt('user'),
340 'submit_name' => $this->lng->txt('add'),
341 'add_search' => $add_search,
342 'add_from_container' => $this->exercise->getRefId()
343 )
344 );
345 } elseif ($this->submission->getAssignment()->getTeamTutor()) {
346 $this->tpl->setOnScreenMessage('info', $this->lng->txt("exc_no_team_yet_info_tutor"));
347 }
348
350 $this,
351 "submissionScreenTeam",
353 $this->exercise->getRefId(),
354 $this->team,
355 $read_only
356 );
357
358 $this->tpl->setContent($tbl->getHTML());
359 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static fillAutoCompleteToolbar(object $parent_object, ?ilToolbarGUI $toolbar=null, array $a_options=[], bool $a_sticky=false)
array( auto_complete_name = $lng->txt('user'), auto_complete_size = 15, user_type = array(ilCoursePar...

References ilRepositorySearchGUI\fillAutoCompleteToolbar(), ILIAS\Repository\lng(), and ilExAssignmentTeamTableGUI\MODE_EDIT.

+ Here is the call graph for this function:

Field Documentation

◆ $assignment

ilExAssignment ilExSubmissionTeamGUI::$assignment
protected

Definition at line 40 of file class.ilExSubmissionTeamGUI.php.

◆ $ctrl

ilCtrl ilExSubmissionTeamGUI::$ctrl
protected

Definition at line 33 of file class.ilExSubmissionTeamGUI.php.

Referenced by executeCommand().

◆ $domain

ILIAS Exercise InternalDomainService ilExSubmissionTeamGUI::$domain
protected

Definition at line 32 of file class.ilExSubmissionTeamGUI.php.

◆ $exercise

ilObjExercise ilExSubmissionTeamGUI::$exercise
protected

Definition at line 39 of file class.ilExSubmissionTeamGUI.php.

◆ $gui

ILIAS Exercise InternalGUIService ilExSubmissionTeamGUI::$gui
protected

Definition at line 31 of file class.ilExSubmissionTeamGUI.php.

◆ $lng

ilLanguage ilExSubmissionTeamGUI::$lng
protected

Definition at line 35 of file class.ilExSubmissionTeamGUI.php.

◆ $request

GUIRequest ilExSubmissionTeamGUI::$request
protected

Definition at line 47 of file class.ilExSubmissionTeamGUI.php.

◆ $requested_team_ids

array ilExSubmissionTeamGUI::$requested_team_ids = []
protected

Definition at line 46 of file class.ilExSubmissionTeamGUI.php.

◆ $submission

ilExSubmission ilExSubmissionTeamGUI::$submission
protected

Definition at line 41 of file class.ilExSubmissionTeamGUI.php.

◆ $tabs_gui

ilTabsGUI ilExSubmissionTeamGUI::$tabs_gui
protected

Definition at line 34 of file class.ilExSubmissionTeamGUI.php.

◆ $team

ilExAssignmentTeam ilExSubmissionTeamGUI::$team = null
protected

Definition at line 42 of file class.ilExSubmissionTeamGUI.php.

◆ $toolbar

ilToolbarGUI ilExSubmissionTeamGUI::$toolbar
protected

Definition at line 37 of file class.ilExSubmissionTeamGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilExSubmissionTeamGUI::$tpl
protected

Definition at line 36 of file class.ilExSubmissionTeamGUI.php.

◆ $user

ilObjUser ilExSubmissionTeamGUI::$user
protected

Definition at line 38 of file class.ilExSubmissionTeamGUI.php.


The documentation for this class was generated from the following file: