31 protected \ILIAS\Exercise\InternalGUIService
$gui;
32 protected \ILIAS\Exercise\InternalDomainService
$domain;
56 $this->
toolbar = $DIC->toolbar();
57 $this->
user = $DIC->user();
58 $ilCtrl = $DIC->ctrl();
59 $ilTabs = $DIC->tabs();
60 $lng = $DIC->language();
63 $this->exercise = $a_exercise;
64 $this->submission = $a_submission;
68 $this->
ctrl = $ilCtrl;
69 $this->tabs_gui = $ilTabs;
73 $this->request = $DIC->exercise()->internal()->gui()->request();
74 $this->requested_team_ids = $this->request->getTeamIds();
75 $this->domain = $DIC->exercise()->internal()->domain();
76 $this->gui = $DIC->exercise()->internal()->gui();
87 $cmd = $ilCtrl->getCmd(
"submissionScreenTeam");
89 if (!$this->assignment->hasTeam() ||
90 !$this->submission->canView()) {
93 $this->team = $this->submission->getTeam();
95 if (!$this->submission->isTutor()) {
97 $this->tabs_gui->activateTab(
"team");
101 case 'ilrepositorysearchgui':
102 $this->
ctrl->setReturn($this,
'submissionScreenTeam');
104 if (!$this->submission->isTutor()) {
107 $rep_search->setTitle($this->
lng->txt(
"exc_team_member_add"));
108 $rep_search->setCallback($this,
'addTeamMemberActionObject');
109 $this->
ctrl->forwardCommand($rep_search);
113 $this->{$cmd .
"Object"}();
124 $lng = $DIC->language();
125 $ilCtrl = $DIC->ctrl();
126 $gui = $DIC->exercise()->internal()->gui();
134 $team_members = $a_submission->
getTeam()->getMembers();
135 if ($team_members !== []) {
137 foreach ($team_members as $member_id) {
141 $team = implode(
"; ", $team);
148 $lng->
txt(
"exc_delete_team"),
149 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"confirmDeleteTeam")
151 $team .=
" " . $link->render();
154 $lng->
txt(
"exc_manage_team"),
155 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"submissionScreenTeam")
159 $lng->
txt(
"exc_team_log"),
160 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"submissionScreenTeamLog")
163 $team .=
"<br><br>" . $link->render();
168 if (!$state->hasSubmissionEnded()) {
170 $team_info = $lng->
txt(
"exc_no_team_yet_notice");
172 $team_info =
'<span class="warning">' . $lng->
txt(
"exc_no_team_yet_notice") .
'</span>';
176 $button = $gui->button(
177 $lng->
txt(
"exc_create_team"),
178 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"createTeam")
181 $team_info .=
" " . $button->render();
183 $team_info .=
'<div class="ilFormInfo">' . $lng->
txt(
"exc_no_team_yet_info") .
'</div>';
185 $team_info .=
'<div class="ilFormInfo">' . $lng->
txt(
"exc_no_team_yet_info_tutor") .
'</div>';
188 $team_info =
'<span class="warning">' . $lng->
txt(
"exc_create_team_times_up_warning") .
'</span>';
198 $f = $this->gui->ui()->factory();
206 $state = $this->domain->assignment()->state($submission->
getAssignment()->getId(), $submission->
getUserId());
208 $team_members = $submission->
getTeam()->getMembers();
209 if ($team_members !== []) {
211 foreach ($team_members as $member_id) {
215 $team = implode(
"; ", $team);
221 $button =
$f->button()->standard(
222 $this->
lng->txt(
"exc_delete_team"),
223 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"confirmDeleteTeam")
230 $button =
$f->button()->standard(
231 $this->
lng->txt(
"exc_manage_team"),
232 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"submissionScreenTeam")
239 $button =
$f->button()->standard(
240 $this->
lng->txt(
"exc_team_log"),
241 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"submissionScreenTeamLog")
248 $builder->addProperty(
250 $lng->
txt(
"exc_team_members"),
255 if (!$state->hasSubmissionEnded()) {
257 $team_info = $this->
lng->txt(
"exc_no_team_yet_notice");
259 $team_info =
'<span class="warning">' . $this->
lng->txt(
"exc_no_team_yet_notice") .
'</span>';
263 $button =
$f->button()->primary(
264 $this->
lng->txt(
"exc_create_team"),
265 $ilCtrl->getLinkTargetByClass(array(ilAssignmentPresentationGUI::class,
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"createTeam")
267 $builder->setMainAction(
271 $team_info .=
'<div class="ilFormInfo">' . $lng->
txt(
"exc_no_team_yet_info") .
'</div>';
273 $team_info .=
'<div class="ilFormInfo">' . $lng->
txt(
"exc_no_team_yet_info_tutor") .
'</div>';
276 $team_info = $lng->
txt(
"exc_create_team_times_up_warning");
279 $builder->addProperty(
281 $lng->
txt(
"exc_team_members"),
289 $this->
ctrl->returnToParent($this);
296 $ilTabs = $DIC->tabs();
297 $ilCtrl = $DIC->ctrl();
298 $lng = $DIC->language();
302 $lng->
txt(
"exc_team"),
303 $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"submissionScreenTeam")
308 $lng->
txt(
"exc_team_log"),
309 $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"submissionScreenTeamLog")
315 return (($this->submission->canSubmit() &&
316 !$this->submission->getAssignment()->getTeamTutor()) ||
317 $this->submission->isTutor());
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();
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()
345 } elseif ($this->submission->getAssignment()->getTeamTutor()) {
346 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"exc_no_team_yet_info_tutor"));
351 "submissionScreenTeam",
353 $this->exercise->getRefId(),
358 $this->tpl->setContent($tbl->getHTML());
365 array $a_user_ids = array()
368 $this->
ctrl->redirect($this,
"submissionScreenTeam");
371 if ($a_user_ids === []) {
372 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"));
378 foreach ($a_user_ids as $user_id) {
379 if ($this->team->addTeamMember($user_id, $this->exercise->getRefId())) {
380 $new_users[] = $user_id;
383 if (!$this->exercise->members_obj->isAssigned($user_id)) {
384 $this->exercise->members_obj->assignMember($user_id);
388 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"exc_members_already_assigned_team"),
true);
392 if ($new_users !== []) {
394 $this->exercise->processExerciseStatus(
396 $this->team->getMembers(),
397 $this->submission->hasSubmitted(),
398 $this->submission->validatePeerReviews()
401 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
404 $this->
ctrl->redirect($this,
"submissionScreenTeam");
419 bool $a_full_delete =
false 424 if (!$this->submission->isTutor()) {
428 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"select_one"),
true);
429 $this->
ctrl->redirect($this,
"submissionScreenTeam");
438 $members = $this->team->getMembers();
439 if (count($members) <= count($ids)) {
440 if (count($members) == 1 && $members[0] == $ilUser->getId()) {
445 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"exc_team_at_least_one"),
true);
446 $this->
ctrl->redirect($this,
"submissionScreenTeam");
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()
456 :
"submissionScreenTeam");
458 $files = $this->submission->getFiles();
460 foreach ($ids as
$id) {
462 foreach ($files as $file) {
463 if ($file[
"owner_id"] == $id) {
469 $uname .=
": " . implode(
", ",
$details);
471 $cgui->addItem(
"id[]", $id, $uname);
481 bool $a_full_delete =
false 485 $cancel_cmd = $this->submission->isTutor()
487 :
"submissionScreenTeam";
490 if ($a_full_delete) {
491 $ids = $this->team->getMembers();
495 $ids = array_filter(array_map(
'intval', $ids));
498 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"select_one"),
true);
499 $this->
ctrl->redirect($this, $cancel_cmd);
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;
509 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"exc_team_at_least_one"),
true);
510 $this->
ctrl->redirect($this, $cancel_cmd);
515 foreach ($ids as $user_id) {
516 $this->team->removeTeamMember($user_id, $this->exercise->getRefId());
520 $this->exercise->processExerciseStatus(
526 if (!$team_deleted) {
528 $this->exercise->processExerciseStatus(
530 $this->team->getMembers(),
531 $this->submission->hasSubmitted(),
532 $this->submission->validatePeerReviews()
536 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
537 if (!$team_deleted) {
538 $this->
ctrl->redirect($this, $cancel_cmd);
540 $this->
ctrl->redirect($this,
"returnToParent");
546 $this->tabs_gui->activateTab(
"log");
550 "submissionScreenTeamLog",
554 $this->tpl->setContent($tbl->getHTML());
560 $this->assignment->getId(),
561 $this->submission->getUserId(),
564 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
571 $this->tpl->setContent($tbl->getHTML());
584 $form->setTitle($lng->
txt(
"exc_team_assignment_adopt_user"));
585 $form->setFormAction($ctrl->
getFormAction($this,
"createAdoptedTeam"));
590 $teams->addOption(
new ilRadioOption($lng->
txt(
"exc_team_assignment_adopt_none_user"), -1));
595 foreach ($options as
$id => $item) {
598 foreach ($item[
"user_team"] as $user_id) {
601 if (array_key_exists($user_id, $current_map)) {
602 $members[$user_id] .=
" (" . $lng->
txt(
"exc_team_assignment_adopt_already_assigned") .
")";
608 $members = implode(
"<br />", $members);
610 $option->setInfo($members);
612 $option->setDisabled(
true);
614 $teams->addOption($option);
617 $form->addItem($teams);
619 $form->addCommandButton(
"createAdoptedTeam", $lng->
txt(
"save"));
620 $form->addCommandButton(
"returnToParent", $lng->
txt(
"cancel"));
631 if ($this->submission->canSubmit()) {
633 if ($options !== []) {
642 if (!$this->exercise->members_obj->isAssigned($ilUser->getId())) {
643 $this->exercise->members_obj->assignMember($ilUser->getId());
646 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
649 $ilCtrl->redirect($this,
"returnToParent");
663 if ($this->submission->canSubmit()) {
664 $src_ass_id = $form->getInput(
"ass_adpt");
665 if ($src_ass_id > 0) {
671 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"settings_saved"),
true);
674 $ilCtrl->redirect($this,
"returnToParent");
683 $user_login = $this->request->getUserLogin();
684 if ($user_login ==
"") {
685 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_search_string'));
690 $users = explode(
',', $user_login);
693 foreach ($users as $user) {
697 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'user_not_known'));
702 $user_ids[] = $user_id;
ILIAS Exercise InternalGUIService $gui
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
array $requested_team_ids
buildSubmissionPropertiesAndActions(\ILIAS\Exercise\Assignment\PropertyAndActionBuilderUI $builder)
createSingleMemberTeamObject()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
getAdoptForm()
Get Adopt form.
ILIAS Exercise InternalDomainService $domain
Class ChatMainBarProvider .
const PRIVACY_MODE_RESPECT_USER_SETTING
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section
removeTeamMemberObject(bool $a_full_delete=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAdoptableTeamAssignments(int $a_exercise_id, int $a_exclude_ass_id=null, int $a_user_id=null)
static _lookupId($a_user_str)
addTeamMemberActionObject(array $a_user_ids=array())
ilExSubmission $submission
submissionScreenTeamLogObject()
getNextClass($a_gui_class=null)
ilExAssignment $assignment
submissionScreenTeamObject()
Displays a form which allows members to manage team uploads.
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
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...
static getTeamId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
addUserFromAutoCompleteObject()
Add user as member.
static getAssignmentTeamMap(int $a_ass_id)
ilGlobalTemplateInterface $tpl
confirmRemoveTeamMemberObject(bool $a_full_delete=false)
confirmDeleteTeamObject()
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static adoptTeams(int $a_source_ass_id, int $a_target_ass_id, int $a_user_id=null, int $a_exc_ref_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
Exercise gui request wrapper.
createAdoptedTeamObject()