ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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.

References canEditTeam(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by addUserFromAutoCompleteObject().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUserFromAutoCompleteObject()

ilExSubmissionTeamGUI::addUserFromAutoCompleteObject ( )

Add user as member.

Exceptions
ilExcUnknownAssignmentTypeException

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

References ilObjUser\_lookupId(), addTeamMemberActionObject(), ILIAS\Repository\lng(), and submissionScreenTeamObject().

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

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

195  : void
196  {
198  $f = $this->gui->ui()->factory();
199  $ilCtrl = $this->ctrl;
200  $lng = $this->lng;
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  }
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='ilpublicuserprofilegui')
Default behaviour is:
getLastSubmission()
TODO -> get rid of getTableUserWhere and move to repository class Get the date of the last submission...
+ Here is the call graph for this function:

◆ canEditTeam()

ilExSubmissionTeamGUI::canEditTeam ( )
protected

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

Referenced by addTeamMemberActionObject(), confirmRemoveTeamMemberObject(), removeTeamMemberObject(), and submissionScreenTeamObject().

313  : bool
314  {
315  return (($this->submission->canSubmit() &&
316  !$this->submission->getAssignment()->getTeamTutor()) ||
317  $this->submission->isTutor());
318  }
+ Here is the caller graph for this function:

◆ confirmDeleteTeamObject()

ilExSubmissionTeamGUI::confirmDeleteTeamObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

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

References confirmRemoveTeamMemberObject().

410  : void
411  {
412  $this->confirmRemoveTeamMemberObject(true);
413  }
confirmRemoveTeamMemberObject(bool $a_full_delete=false)
+ Here is the call graph for this function:

◆ confirmRemoveTeamMemberObject()

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

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

References ILIAS\LTI\ToolProvider\$details, $id, $requested_team_ids, $tpl, $user, canEditTeam(), ILIAS\Repository\ctrl(), ilUserUtil\getNamePresentation(), ILIAS\Repository\lng(), removeTeamMemberObject(), returnToParentObject(), and ilGlobalTemplateInterface\setContent().

Referenced by confirmDeleteTeamObject().

420  : void {
421  $ilUser = $this->user;
422  $tpl = $this->tpl;
423 
424  if (!$this->submission->isTutor()) {
425  $ids = $a_full_delete ? $this->team->getMembers() : $this->requested_team_ids;
426 
427  if ([] === $ids && !$this->canEditTeam()) {
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->returnToParentObject();
435  }
436  }
437 
438  $members = $this->team->getMembers();
439  if (count($members) <= count($ids)) {
440  if (count($members) == 1 && $members[0] == $ilUser->getId()) {
441  // direct team deletion - no confirmation
442  $this->removeTeamMemberObject($a_full_delete);
443  return;
444  } else {
445  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("exc_team_at_least_one"), true);
446  $this->ctrl->redirect($this, "submissionScreenTeam");
447  }
448  }
449 
450  $cgui = new ilConfirmationGUI();
451  $cgui->setFormAction($this->ctrl->getFormAction($this));
452  $cgui->setHeaderText($this->lng->txt("exc_team_member_remove_sure"));
453  $cgui->setConfirm($this->lng->txt("remove"), "removeTeamMember");
454  $cgui->setCancel($this->lng->txt("cancel"), $this->submission->isTutor()
455  ? "returnToParent"
456  : "submissionScreenTeam");
457 
458  $files = $this->submission->getFiles();
459 
460  foreach ($ids as $id) {
461  $details = array();
462  foreach ($files as $file) {
463  if ($file["owner_id"] == $id) {
464  $details[] = $file["filetitle"];
465  }
466  }
467  $uname = ilUserUtil::getNamePresentation($id);
468  if ($details !== []) {
469  $uname .= ": " . implode(", ", $details);
470  }
471  $cgui->addItem("id[]", $id, $uname);
472  }
473 
474  $tpl->setContent($cgui->getHTML());
475  }
removeTeamMemberObject(bool $a_full_delete=false)
array $details
Details for error message relating to last request processed.
Definition: System.php:109
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='ilpublicuserprofilegui')
Default behaviour is:
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createAdoptedTeamObject()

ilExSubmissionTeamGUI::createAdoptedTeamObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

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

References $ctrl, $lng, $user, ilExAssignmentTeam\adoptTeams(), getAdoptForm(), ilExAssignmentTeam\getTeamId(), and ilLanguage\txt().

655  : void
656  {
657  $ilCtrl = $this->ctrl;
658  $ilUser = $this->user;
659  $lng = $this->lng;
660 
661  $form = $this->getAdoptForm();
662  $form->checkInput();
663  if ($this->submission->canSubmit()) {
664  $src_ass_id = $form->getInput("ass_adpt");
665  if ($src_ass_id > 0) {
666  ilExAssignmentTeam::adoptTeams($src_ass_id, $this->assignment->getId(), $ilUser->getId(), $this->exercise->getRefId());
667  } else {
668  ilExAssignmentTeam::getTeamId($this->assignment->getId(), $ilUser->getId(), true);
669  }
670 
671  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
672  }
673 
674  $ilCtrl->redirect($this, "returnToParent");
675  }
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 getTeamId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
static adoptTeams(int $a_source_ass_id, int $a_target_ass_id, int $a_user_id=null, int $a_exc_ref_id=null)
+ Here is the call graph for this function:

◆ createSingleMemberTeamObject()

ilExSubmissionTeamGUI::createSingleMemberTeamObject ( )

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

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

557  : void
558  {
560  $this->assignment->getId(),
561  $this->submission->getUserId(),
562  true
563  );
564  $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
565  $this->returnToParentObject();
566  }
static getTeamId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
+ Here is the call graph for this function:

◆ createTeamObject()

ilExSubmissionTeamGUI::createTeamObject ( )

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

References $ctrl, $tpl, $user, ilExAssignmentTeam\getAdoptableTeamAssignments(), getAdoptForm(), ilExAssignmentTeam\getTeamId(), ILIAS\Repository\lng(), and ilGlobalTemplateInterface\setContent().

625  : void
626  {
627  $ilCtrl = $this->ctrl;
628  $ilUser = $this->user;
629  $tpl = $this->tpl;
630 
631  if ($this->submission->canSubmit()) {
632  $options = ilExAssignmentTeam::getAdoptableTeamAssignments($this->assignment->getExerciseId(), $this->assignment->getId(), $ilUser->getId());
633  if ($options !== []) {
634  $form = $this->getAdoptForm();
635  $tpl->setContent($form->getHTML());
636  return;
637  }
638 
639  ilExAssignmentTeam::getTeamId($this->assignment->getId(), $ilUser->getId(), true);
640 
641  // #18046
642  if (!$this->exercise->members_obj->isAssigned($ilUser->getId())) {
643  $this->exercise->members_obj->assignMember($ilUser->getId());
644  }
645 
646  $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
647  }
648 
649  $ilCtrl->redirect($this, "returnToParent");
650  }
static getAdoptableTeamAssignments(int $a_exercise_id, int $a_exclude_ass_id=null, int $a_user_id=null)
setContent(string $a_html)
Sets content for standard template.
static getTeamId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ executeCommand()

ilExSubmissionTeamGUI::executeCommand ( )
Exceptions
ilCtrlException

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

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

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()) {
96  self::handleTabs();
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()) {
105  $rep_search->setPrivacyMode(ilUserAutoComplete::PRIVACY_MODE_RESPECT_USER_SETTING);
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)
+ Here is the call graph for this function:

◆ getAdoptForm()

ilExSubmissionTeamGUI::getAdoptForm ( )

Get Adopt form.

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

References $ctrl, $id, $lng, $user, ilExAssignmentTeam\getAdoptableTeamAssignments(), ilExAssignmentTeam\getAssignmentTeamMap(), ilCtrl\getFormAction(), ilUserUtil\getNamePresentation(), ilRadioGroupInputGUI\setValue(), and ilLanguage\txt().

Referenced by createAdoptedTeamObject(), and createTeamObject().

578  {
579  $ctrl = $this->ctrl;
580  $lng = $this->lng;
581  $ilUser = $this->user;
582 
583  $form = new ilPropertyFormGUI();
584  $form->setTitle($lng->txt("exc_team_assignment_adopt_user"));
585  $form->setFormAction($ctrl->getFormAction($this, "createAdoptedTeam"));
586 
587  $teams = new ilRadioGroupInputGUI($lng->txt("exc_assignment"), "ass_adpt");
588  $teams->setValue(-1);
589 
590  $teams->addOption(new ilRadioOption($lng->txt("exc_team_assignment_adopt_none_user"), -1));
591 
592  $current_map = ilExAssignmentTeam::getAssignmentTeamMap($this->assignment->getId());
593 
594  $options = ilExAssignmentTeam::getAdoptableTeamAssignments($this->assignment->getExerciseId(), $this->assignment->getId(), $ilUser->getId());
595  foreach ($options as $id => $item) {
596  $members = array();
597  $free = false;
598  foreach ($item["user_team"] as $user_id) {
599  $members[$user_id] = ilUserUtil::getNamePresentation($user_id);
600 
601  if (array_key_exists($user_id, $current_map)) {
602  $members[$user_id] .= " (" . $lng->txt("exc_team_assignment_adopt_already_assigned") . ")";
603  } else {
604  $free = true;
605  }
606  }
607  asort($members);
608  $members = implode("<br />", $members);
609  $option = new ilRadioOption($item["title"], $id);
610  $option->setInfo($members);
611  if (!$free) {
612  $option->setDisabled(true);
613  }
614  $teams->addOption($option);
615  }
616 
617  $form->addItem($teams);
618 
619  $form->addCommandButton("createAdoptedTeam", $lng->txt("save"));
620  $form->addCommandButton("returnToParent", $lng->txt("cancel"));
621 
622  return $form;
623  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 getAdoptableTeamAssignments(int $a_exercise_id, int $a_exclude_ass_id=null, int $a_user_id=null)
This class represents a property in a property form.
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='ilpublicuserprofilegui')
Default behaviour is:
static getAssignmentTeamMap(int $a_ass_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOverviewContent()

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

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

References $DIC, $team, ilInfoScreenGUI\addProperty(), ilExSubmission\getAssignment(), ilExcAssMemberState\getInstanceByIds(), ilExSubmission\getLastSubmission(), ilUserUtil\getNamePresentation(), ilExSubmission\getTeam(), ilExSubmission\getUserId(), ilExSubmission\hasSubmitted(), and ilLanguage\txt().

Referenced by ilExSubmissionGUI\executeCommand().

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
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...
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section
global $DIC
Definition: feed.php:28
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='ilpublicuserprofilegui')
Default behaviour is:
static getInstanceByIds(int $a_ass_id, int $a_user_id=0)
getLastSubmission()
TODO -> get rid of getTableUserWhere and move to repository class Get the date of the last submission...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleTabs()

static ilExSubmissionTeamGUI::handleTabs ( )
static

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

References $DIC, and ilLanguage\txt().

Referenced by ilExSubmissionBaseGUI\handleTabs().

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  }
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...
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeTeamMemberObject()

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

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

References $requested_team_ids, $user, canEditTeam(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by confirmRemoveTeamMemberObject().

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

◆ returnToParentObject()

ilExSubmissionTeamGUI::returnToParentObject ( )

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

References ILIAS\Repository\ctrl().

Referenced by confirmRemoveTeamMemberObject(), and createSingleMemberTeamObject().

287  : void
288  {
289  $this->ctrl->returnToParent($this);
290  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTeamLogObject()

ilExSubmissionTeamGUI::showTeamLogObject ( )

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

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

◆ submissionScreenTeamLogObject()

ilExSubmissionTeamGUI::submissionScreenTeamLogObject ( )

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

544  : void
545  {
546  $this->tabs_gui->activateTab("log");
547 
549  $this,
550  "submissionScreenTeamLog",
551  $this->team
552  );
553 
554  $this->tpl->setContent($tbl->getHTML());
555  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ submissionScreenTeamObject()

ilExSubmissionTeamGUI::submissionScreenTeamObject ( )

Displays a form which allows members to manage team uploads.

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

References $team, $toolbar, canEditTeam(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), ILIAS\Repository\lng(), and ilExAssignmentTeamTableGUI\MODE_EDIT.

Referenced by addUserFromAutoCompleteObject().

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 
349  $tbl = new ilExAssignmentTeamTableGUI(
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(&#39;user&#39;), auto_complete_size = 15, user_type = array(ilCoursePar...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $assignment

ilExAssignment ilExSubmissionTeamGUI::$assignment
protected

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

◆ $ctrl

◆ $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

◆ $request

GUIRequest ilExSubmissionTeamGUI::$request
protected

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

◆ $requested_team_ids

array ilExSubmissionTeamGUI::$requested_team_ids = []
protected

◆ $submission

ilExSubmission ilExSubmissionTeamGUI::$submission
protected

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

Referenced by buildSubmissionPropertiesAndActions().

◆ $tabs_gui

ilTabsGUI ilExSubmissionTeamGUI::$tabs_gui
protected

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

◆ $team

ilExAssignmentTeam ilExSubmissionTeamGUI::$team = null
protected

◆ $toolbar

ilToolbarGUI ilExSubmissionTeamGUI::$toolbar
protected

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

Referenced by submissionScreenTeamObject().

◆ $tpl

ilGlobalTemplateInterface ilExSubmissionTeamGUI::$tpl
protected

◆ $user


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