ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilExerciseManagementGUI Class Reference

@ilCtrl_Calls ilExerciseManagementGUI: ilRepositorySearchGUI @ilCtrl_Calls ilExerciseManagementGUI: ilExSubmissionTeamGUI, ilExSubmissionFileGUI @ilCtrl_Calls ilExerciseManagementGUI: ilExSubmissionTextGUI, ilExPeerReviewGUI @ilCtrl_Calls ilExerciseManagementGUI: ilParticipantsPerAssignmentTableGUI @ilCtrl_Calls ilExerciseManagementGUI: ilResourceCollectionGUI, ilRepoStandardUploadHandlerGUI @ilCtrl_Calls ilExerciseManagementGUI: ilExerciseSubmissionFeedbackGUI More...

+ Collaboration diagram for ilExerciseManagementGUI:

Public Member Functions

 __construct (InternalService $service, ?ilExAssignment $a_ass=null)
 Constructor. More...
 
 executeCommand ()
 
 addSubTabs (string $a_activate)
 
 waitingDownloadObject ()
 
 membersObject ()
 All participants and submission of one assignment. More...
 
 downloadSelectedObject ()
 
 downloadSubmissionsObject (?array $selected_participants=null)
 
 backToCurrentOverview ()
 
 membersApplyObject ()
 
 membersResetObject ()
 
 saveGradesObject ()
 
 compareTextAssignmentsObject ()
 TODO -> Deal with the redirection after update the grade via action button. More...
 
 getReportPanel (array $a_data)
 
 getEvaluationModal (array $a_data)
 
 getEvaluationModalForm (array $a_data)
 
 saveEvaluationFromModalObject ()
 
 addUserFromAutoCompleteObject ()
 
 addMembersObject ($a_user_ids=array())
 
 selectAssignmentObject ()
 
 showParticipantObject ()
 Show Participant. More...
 
 showParticipantApplyObject ()
 
 showParticipantResetObject ()
 
 selectParticipantObject ()
 
 showGradesOverviewObject ()
 
 redirectFeedbackMailObject ()
 
 sendMembersObject ()
 
 confirmDeassignMembersObject ()
 
 deassignMembersObject ()
 
 saveStatusParticipantObject (?array $selected_ass_ids=null)
 Save assignment status (participant view) More...
 
 saveStatusAllObject (?array $a_selected=null, bool $a_redirect=true)
 
 saveStatusSelectedObject ()
 
 exportExcelObject ()
 
 createTeamsObject ()
 
 dissolveTeamsObject ()
 
 adoptTeamsFromGroupObject (?ilPropertyFormGUI $a_form=null)
 
 createTeamsFromGroupsObject ()
 
 getMultiFeedbackForm (int $a_ass_id)
 
 handleMultiFeedbackUploadResult (FileUpload $upload, UploadResult $result)
 
 showMultiFeedbackObject (?FormAdapterGUI $form=null)
 
 downloadMultiFeedbackZipObject ()
 Download multi-feedback structrue file. More...
 
 uploadMultiFeedbackObject ()
 Upload multi feedback file. More...
 
 showMultiFeedbackConfirmationTableObject ()
 Show multi feedback confirmation table. More...
 
 cancelMultiFeedbackObject ()
 Cancel Multi Feedback. More...
 
 saveMultiFeedbackObject ()
 Save multi feedback. More...
 
 initFilter ()
 
 openSubmissionPrintViewObject ()
 Open HTML view for portfolio submissions. More...
 
 openSubmissionViewObject (bool $print_version=false)
 Open HTML view for portfolio submissions. More...
 
 collectFeedbackDataFromPeer (int $user_id, string $ts, string $text)
 
 sendGradingNotificationObject ()
 

Data Fields

const VIEW_ASSIGNMENT = 1
 
const VIEW_PARTICIPANT = 2
 
const VIEW_GRADES = 3
 
const FEEDBACK_ONLY_SUBMISSION = "submission_only"
 
const FEEDBACK_FULL_SUBMISSION = "submission_feedback"
 
const GRADE_NOT_GRADED = "notgraded"
 
const GRADE_PASSED = "passed"
 
const GRADE_FAILED = "failed"
 

Protected Member Functions

 getViewBack ()
 
 initSubmission ()
 
 getMultiActionUserIds (bool $a_keep_teams=false)
 
 saveStatus (array $a_data, bool $a_redirect=true)
 
 initGroupForm ()
 
 initIndividualDeadlineModal ()
 
 parseIndividualDeadlineData (array $a_data)
 
 handleIndividualDeadlineCallsObject ()
 
 initIndividualDeadlineForm (array $a_ass_map, array $ids)
 
 setIndividualDeadlineObject ()
 
 getWebFilePathFromExternalFilePath (string $external_file_path)
 Get the object specific file path from an external full file path. More...
 
 setBackToMembers ()
 
 setFailedObject ()
 
 setPassedObject ()
 
 setSingleStatus ($ass_id, $part_id, $status)
 

Protected Attributes

ZipAdapter $zip
 
ilGlobalTemplateInterface $tpl
 
ILIAS Exercise InternalDomainService $domain
 
ILIAS Exercise Notification NotificationManager $notification
 
TutorFeedbackFileManager $tutor_feedback_file
 
InternalGUIService $gui
 
ILIAS HTTP Services $http
 
ilCtrl $ctrl
 
ilTabsGUI $tabs_gui
 
ilLanguage $lng
 
ilAccessHandler $access
 
Factory $ui_factory
 
Renderer $ui_renderer
 
array $filter = []
 
ilToolbarGUI $toolbar
 
ilObjExercise $exercise
 
ilExAssignment $assignment = null
 
TaskFactory $task_factory
 
ilLogger $log
 
ilObjUser $user
 
InternalService $service
 
ilDBInterface $db = null
 
int $ass_id = 0
 
int $requested_member_id = 0
 
int $requested_part_id = 0
 
int $requested_ass_id = 0
 
string $requested_idl_id
 
bool $done = false
 
array $requested_learning_comments
 
string $requested_comment
 
string $requested_user_login
 
array $selected_participants
 
array $listed_participants
 
array $selected_ass_ids
 
array $listed_ass_ids
 
array $requested_marks
 
array $requested_status
 
array $requested_tutor_notices
 
array $requested_group_members
 
array $requested_files
 
string $requested_filter_status
 
string $requested_filter_feedback
 
GUIRequest $request
 
ilExerciseSubmissionFeedbackGUI $feedback_gui
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilExerciseManagementGUI::__construct ( InternalService  $service,
?ilExAssignment  $a_ass = null 
)

Constructor.

Parameters
InternalService$service
ilExAssignment | null$a_ass

Definition at line 106 of file class.ilExerciseManagementGUI.php.

107 {
108 global $DIC;
109
110 $this->service = $service;
111 $this->gui = $gui = $service->gui();
112 $this->domain = $domain = $service->domain();
113
114 $this->user = $domain->user();
115 $this->log = $domain->logger()->exc();
116 $this->access = $domain->access();
117 $this->lng = $domain->lng();
118
119 $this->toolbar = $gui->toolbar();
120 $this->ui_factory = $gui->ui()->factory();
121 $this->ui_renderer = $gui->ui()->renderer();
122 $this->ctrl = $gui->ctrl();
123 $this->tabs_gui = $gui->tabs();
124 $this->tpl = $gui->ui()->mainTemplate();
125 $this->http = $gui->http();
126
127 $this->task_factory = $domain->backgroundTasks()->taskFactory();
128 $this->request = $gui->request();
130
131 $this->exercise = $request->getExercise();
132 if ($a_ass !== null) {
133 $this->assignment = $a_ass;
134 $this->ass_id = $this->assignment->getId();
135 }
136 $this->requested_member_id = $request->getMemberId();
137 $this->requested_part_id = $request->getParticipantId();
138 $this->requested_ass_id = $request->getAssId();
139 $this->requested_idl_id = $request->getIdlId();
140 $this->done = $request->getDone();
141 $this->requested_learning_comments = $request->getLearningComments();
142 $this->requested_comment = $request->getComment();
143 $this->requested_user_login = $request->getUserLogin();
144 $this->selected_participants = $request->getSelectedParticipants();
145 $this->listed_participants = $request->getListedParticipants();
146 $this->selected_ass_ids = $request->getSelectedAssignments();
147 $this->listed_ass_ids = $request->getListedAssignments();
148 $this->requested_marks = $request->getMarks();
149 $this->requested_status = $request->getStatus();
150 $this->requested_tutor_notices = $request->getTutorNotices();
151 $this->requested_group_members = $request->getGroupMembers();
152 $this->requested_files = $request->getFiles();
153 $this->requested_filter_status = $request->getFilterStatus();
154 $this->requested_filter_feedback = $request->getFilterFeedback();
155
156 $this->notification = $domain->notification($request->getRefId());
157
158 $this->feedback_gui = $DIC->exercise()->internal()->gui()->getSubmissionFeedbackGUI(
159 $this->exercise,
160 $this->notification
161 );
162
163 $this->ctrl->saveParameter($this, array("vw", "member_id"));
164 if ($this->ass_id > 0) {
165 $this->tutor_feedback_file = $domain->assignment()->tutorFeedbackFile($this->ass_id);
166 }
167 $this->zip = $domain->resources()->zip();
168 $this->ctrl->saveParameter($this, array("part_id"));
169 }
getTutorNotices()
key might be ass_ids or user_ids!
getMarks()
key might be ass_ids or user_ids!
getStatus()
key might be ass_ids or user_ids!
request(?array $query_params=null, ?array $post_data=null)
Get request wrapper.
ILIAS Exercise InternalDomainService $domain
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26

References $DIC, $domain, $gui, $request, $service, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Exercise\InternalService\domain(), ILIAS\Exercise\GUIRequest\getAssId(), ILIAS\Exercise\GUIRequest\getComment(), ILIAS\Exercise\GUIRequest\getDone(), ILIAS\Exercise\GUIRequest\getExercise(), ILIAS\Exercise\GUIRequest\getFiles(), ILIAS\Exercise\GUIRequest\getFilterFeedback(), ILIAS\Exercise\GUIRequest\getFilterStatus(), ILIAS\Exercise\GUIRequest\getGroupMembers(), ILIAS\Exercise\GUIRequest\getIdlId(), ILIAS\Exercise\GUIRequest\getLearningComments(), ILIAS\Exercise\GUIRequest\getListedAssignments(), ILIAS\Exercise\GUIRequest\getListedParticipants(), ILIAS\Exercise\GUIRequest\getMarks(), ILIAS\Exercise\GUIRequest\getMemberId(), ILIAS\Exercise\GUIRequest\getParticipantId(), ILIAS\Exercise\GUIRequest\getRefId(), ILIAS\Exercise\GUIRequest\getSelectedAssignments(), ILIAS\Exercise\GUIRequest\getSelectedParticipants(), ILIAS\Exercise\GUIRequest\getStatus(), ILIAS\Exercise\GUIRequest\getTutorNotices(), ILIAS\Exercise\GUIRequest\getUserLogin(), ILIAS\Exercise\InternalService\gui(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\UI\examples\Symbol\Glyph\Notification\notification(), ILIAS\Exercise\InternalGUIService\request(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addMembersObject()

ilExerciseManagementGUI::addMembersObject (   $a_user_ids = array())

Definition at line 948 of file class.ilExerciseManagementGUI.php.

948 : void
949 {
950 if (!count($a_user_ids)) {
951 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
952 } else {
953 if (!$this->exercise->members_obj->assignMembers($a_user_ids)) {
954 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("exc_members_already_assigned"), true);
955 } else {
956 $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_members_assigned"), true);
957 }
958 }
959 $this->ctrl->redirect($this, "members");
960 }

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

+ Here is the call graph for this function:

◆ addSubTabs()

ilExerciseManagementGUI::addSubTabs ( string  $a_activate)

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

313 : void
314 {
315 $ilTabs = $this->tabs_gui;
317 $ilCtrl = $this->ctrl;
318
319 $ass_id = $this->assignment !== null ? $this->assignment->getId() : 0;
320 $part_id = $this->requested_part_id;
321
322 $ilCtrl->setParameter($this, "vw", "");
323 $ilCtrl->setParameter($this, "member_id", "0");
324 $ilCtrl->setParameter($this, "ass_id", "0");
325 $ilCtrl->setParameter($this, "part_id", "0");
326
327 $ilTabs->addSubTab(
328 "assignment",
329 $lng->txt("exc_assignment_view"),
330 $ilCtrl->getLinkTarget($this, "members")
331 );
332 $ilTabs->addSubTab(
333 "participant",
334 $lng->txt("exc_participant_view"),
335 $ilCtrl->getLinkTarget($this, "showParticipant")
336 );
337 $ilTabs->addSubTab(
338 "grades",
339 $lng->txt("exc_grades_overview"),
340 $ilCtrl->getLinkTarget($this, "showGradesOverview")
341 );
342 $ilTabs->activateSubTab($a_activate);
343
344 $ilCtrl->setParameter($this, "ass_id", $ass_id);
345 $ilCtrl->setParameter($this, "part_id", $part_id);
346 }
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...

References $ass_id, $ctrl, $lng, $requested_part_id, $tabs_gui, and ilLanguage\txt().

Referenced by executeCommand(), and membersObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUserFromAutoCompleteObject()

ilExerciseManagementGUI::addUserFromAutoCompleteObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 922 of file class.ilExerciseManagementGUI.php.

922 : void
923 {
924 if ($this->requested_user_login == "") {
925 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_search_string'));
926 $this->membersObject();
927 return;
928 }
929 $users = explode(',', $this->requested_user_login);
930
931 $user_ids = array();
932 foreach ($users as $user) {
934
935 if (!$user_id) {
936 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('user_not_known'));
937 $this->membersObject();
938 return;
939 }
940
941 $user_ids[] = $user_id;
942 }
943
944 $this->addMembersObject($user_ids);
945 }
membersObject()
All participants and submission of one assignment.
static _lookupId(string|array $a_user_str)

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

+ Here is the call graph for this function:

◆ adoptTeamsFromGroupObject()

ilExerciseManagementGUI::adoptTeamsFromGroupObject ( ?ilPropertyFormGUI  $a_form = null)

Definition at line 1552 of file class.ilExerciseManagementGUI.php.

1554 : void {
1555 $ilCtrl = $this->ctrl;
1556 $ilTabs = $this->tabs_gui;
1557 $lng = $this->lng;
1558 $tpl = $this->tpl;
1559
1560 $ilTabs->clearTargets();
1561 $ilTabs->setBackTarget(
1562 $lng->txt("back"),
1563 $ilCtrl->getLinkTarget($this, $this->getViewBack())
1564 );
1565
1566 if ($a_form === null) {
1567 $a_form = $this->initGroupForm();
1568 }
1569 $tpl->setContent($a_form->getHTML());
1570 }
setContent(string $a_html)
Sets content for standard template.

◆ backToCurrentOverview()

ilExerciseManagementGUI::backToCurrentOverview ( )

Definition at line 521 of file class.ilExerciseManagementGUI.php.

521 : void
522 {
523 if ($this->assignment !== null) {
524 $this->ctrl->redirect($this, "members");
525 } else {
526 $this->ctrl->redirect($this, "showParticipant");
527 }
528 }

References ILIAS\Repository\ctrl().

Referenced by downloadSelectedObject(), and downloadSubmissionsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelMultiFeedbackObject()

ilExerciseManagementGUI::cancelMultiFeedbackObject ( )

Cancel Multi Feedback.

Definition at line 1820 of file class.ilExerciseManagementGUI.php.

1820 : void
1821 {
1822 $this->ctrl->redirect($this, "members");
1823 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ collectFeedbackDataFromPeer()

ilExerciseManagementGUI::collectFeedbackDataFromPeer ( int  $user_id,
string  $ts,
string  $text 
)

Definition at line 2230 of file class.ilExerciseManagementGUI.php.

2234 : array {
2235 $user = new ilObjUser($user_id);
2236 $uname = $user->getFirstname() . " " . $user->getLastname();
2237
2238 $data = array(
2239 "uid" => $user_id,
2240 "uname" => $uname,
2241 "udate" => $ts,
2242 "utext" => $this->gui->getUIUtil()->formatTextInput($text) // mob id to mob src
2243 );
2244
2245 //get data peer and assign it
2246 $peer_review = new ilExPeerReview($this->assignment);
2247 $data["peer"] = array();
2248 foreach ($peer_review->getPeerReviewsByPeerId($user_id) as $value) {
2249 $data["peer"][] = $value['giver_id'];
2250 }
2251
2252 $data["fb_received"] = count($data["peer"]);
2253 $data["fb_given"] = $peer_review->countGivenFeedback(true, $user_id);
2254
2255 return $data;
2256 }
Exercise peer review.
User class.
$text
Definition: xapiexit.php:21

Referenced by compareTextAssignmentsObject().

+ Here is the caller graph for this function:

◆ compareTextAssignmentsObject()

ilExerciseManagementGUI::compareTextAssignmentsObject ( )

TODO -> Deal with the redirection after update the grade via action button.

Extract the data collection to another method. List and compare use this. DRY

Exceptions
ilDateTimeException|ilExcUnknownAssignmentTypeException

Definition at line 647 of file class.ilExerciseManagementGUI.php.

647 : void
648 {
649 $this->setBackToMembers();
650 $subm = $this->domain->submission($this->assignment->getId());
651
652 $group_panels_tpl = new ilTemplate("tpl.exc_group_report_panels.html", true, true, "components/ILIAS/Exercise");
653 $group_panels_tpl->setVariable('TITLE', $this->lng->txt("exc_compare_selected_submissions"));
654
655 $report_html = "";
656 //participant ids selected via checkboxes
657 $participants = array_keys($this->getMultiActionUserIds());
658
659 foreach ($participants as $participant_id) {
660 $subs = $subm->getSubmissionsOfUser($participant_id);
661 $ts = "";
662 $text = "";
663 if ($s = $subs->current()) {
664 $ts = $s->getTimestamp();
665 $text = $s->getText();
666 }
667
668 $feedback_data = $this->collectFeedbackDataFromPeer(
669 $participant_id,
670 $ts,
671 $text
672 );
673
674 $submission_data = $this->assignment->getExerciseMemberAssignmentData((int) $participant_id, $this->filter["status"] ?? "");
675
676 if (is_array($submission_data)) {
677 $data = array_merge($feedback_data, $submission_data);
678 $report_html .= $this->getReportPanel($data);
679 }
680 }
681
682 $group_panels_tpl->setVariable('CONTENT', $report_html);
683 $this->tpl->setContent($group_panels_tpl->get());
684 }
collectFeedbackDataFromPeer(int $user_id, string $ts, string $text)
getMultiActionUserIds(bool $a_keep_teams=false)
special template class to simplify handling of ITX/PEAR
filter(string $filter_id, array $class_path, string $cmd, bool $activated=true, bool $expanded=true)

References $data, $text, collectFeedbackDataFromPeer(), ILIAS\Repository\filter(), getMultiActionUserIds(), getReportPanel(), ILIAS\Repository\lng(), and setBackToMembers().

+ Here is the call graph for this function:

◆ confirmDeassignMembersObject()

ilExerciseManagementGUI::confirmDeassignMembersObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 1275 of file class.ilExerciseManagementGUI.php.

1275 : void
1276 {
1277 $ilCtrl = $this->ctrl;
1278 $tpl = $this->tpl;
1279 $lng = $this->lng;
1280
1281 $members = $this->getMultiActionUserIds();
1282
1283 $cgui = new ilConfirmationGUI();
1284 $cgui->setFormAction($ilCtrl->getFormAction($this));
1285 $cgui->setHeaderText($lng->txt("exc_msg_sure_to_deassign_participant"));
1286 $cgui->setCancel($lng->txt("cancel"), "members");
1287 $cgui->setConfirm($lng->txt("remove"), "deassignMembers");
1288 foreach ($members as $k => $m) {
1289 $cgui->addItem(
1290 "member_ids[]",
1291 $k,
1292 ilUserUtil::getNamePresentation((int) $k, false, false, "", true)
1293 );
1294 }
1295
1296 $tpl->setContent($cgui->getHTML());
1297 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 $lng, ilUserUtil\getNamePresentation(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ createTeamsFromGroupsObject()

ilExerciseManagementGUI::createTeamsFromGroupsObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 1616 of file class.ilExerciseManagementGUI.php.

1616 : void
1617 {
1618 $lng = $this->lng;
1619
1620 $req_members = $this->requested_group_members;
1621
1622 $form = $this->initGroupForm();
1623 if ($form->checkInput()) {
1624 $map = ilExAssignmentTeam::getGroupMembersMap($this->exercise->getRefId());
1625 $all_members = $teams = array();
1626 $valid = true;
1627 foreach (array_keys($map) as $grp_id) {
1628 if (isset($req_members[$grp_id]) && is_array($req_members[$grp_id])) {
1629 $members = $req_members[$grp_id];
1630 $teams[] = $members;
1631 $invalid_team_members = array();
1632
1633 foreach ($members as $user_id) {
1634 if (!array_key_exists($user_id, $all_members)) {
1635 $all_members[$user_id] = $grp_id;
1636 } else {
1637 // user is selected in multiple groups
1638 $invalid_team_members[] = $user_id;
1639 }
1640 }
1641
1642 if ($invalid_team_members !== []) {
1643 $valid = false;
1644
1645 $alert = array();
1646 foreach ($invalid_team_members as $user_id) {
1647 $user_name = ilUserUtil::getNamePresentation($user_id, false, false, "", true);
1648 $grp_title = $map[$all_members[$user_id]]["title"];
1649 $alert[] = sprintf($lng->txt("exc_adopt_group_teams_conflict"), $user_name, $grp_title);
1650 }
1651 $input = $form->getItemByPostVar("grpt[" . $grp_id . "]");
1652 $input->setAlert(implode("<br/>", $alert));
1653 }
1654 }
1655 }
1656 if ($valid) {
1657 if ($teams !== []) {
1658 $existing_users = array_keys(ilExAssignmentTeam::getAssignmentTeamMap($this->assignment->getId()));
1659
1660 // create teams from group selections
1661 $sum = array("added" => 0, "blocked" => 0);
1662 foreach ($teams as $members) {
1663 foreach ($members as $user_id) {
1664 if (!$this->exercise->members_obj->isAssigned($user_id)) {
1665 $this->exercise->members_obj->assignMember($user_id);
1666 }
1667
1668 if (!in_array($user_id, $existing_users)) {
1669 $sum["added"]++;
1670 } else {
1671 $sum["blocked"]++;
1672 }
1673 }
1674
1675 $first = array_shift($members);
1676 $team = ilExAssignmentTeam::getInstanceByUserId($this->assignment->getId(), $first, true);
1677
1678 // getTeamId() does NOT send notification
1679 // $team->sendNotification($this->exercise->getRefId(), $first, "add");
1680
1681 foreach ($members as $user_id) {
1682 $team->addTeamMember($user_id);
1683 }
1684 }
1685
1686 $mess = array();
1687 if ($sum["added"] !== 0) {
1688 $mess[] = sprintf($lng->txt("exc_adopt_group_teams_added"), $sum["added"]);
1689 }
1690 if ($sum["blocked"] !== 0) {
1691 $mess[] = sprintf($lng->txt("exc_adopt_group_teams_blocked"), $sum["blocked"]);
1692 }
1693 if ($sum["added"] !== 0) {
1694 $this->tpl->setOnScreenMessage('success', implode(" ", $mess), true);
1695 } else {
1696 $this->tpl->setOnScreenMessage('failure', implode(" ", $mess), true);
1697 }
1698 }
1699 $this->ctrl->redirect($this, "members");
1700 } else {
1701 $this->tpl->setOnScreenMessage('failure', $lng->txt("form_input_not_valid"));
1702 }
1703 }
1704
1705 $form->setValuesByPost();
1706 $this->adoptTeamsFromGroupObject($form);
1707 }
static getAssignmentTeamMap(int $a_ass_id)
static getInstanceByUserId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
static getGroupMembersMap(int $a_exc_ref_id)
adoptTeamsFromGroupObject(?ilPropertyFormGUI $a_form=null)
$valid

References $lng, $user_id, $valid, ILIAS\Repository\ctrl(), ilExAssignmentTeam\getAssignmentTeamMap(), ilExAssignmentTeam\getGroupMembersMap(), ilExAssignmentTeam\getInstanceByUserId(), and ilUserUtil\getNamePresentation().

+ Here is the call graph for this function:

◆ createTeamsObject()

ilExerciseManagementGUI::createTeamsObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 1472 of file class.ilExerciseManagementGUI.php.

1472 : void
1473 {
1474 $ilCtrl = $this->ctrl;
1475
1476 $members = $this->getMultiActionUserIds(true);
1477
1478 $new_members = array();
1479
1480 foreach ($members as $group) {
1481 if (is_array($group)) {
1482 $new_members = array_merge($new_members, $group);
1483
1484 $first_user = $group;
1485 $first_user = array_shift($first_user);
1486 $team = ilExAssignmentTeam::getInstanceByUserId($this->assignment->getId(), $first_user);
1487 foreach ($group as $user_id) {
1488 $team->removeTeamMember($user_id);
1489 }
1490 } else {
1491 $new_members[] = $group;
1492 }
1493 }
1494
1495 if ($new_members !== []) {
1496 // see ilExSubmissionTeamGUI::addTeamMemberActionObject()
1497
1498 $first_user = array_shift($new_members);
1499 $team = ilExAssignmentTeam::getInstanceByUserId($this->assignment->getId(), $first_user, true);
1500 foreach ($new_members as $user_id) {
1501 $team->addTeamMember($user_id);
1502 }
1503
1504 // re-evaluate complete team, as some members might have had submitted
1505 $submission = new ilExSubmission($this->assignment, $first_user);
1506 $this->exercise->processExerciseStatus(
1507 $this->assignment,
1508 $team->getMembers(),
1509 $submission->hasSubmitted(),
1510 $submission->validatePeerReviews()
1511 );
1512 }
1513
1514 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
1515 $ilCtrl->redirect($this, "members");
1516 }
Exercise submission //TODO: This class has many static methods related to delivered "files".

References $user_id, ilExAssignmentTeam\getInstanceByUserId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ deassignMembersObject()

ilExerciseManagementGUI::deassignMembersObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 1304 of file class.ilExerciseManagementGUI.php.

1304 : void
1305 {
1306 $ilCtrl = $this->ctrl;
1307 $lng = $this->lng;
1308
1309 $member_ids = $this->request->getMemberIds();
1310
1311 foreach ($member_ids as $usr_id) {
1312 $this->exercise->members_obj->deassignMember((int) $usr_id);
1313 }
1314 $this->tpl->setOnScreenMessage('success', $lng->txt("exc_msg_participants_removed"), true);
1315 $ilCtrl->redirect($this, "members");
1316 }

References $lng.

◆ dissolveTeamsObject()

ilExerciseManagementGUI::dissolveTeamsObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 1521 of file class.ilExerciseManagementGUI.php.

1521 : void
1522 {
1523 $ilCtrl = $this->ctrl;
1524
1525 $members = $this->getMultiActionUserIds(true);
1526
1527 foreach ($members as $group) {
1528 // if single member - nothing to do
1529 if (is_array($group)) {
1530 // see ilExSubmissionTeamGUI::removeTeamMemberObject()
1531
1532 $first_user = $group;
1533 $first_user = array_shift($first_user);
1534 $team = ilExAssignmentTeam::getInstanceByUserId($this->assignment->getId(), $first_user);
1535 foreach ($group as $user_id) {
1536 $team->removeTeamMember($user_id);
1537 }
1538
1539 // reset ex team members, as any submission is not valid without team
1540 $this->exercise->processExerciseStatus(
1541 $this->assignment,
1542 $group,
1543 false
1544 );
1545 }
1546 }
1547
1548 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
1549 $ilCtrl->redirect($this, "members");
1550 }

References $user_id, ilExAssignmentTeam\getInstanceByUserId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ downloadMultiFeedbackZipObject()

ilExerciseManagementGUI::downloadMultiFeedbackZipObject ( )

Download multi-feedback structrue file.

Definition at line 1777 of file class.ilExerciseManagementGUI.php.

1777 : void
1778 {
1779 $st_file = $this->domain->assignment()->tutorFeedbackZip()->getMultiFeedbackStructureFile(
1780 $this->assignment,
1781 $this->exercise
1782 );
1783 $this->gui->httpUtil()->deliverString(
1784 $st_file->content,
1785 $st_file->filename,
1786 "application/zip"
1787 );
1788 }

◆ downloadSelectedObject()

ilExerciseManagementGUI::downloadSelectedObject ( )

Definition at line 493 of file class.ilExerciseManagementGUI.php.

493 : void
494 {
495 if (count($this->selected_participants) > 0) {
496 $this->downloadSubmissionsObject($this->selected_participants);
497 } else {
498 $this->backToCurrentOverview();
499 }
500 }
downloadSubmissionsObject(?array $selected_participants=null)

References backToCurrentOverview(), and downloadSubmissionsObject().

+ Here is the call graph for this function:

◆ downloadSubmissionsObject()

ilExerciseManagementGUI::downloadSubmissionsObject ( ?array  $selected_participants = null)

Definition at line 501 of file class.ilExerciseManagementGUI.php.

501 : void
502 {
503 $participant_id = $this->requested_part_id;
504
505 $download_task = new ilDownloadSubmissionsBackgroundTask(
506 (int) $GLOBALS['DIC']->user()->getId(),
507 $this->exercise->getRefId(),
508 $this->exercise->getId(),
509 $this->ass_id,
510 $participant_id,
512 );
513
514 if ($download_task->run()) {
515 $this->tpl->setOnScreenMessage('success', $this->lng->txt('exc_down_files_started_bg'), true);
516 }
517
518 $this->backToCurrentOverview();
519 }
Download submissions and feedback for exercises.
$GLOBALS["DIC"]
Definition: wac.php:54

References $GLOBALS, $requested_part_id, $selected_participants, backToCurrentOverview(), ILIAS\Survey\Mode\getId(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

Referenced by downloadSelectedObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilExerciseManagementGUI::executeCommand ( )
Exceptions
ilCtrlException
ilExcUnknownAssignmentTypeException

Definition at line 175 of file class.ilExerciseManagementGUI.php.

175 : void
176 {
177 $ilCtrl = $this->ctrl;
179 $ilTabs = $this->tabs_gui;
180
181 $class = $ilCtrl->getNextClass($this);
182 //$cmd = $ilCtrl->getCmd("listPublicSubmissions");
183
184 switch ($class) {
185 // feedback files IRSS
186 case strtolower(ilResourceCollectionGUI::class):
187 $ilTabs->clearTargets();
188 $ilTabs->setBackTarget(
189 $lng->txt("back"),
190 $ilCtrl->getLinkTarget($this, $this->getViewBack())
191 );
192 $this->domain->assignment()->tutorFeedbackFile($this->ass_id)->addObserver();
193 $this->tpl->setOnScreenMessage('info', $lng->txt("exc_fb_tutor_info"));
194 $gui = $this->gui->assignment()->getTutorFeedbackFileResourceCollectionGUI(
195 $this->exercise->getRefId(),
196 $this->assignment->getId(),
197 $this->requested_member_id
198 );
199 $this->ctrl->forwardCommand($gui);
200 break;
201
202 case 'ilrepositorysearchgui':
203 $rep_search = new ilRepositorySearchGUI();
204 $ref_id = $this->exercise->getRefId();
205 $rep_search->addUserAccessFilterCallable(function ($a_user_ids) use ($ref_id) {
206 return $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
207 'edit_submissions_grades',
208 'edit_submissions_grades',
209 $ref_id,
210 $a_user_ids
211 );
212 });
213 $rep_search->setTitle($this->lng->txt("exc_add_participant"));
214 $rep_search->setCallback($this, 'addMembersObject');
215
216 // Set tabs
217 $this->addSubTabs("assignment");
218 $this->ctrl->setReturn($this, 'members');
219
220 $this->ctrl->forwardCommand($rep_search);
221 break;
222
223 case strtolower(ilRepoStandardUploadHandlerGUI::class):
224 $form = $this->getMultiFeedbackForm($this->assignment->getId());
225 $gui = $form->getRepoStandardUploadHandlerGUI("mfzip");
226 $this->ctrl->forwardCommand($gui);
227 break;
228
229 case "ilexsubmissionteamgui":
230 $gui = new ilExSubmissionTeamGUI($this->exercise, $this->initSubmission());
231 $ilCtrl->forwardCommand($gui);
232 break;
233
234 case "ilexsubmissionfilegui":
235 $gui = new ilExSubmissionFileGUI($this->exercise, $this->initSubmission());
236 $ilCtrl->forwardCommand($gui);
237 break;
238
239 case "ilexsubmissiontextgui":
240 $ilCtrl->saveParameter($this, array("part_id"));
241 $gui = new ilExSubmissionTextGUI($this->exercise, $this->initSubmission());
242 $ilCtrl->forwardCommand($gui);
243 break;
244
245 case "ilexpeerreviewgui":
246 $gui = new ilExPeerReviewGUI($this->assignment, $this->initSubmission());
247 $ilCtrl->forwardCommand($gui);
248 break;
249
250 case "ilparticipantsperassignmenttablegui":
252 $this,
253 "members",
254 $this->exercise,
255 $this->assignment->getId(),
256 $this->feedback_gui
257 );
258 $this->ctrl->forwardCommand($table);
259 break;
260
261 case "ilexercisesubmissionfeedbackgui":
262 $this->ctrl->forwardCommand($this->feedback_gui);
263 break;
264
265 default:
266 $cmd = $ilCtrl->getCmd();
267 switch ($cmd) {
268 case 'downloadSubmissions':
269 $cmd = $ilCtrl->getCmd("downloadSubmissions");
270 break;
271 default:
272 $cmd = $ilCtrl->getCmd("listPublicSubmissions");
273 break;
274 }
275 $this->{$cmd . "Object"}();
276 break;
277 }
278 }
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:66

References $ctrl, $GLOBALS, $gui, $lng, $ref_id, $tabs_gui, addSubTabs(), ILIAS\Exercise\InternalGUIService\assignment(), ILIAS\Repository\ctrl(), getMultiFeedbackForm(), initSubmission(), ILIAS\Repository\lng(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ exportExcelObject()

ilExerciseManagementGUI::exportExcelObject ( )

Definition at line 1458 of file class.ilExerciseManagementGUI.php.

1458 : void
1459 {
1460 $this->exercise->exportGradesExcel();
1461 exit;
1462 }
exit

References exit.

◆ getEvaluationModal()

ilExerciseManagementGUI::getEvaluationModal ( array  $a_data)

Definition at line 806 of file class.ilExerciseManagementGUI.php.

808 : RoundTrip {
809 $more_id = $a_data['uid'];
810 $this->tpl->addJavaScript("assets/js/exc-text-more.js");
811 $modal_tpl = new ilTemplate("tpl.exc_report_evaluation_modal.html", true, true, "components/ILIAS/Exercise");
812 $modal_tpl->setVariable("USER_NAME", $a_data['uname']);
813
814 $form = $this->getEvaluationModalForm($a_data);
815 //TODO: CHECK ilias string utils. ilUtil shortenText with net blank.
816 if ($this->exercise->hasTutorFeedbackText()) {
817 $max_chars = 500;
818 $more_button = $this->gui->ui()->factory()->button()->standard($this->lng->txt("exc_show_more"), "#");
819 $text = "<div data-exc-show-more='$more_id'><div>";
820 $text .= $a_data["utext"];
821 $text .= "</div><div>";
822 $text .= $this->gui->ui()->renderer()->render($more_button);
823 $text .= "</div></div>";
824 $modal_tpl->setVariable("USER_TEXT", $text);
825 }
826
827 $modal_tpl->setVariable("FORM", $form->getHTML());
828
829 $form_id = 'form_' . $form->getId();
830 $submit_btn = $this->ui_factory->button()->primary($this->lng->txt("save"), '#')
831 ->withOnLoadCode(function ($id) use ($form_id) {
832 return "$('#$id').click(function() { $('#$form_id').submit(); return false; });";
833 });
834
835 return $this->ui_factory->modal()->roundtrip(strtoupper($this->lng->txt("grade_evaluate")), $this->ui_factory->legacy()->content($modal_tpl->get()))->withActionButtons([$submit_btn]);
836 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

Referenced by getReportPanel().

+ Here is the caller graph for this function:

◆ getEvaluationModalForm()

ilExerciseManagementGUI::getEvaluationModalForm ( array  $a_data)

Definition at line 838 of file class.ilExerciseManagementGUI.php.

841 $form = new ilPropertyFormGUI();
842 $this->ctrl->setParameterByClass(
843 self::class,
844 "ass_id",
845 $this->assignment->getId()
846 );
847 $form->setFormAction($this->ctrl->getFormAction($this, "saveEvaluationFromModal"));
848 $form->setId(uniqid('form'));
849
850 //Grade
851 $options = array(
852 self::GRADE_NOT_GRADED => $this->lng->txt("exc_notgraded"),
853 self::GRADE_PASSED => $this->lng->txt("exc_passed"),
854 self::GRADE_FAILED => $this->lng->txt("exc_failed")
855 );
856 $si = new ilSelectInputGUI($this->lng->txt("exc_tbl_status"), "grade");
857 $si->setOptions($options);
858 $si->setValue($a_data['status'] ?? "");
859 $form->addItem($si);
860
861 //Mark
862 $mark_input = new ilTextInputGUI($this->lng->txt("exc_tbl_mark"), "mark");
863 $mark_input->setValue($a_data['mark'] ?? "");
864 $mark_input->setMaxLength(32);
865 $mark_input->setSize(4);
866 $form->addItem($mark_input);
867
868 $item = new ilHiddenInputGUI('mem_id');
869 $item->setValue($a_data['uid'] ?? "");
870 $form->addItem($item);
871
872 //TODO: CHECK ilias string utils. ilUtil shortenText with net blank.
873 if ($this->exercise->hasTutorFeedbackText()) {
874 $ta = new ilTextAreaInputGUI($this->lng->txt("exc_comment"), 'comment');
875 $ta->setInfo($this->lng->txt("exc_comment_for_learner_info"));
876 $ta->setValue($a_data['comment'] ?? "");
877 $ta->setRows(10);
878 $form->addItem($ta);
879 }
880 return $form;
881 }
This class represents a hidden form property in a property form.
This class represents a property form user interface.
This class represents a selection list property in a property form.
This class represents a text area property in a property form.
This class represents a text property in a property form.

◆ getMultiActionUserIds()

ilExerciseManagementGUI::getMultiActionUserIds ( bool  $a_keep_teams = false)
protected
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 1193 of file class.ilExerciseManagementGUI.php.

1193 : array
1194 {
1195 $members = [];
1196 // multi-user
1197 if ($this->assignment !== null) {
1198 if (count($this->selected_participants) == 0) {
1199 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
1200 $this->ctrl->redirect($this, "members");
1201 }
1202
1203 foreach ($this->selected_participants as $user_id) {
1204 $submission = new ilExSubmission($this->assignment, $user_id);
1205 $tmembers = $submission->getUserIds();
1206 if (!$a_keep_teams) {
1207 foreach ($tmembers as $tuser_id) {
1208 $members[$tuser_id] = 1;
1209 }
1210 } else {
1211 if ($tmembers) {
1212 $members[] = $tmembers;
1213 } else {
1214 // no team yet
1215 $members[] = $user_id;
1216 }
1217 }
1218 }
1219 }
1220 // multi-ass
1221 else {
1222 if (count($this->selected_ass_ids) == 0) {
1223 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
1224 $this->ctrl->redirect($this, "showParticipant");
1225 }
1226
1228
1229 foreach ($this->selected_ass_ids as $ass_id) {
1230 $submission = new ilExSubmission(new ilExAssignment($ass_id), $user_id);
1231 $tmembers = $submission->getUserIds();
1232 if (!$a_keep_teams) {
1233 foreach ($tmembers as $tuser_id) {
1234 $members[$ass_id][] = $tuser_id;
1235 }
1236 } else {
1237 if ($tmembers) {
1238 $members[$ass_id][] = $tmembers;
1239 } else {
1240 // no team yet
1241 $members[$ass_id][] = $user_id;
1242 }
1243 }
1244 }
1245 }
1246
1247 return $members;
1248 }
Exercise assignment.

References $ass_id, $user_id, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by compareTextAssignmentsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMultiFeedbackForm()

ilExerciseManagementGUI::getMultiFeedbackForm ( int  $a_ass_id)

Definition at line 1714 of file class.ilExerciseManagementGUI.php.

1715 {
1716 $lng = $this->lng;
1717
1718 $form = $this->gui->form([self::class], "uploadMultiFeedback")
1719 ->section("main", ilExAssignment::lookupTitle($a_ass_id))
1720 ->file(
1721 "mfzip",
1722 $lng->txt("exc_multi_feedback_file"),
1723 $this->handleMultiFeedbackUploadResult(...),
1724 "rc_id",
1725 "",
1726 1,
1727 ["application/zip"]
1728 );
1729 return $form;
1730 }
static lookupTitle(int $a_id)

References $lng, and ilExAssignment\lookupTitle().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getReportPanel()

ilExerciseManagementGUI::getReportPanel ( array  $a_data)
Exceptions
ilDateTimeException

Definition at line 689 of file class.ilExerciseManagementGUI.php.

689 : string
690 {
691 $modal = $this->getEvaluationModal($a_data);
692
693 $this->ctrl->setParameter($this, "member_id", $a_data['uid']);
694 $actions = array(
695 $this->ui_factory->button()->shy($this->lng->txt("grade_evaluate"), "#")->withOnClick($modal->getShowSignal())
696 );
697
698 if ($this->exercise->hasTutorFeedbackMail()) {
699 $actions[] = $this->ui_factory->button()->shy(
700 $this->lng->txt("exc_tbl_action_feedback_mail"),
701 $this->ctrl->getLinkTarget($this, "redirectFeedbackMail")
702 );
703 }
704 if ($this->exercise->hasTutorFeedbackFile()) {
705 $actions[] = $this->ui_factory->button()->shy(
706 $this->lng->txt("exc_tbl_action_feedback_file"),
707 $this->ctrl->getLinkTargetByClass(ilResourceCollectionGUI::class)
708 );
709 }
710
711 $this->ctrl->setParameter($this, "member_id", "");
712
713 $actions_dropdown = $this->ui_factory->dropdown()->standard($actions);
714 if ($a_data['status'] == self::GRADE_NOT_GRADED) {
715 $str_status_key = $this->lng->txt('exc_tbl_status') . ": ";
716 $str_status_value = "-";
717 } else {
718 $str_status_key = $this->lng->txt('exc_tbl_status_time') . ": ";
719 $str_status_value = ilDatePresentation::formatDate(new ilDateTime($a_data["status_time"], IL_CAL_DATETIME));
720 }
721
722 $str_mark_key = $this->lng->txt("exc_tbl_mark") . ": ";
723 $str_mark_value = "-";
724
725 if (($a_data['mark'] != "")) {
726 $str_mark_value = $a_data['mark'];
727 }
728
729 if ($a_data['feedback_time']) {
730 $str_evaluation_key = $this->lng->txt('exc_tbl_feedback_time') . ": ";
731 $str_evaluation_value = ilDatePresentation::formatDate(new ilDateTime($a_data["feedback_time"], IL_CAL_DATETIME));
732 } else {
733 $str_evaluation_key = $this->lng->txt('exc_settings_feedback') . ": ";
734 $str_evaluation_value = "-";
735 }
736
737 $card_content = array(
738 $this->lng->txt("exc_tbl_submission_date") . ": " => ilDatePresentation::formatDate(new ilDateTime($a_data["udate"], IL_CAL_DATETIME)),
739 $str_status_key => $str_status_value,
740 $str_mark_key => $str_mark_value,
741 $str_evaluation_key => $str_evaluation_value,
742 $this->lng->txt('feedback_given') . ": " => $a_data['fb_given'],
743 $this->lng->txt('feedback_received') . ": " => $a_data['fb_received']
744 );
745 $card_tpl = new ilTemplate("tpl.exc_report_details_card.html", true, true, "components/ILIAS/Exercise");
746 foreach ($card_content as $key => $value) {
747 $card_tpl->setCurrentBlock("assingment_card");
748 $card_tpl->setVariable("ROW_KEY", $key);
749 $card_tpl->setVariable("ROW_VALUE", $value);
750 $card_tpl->parseCurrentBlock();
751 }
752
753 $main_panel = $this->ui_factory->panel()->sub($a_data['uname'], $this->ui_factory->legacy()->content(
754 $this->gui->html()->escapeCurly($a_data['utext'])
755 ))
756 ->withFurtherInformation($this->ui_factory->card()->standard($this->lng->txt('text_assignment'))->withSections(array($this->ui_factory->legacy()->content($card_tpl->get()))))->withActions($actions_dropdown);
757
758 $feedback_tpl = new ilTemplate("tpl.exc_report_feedback.html", true, true, "components/ILIAS/Exercise");
759 //if no feedback filter the feedback is displayed. Can be list submissions or compare submissions.
760 $filter_feedback = $this->filter["feedback"] ?? "";
761 if (array_key_exists("peer", $a_data) && (($filter_feedback == self::FEEDBACK_FULL_SUBMISSION) || $filter_feedback == "")) {
762 $feedback_tpl->setCurrentBlock("feedback");
763 foreach ($a_data["peer"] as $peer_id) {
764 if (ilObject::_lookupType($peer_id) == "usr") {
765 $user = new ilObjUser($peer_id);
766 $peer_name = $user->getFirstname() . " " . $user->getLastname();
767 } else {
768 $peer_name = $this->lng->txt("exc_deleted_user");
769 }
770
771 $feedback_tpl->setCurrentBlock("peer_feedback");
772 $feedback_tpl->setVariable("PEER_NAME", $peer_name);
773
774 $submission = new ilExSubmission($this->assignment, $a_data["uid"]);
775 $values = $submission->getPeerReview()->getPeerReviewValues($peer_id, $a_data["uid"]);
776
777 $review_html = "";
778 foreach ($this->assignment->getPeerReviewCriteriaCatalogueItems() as $crit) {
779 $crit_id = $crit->getId()
780 ? $crit->getId()
781 : $crit->getType();
782 $crit->setPeerReviewContext($this->assignment, $peer_id, $a_data["uid"]);
783
784 $review_html .=
785 '<div class="ilBlockPropertyCaption">' . $crit->getTitle() . '</div>' .
786 '<div style="margin:2px 0;">' . $crit->getHTML($values[$crit_id] ?? null) . '</div>';
787 }
788 $feedback_tpl->setVariable("PEER_FEEDBACK", $review_html);
789 $feedback_tpl->parseCurrentBlock();
790 }
791 $feedback_tpl->parseCurrentBlock();
792 }
793 $feedback_tpl->setVariable("GRADE", $this->lng->txt('exc_grading') . ": " . $this->lng->txt('exc_' . $a_data['status']));
794 $comment = ($a_data['comment'] === "")
795 ? "-"
796 : $a_data['comment'];
797 $feedback_tpl->setVariable("COMMENT", $this->lng->txt('exc_comment') . ": <br>" . $comment);
798
799 $feedback_panel = $this->ui_factory->panel()->sub("", $this->ui_factory->legacy()->content($feedback_tpl->get()));
800
801 $report = $this->ui_factory->panel()->report("", array($main_panel, $feedback_panel));
802
803 return $this->ui_renderer->render([$modal,$report]);
804 }
$comment
Definition: buildRTE.php:72
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
static _lookupType(int $id, bool $reference=false)

References $comment, $user, ilObject\_lookupType(), ILIAS\Repository\ctrl(), ILIAS\Repository\filter(), ilDatePresentation\formatDate(), getEvaluationModal(), ilObjUser\getFirstname(), ilObjUser\getLastname(), IL_CAL_DATETIME, and ILIAS\Repository\lng().

Referenced by compareTextAssignmentsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewBack()

ilExerciseManagementGUI::getViewBack ( )
protected

Definition at line 280 of file class.ilExerciseManagementGUI.php.

280 : string
281 {
282 switch ($this->request->getBackView()) {
284 $back_cmd = "showParticipant";
285 break;
286
288 $back_cmd = "showGradesOverview";
289 break;
290
291 default:
292 // case self::VIEW_ASSIGNMENT:
293 $back_cmd = "members";
294 break;
295 }
296 return $back_cmd;
297 }

References VIEW_GRADES, and VIEW_PARTICIPANT.

Referenced by initSubmission().

+ Here is the caller graph for this function:

◆ getWebFilePathFromExternalFilePath()

ilExerciseManagementGUI::getWebFilePathFromExternalFilePath ( string  $external_file_path)
protected

Get the object specific file path from an external full file path.

Definition at line 2209 of file class.ilExerciseManagementGUI.php.

2211 : string {
2212 list($external_path, $internal_file_path) = explode(CLIENT_ID . "/ilExercise", $external_file_path);
2213 $internal_file_path = "ilExercise" . $internal_file_path;
2214 return $internal_file_path;
2215 }
const CLIENT_ID
Definition: constants.php:41

◆ handleIndividualDeadlineCallsObject()

ilExerciseManagementGUI::handleIndividualDeadlineCallsObject ( )
protected
Exceptions
ilExcUnknownAssignmentTypeException
ilDateTimeException

Definition at line 1905 of file class.ilExerciseManagementGUI.php.

1905 : void
1906 {
1907 $tpl = $this->tpl;
1908
1909 $this->ctrl->saveParameter($this, "part_id");
1910
1911 // from request "dn", see ilExcIdl.js
1912 if ($this->done) {
1913 $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
1914 $this->ctrl->redirect($this, $this->assignment !== null
1915 ? "members"
1916 : "showParticipant");
1917 }
1918
1919 // initial form call
1920 if ($this->requested_idl_id != "") {
1921 $tmp = $this->parseIndividualDeadlineData(explode(",", $this->requested_idl_id));
1922 if (is_array($tmp)) {
1923 $form = $this->initIndividualDeadlineForm($tmp[1], $tmp[0]);
1924 echo $form->getHTML() .
1926 }
1927 }
1928 // form "submit"
1929 else {
1930 $tmp = array();
1931 $post = $this->http->request()->getParsedBody();
1932 foreach (array_keys($post) as $id) {
1933 if (substr($id, 0, 3) == "dl_") {
1934 $tmp[] = substr($id, 3);
1935 }
1936 }
1937 $tmp = $this->parseIndividualDeadlineData($tmp);
1938 $ass_map = $tmp[1];
1939 $users = $tmp[0];
1940 unset($tmp);
1941
1942 $form = $this->initIndividualDeadlineForm($ass_map, $users);
1943 $res = array();
1944 if ($valid = $form->checkInput()) {
1945 foreach ($users as $ass_id => $users2) {
1946 $ass = $ass_map[$ass_id];
1947
1948 // :TODO: should individual deadlines BEFORE extended be possible?
1949 $dl = new ilDateTime($ass->getDeadline(), IL_CAL_UNIX);
1950
1951 foreach ($users2 as $user_id) {
1952 $date_field = $form->getItemByPostVar("dl_" . $ass_id . "_" . $user_id);
1953 if (ilDate::_before($date_field->getDate(), $dl)) {
1954 $date_field->setAlert(sprintf($this->lng->txt("exc_individual_deadline_before_global"), ilDatePresentation::formatDate($dl)));
1955 $valid = false;
1956 } else {
1957 $res[$ass_id][$user_id] = $date_field->getDate();
1958 }
1959 }
1960 }
1961 }
1962
1963 if (!$valid) {
1964 $form->setValuesByPost();
1965 echo $form->getHTML() .
1967 } else {
1968 foreach ($res as $ass_id => $users) {
1969 $ass = $ass_map[$ass_id];
1970
1971 foreach ($users as $id => $date) {
1972 $ass->setIndividualDeadline($id, $date);
1973 if (is_numeric($id)) {
1974 $this->notification->sendDeadlineSetNotification($ass_id, $id);
1975 }
1976 }
1977
1978 $subm = $this->domain->submission($ass->getId());
1979 $subm->recalculateLateSubmissions();
1980 }
1981
1982 echo "ok";
1983 }
1984 }
1985
1986 exit();
1987 }
const IL_CAL_UNIX
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
initIndividualDeadlineForm(array $a_ass_map, array $ids)
getOnLoadCodeForAsynch()
Get js onload code for ajax calls.
$res
Definition: ltiservices.php:69
$post
Definition: ltitoken.php:46

References $ass_id, $id, $post, $res, $user_id, $valid, ilDateTime\_before(), ILIAS\Repository\ctrl(), exit, ilDatePresentation\formatDate(), ILIAS\UICore\GlobalTemplate\getOnLoadCodeForAsynch(), ILIAS\FileDelivery\http(), IL_CAL_UNIX, ILIAS\Repository\lng(), and ILIAS\UI\examples\Symbol\Glyph\Notification\notification().

+ Here is the call graph for this function:

◆ handleMultiFeedbackUploadResult()

ilExerciseManagementGUI::handleMultiFeedbackUploadResult ( FileUpload  $upload,
UploadResult  $result 
)

Definition at line 1732 of file class.ilExerciseManagementGUI.php.

1736 $feedback_zip = $this->domain->assignment()->tutorFeedbackZip();
1737 $rid = $feedback_zip->importFromUploadResult(
1738 $this->ass_id,
1739 $this->user->getId(),
1740 $result
1741 );
1742 return new \ILIAS\FileUpload\Handler\BasicHandlerResult(
1743 '',
1744 \ILIAS\FileUpload\Handler\HandlerResult::STATUS_OK,
1745 $rid,
1746 ''
1747 );
1748 }
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

◆ initFilter()

ilExerciseManagementGUI::initFilter ( )

Definition at line 2063 of file class.ilExerciseManagementGUI.php.

2063 : void
2064 {
2065 if ($this->requested_filter_status != "") {
2066 $this->filter["status"] = $this->requested_filter_status;
2067 }
2068
2069 $this->lng->loadLanguageModule("search");
2070
2071 $this->toolbar->setFormAction($this->ctrl->getFormAction($this, "listTextAssignment"));
2072
2073 // Status
2074
2075 $si_status = new ilSelectInputGUI($this->lng->txt("exc_tbl_status"), "filter_status");
2076 $options = array(
2077 "" => $this->lng->txt("search_any"),
2078 self::GRADE_NOT_GRADED => $this->lng->txt("exc_notgraded"),
2079 self::GRADE_PASSED => $this->lng->txt("exc_passed"),
2080 self::GRADE_FAILED => $this->lng->txt("exc_failed")
2081 );
2082 $si_status->setOptions($options);
2083 $si_status->setValue($this->filter["status"] ?? "");
2084
2085 $si_feedback = new ilSelectInputGUI($this->lng->txt("feedback"), "filter_feedback");
2086 $options = array(
2087 self::FEEDBACK_FULL_SUBMISSION => $this->lng->txt("submissions_feedback"),
2088 self::FEEDBACK_ONLY_SUBMISSION => $this->lng->txt("submissions_only")
2089 );
2090 $si_feedback->setOptions($options);
2091 $si_feedback->setValue($this->filter["feedback"] ?? "");
2092
2093 $this->toolbar->addInputItem($si_status, true);
2094
2095 // Submissions and Feedback
2096 #24713
2097 if ($this->assignment->getPeerReview()) {
2098 if ($this->requested_filter_feedback != "") {
2099 $this->filter["feedback"] = $this->requested_filter_feedback;
2100 } else {
2101 $this->filter["feedback"] = "submission_feedback";
2102 }
2103
2104 $si_feedback = new ilSelectInputGUI($this->lng->txt("feedback"), "filter_feedback");
2105 $options = array(
2106 "submission_feedback" => $this->lng->txt("submissions_feedback"),
2107 "submission_only" => $this->lng->txt("submissions_only")
2108 );
2109 $si_feedback->setOptions($options);
2110 $si_feedback->setValue($this->filter["feedback"] ?? "");
2111
2112 $this->toolbar->addInputItem($si_feedback, true);
2113 }
2114
2115 $this->gui->button(
2116 $this->lng->txt("filter"),
2117 "listTextAssignment"
2118 )->submit()->toToolbar();
2119 }

References ILIAS\UI\Implementation\Component\Input\Field\$options, ILIAS\Repository\ctrl(), ILIAS\Repository\filter(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

◆ initGroupForm()

ilExerciseManagementGUI::initGroupForm ( )
protected

Definition at line 1572 of file class.ilExerciseManagementGUI.php.

1573 {
1574 $lng = $this->lng;
1575
1576 $form = new ilPropertyFormGUI();
1577 $form->setTitle($lng->txt("exc_adopt_group_teams") . " - " . $this->assignment->getTitle());
1578 $form->setFormAction($this->ctrl->getFormAction($this, "createTeamsFromGroups"));
1579
1580 $all_members = array();
1581 foreach (ilExAssignmentTeam::getGroupMembersMap($this->exercise->getRefId()) as $grp_id => $group) {
1582 if (count($group["members"]) !== 0) {
1583 $grp_team = new ilCheckboxGroupInputGUI($lng->txt("obj_grp") . " \"" . $group["title"] . "\"", "grpt[" . $grp_id . "]");
1584 $grp_value = $options = array();
1585 foreach ($group["members"] as $user_id) {
1586 $user_name = ilUserUtil::getNamePresentation($user_id, false, false, "", true);
1587 $options[$user_id] = $user_name;
1588 if (!in_array($user_id, $all_members)) {
1589 $grp_value[] = $user_id;
1590 $all_members[] = $user_id;
1591 }
1592 }
1593 asort($options);
1594 foreach ($options as $user_id => $user_name) {
1595 $grp_team->addOption(new ilCheckboxOption($user_name, $user_id));
1596 }
1597 $grp_team->setValue($grp_value);
1598 } else {
1599 $grp_team = new ilNonEditableValueGUI($group["title"]);
1600 $grp_team->setValue($lng->txt("exc_adopt_group_teams_no_members"));
1601 }
1602 $form->addItem($grp_team);
1603 }
1604
1605 if ($all_members !== []) {
1606 $form->addCommandButton("createTeamsFromGroups", $lng->txt("save"));
1607 }
1608 $form->addCommandButton("members", $lng->txt("cancel"));
1609
1610 return $form;
1611 }
This class represents a property in a property form.
This class represents an option in a checkbox group.
This class represents a non editable value in a property form.

References $lng, ILIAS\UI\Implementation\Component\Input\Field\$options, $user_id, ILIAS\Repository\ctrl(), ilExAssignmentTeam\getGroupMembersMap(), and ilUserUtil\getNamePresentation().

+ Here is the call graph for this function:

◆ initIndividualDeadlineForm()

ilExerciseManagementGUI::initIndividualDeadlineForm ( array  $a_ass_map,
array  $ids 
)
protected
Exceptions
ilDateTimeException

Definition at line 1992 of file class.ilExerciseManagementGUI.php.

1996 $form = new ilPropertyFormGUI();
1997 $form->setFormAction($this->ctrl->getFormAction($this));
1998 $form->setName("ilExcIDlForm");
1999
2000 foreach ($ids as $ass_id => $users) {
2001 $ass = $a_ass_map[$ass_id];
2002
2003 $section = new ilFormSectionHeaderGUI();
2004 $section->setTitle($ass->getTitle());
2005 $form->addItem($section);
2006
2007 $teams = ilExAssignmentTeam::getInstancesFromMap($ass->getId());
2008
2009 $values = $ass->getIndividualDeadlines();
2010
2011 foreach ($users as $id) {
2012 // single user
2013 if (is_numeric($id)) {
2014 $name = ilObjUser::_lookupName($id);
2015 $name = $name["lastname"] . ", " . $name["firstname"];
2016 }
2017 // team
2018 else {
2019 $name = "";
2020 $team_id = (int) substr($id, 1);
2021 if (array_key_exists($team_id, $teams)) {
2022 $name = array();
2023 foreach ($teams[$team_id]->getMembers() as $member_id) {
2024 $uname = ilObjUser::_lookupName($member_id);
2025 $name[] = $uname["lastname"] . ", " . $uname["firstname"];
2026 }
2027 asort($name);
2028 $name = implode("<br />", $name);
2029 }
2030 }
2031
2032 $dl = new ilDateTimeInputGUI($name, "dl_" . $ass_id . "_" . $id);
2033 $dl->setShowTime(true);
2034 $dl->setRequired(true);
2035 $form->addItem($dl);
2036
2037 if (array_key_exists($id, $values)) {
2038 $dl->setDate(new ilDateTime($values[$id], IL_CAL_UNIX));
2039 }
2040 }
2041 }
2042
2043 $form->addCommandButton("", $this->lng->txt("save"));
2044
2045 return $form;
2046 }
This class represents a date/time property in a property form.
static getInstancesFromMap(int $a_assignment_id)
This class represents a section header in a property form.
static _lookupName(int $a_user_id)

References $ass_id, $id, ilObjUser\_lookupName(), ilExAssignmentTeam\getInstancesFromMap(), IL_CAL_UNIX, and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ initIndividualDeadlineModal()

ilExerciseManagementGUI::initIndividualDeadlineModal ( )
protected

Definition at line 1847 of file class.ilExerciseManagementGUI.php.

1847 : string
1848 {
1849 $lng = $this->lng;
1850 $tpl = $this->tpl;
1851
1852 // prepare modal
1853 $modal = $this->ui_factory->modal()->roundtrip(
1854 $lng->txt("exc_individual_deadline"),
1855 $this->ui_factory->legacy()->content('<div id="ilExcIDlBody"></div>')
1856 );
1857 $show = $modal->getShowSignal()->getId();
1858 $close = $modal->getCloseSignal()->getId();
1859
1860 $ajax_url = $this->ctrl->getLinkTarget($this, "handleIndividualDeadlineCalls", "", true, false);
1861
1862 $tpl->addJavaScript("assets/js/ilExcIDl.js", true, 3);
1863 $tpl->addOnLoadCode("il.ExcIDl.init('" . $ajax_url . "','" . $show . "','" . $close . "');");
1864
1866
1867 return $this->ui_renderer->render($modal);
1868 }
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.

References $lng, ILIAS\UICore\GlobalTemplate\addJavaScript(), ILIAS\UICore\GlobalTemplate\addOnLoadCode(), ILIAS\Repository\ctrl(), and ilCalendarUtil\initDateTimePicker().

+ Here is the call graph for this function:

◆ initSubmission()

ilExerciseManagementGUI::initSubmission ( )
protected

Definition at line 299 of file class.ilExerciseManagementGUI.php.

300 {
301 $back_cmd = $this->getViewBack();
302 $this->ctrl->setReturn($this, $back_cmd);
303
304 $this->tabs_gui->clearTargets();
305 $this->tabs_gui->setBackTarget(
306 $this->lng->txt("back"),
307 $this->ctrl->getLinkTarget($this, $back_cmd)
308 );
309
310 return new ilExSubmission($this->assignment, $this->requested_member_id, null, true);
311 }

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

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ membersApplyObject()

ilExerciseManagementGUI::membersApplyObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 533 of file class.ilExerciseManagementGUI.php.

533 : void
534 {
535 $this->saveStatusAllObject(null, false);
537 $this,
538 "members",
539 $this->exercise,
540 $this->assignment->getId(),
541 $this->feedback_gui
542 );
543 $exc_tab->resetOffset();
544 $exc_tab->writeFilterToSession();
545
546 $this->membersObject();
547 }
saveStatusAllObject(?array $a_selected=null, bool $a_redirect=true)

References membersObject(), and saveStatusAllObject().

+ Here is the call graph for this function:

◆ membersObject()

ilExerciseManagementGUI::membersObject ( )

All participants and submission of one assignment.

Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 367 of file class.ilExerciseManagementGUI.php.

367 : void
368 {
370 $ilToolbar = $this->toolbar;
371 $ilCtrl = $this->ctrl;
373
374 $this->addSubTabs("assignment");
375 $this->gui->permanentLink()->setGradesPermanentLink();
376
377 // assignment selection
378 $ass = ilExAssignment::getInstancesByExercise($this->exercise->getId());
379
380 if ($this->assignment === null && count($ass) > 0) {
381 $this->assignment = current($ass);
382 }
383
384 reset($ass);
385 if (count($ass) > 1) {
386 $options = array();
387 foreach ($ass as $a) {
388 $options[$a->getId()] = $a->getTitle();
389 }
390 $si = new ilSelectInputGUI($this->lng->txt("exc_assignment"), "ass_id");
391 $si->setOptions($options);
392 $si->setValue($this->assignment->getId());
393 $ilToolbar->addStickyItem($si, true);
394 $this->gui->button(
395 $this->lng->txt("select"),
396 "selectAssignment"
397 )->submit()->toToolbar(true);
398
399 $ilToolbar->addSeparator();
400 }
401 // #16165 - if only 1 assignment dropdown is not displayed;
402 elseif ($this->assignment) {
403 $ilCtrl->setParameter($this, "ass_id", $this->assignment->getId());
404 }
405
406 // add member
407 // is only shown if 'edit_submissions_grades' is granted by rbac. positions
408 // access is not sufficient.
409 $has_rbac_access = $GLOBALS['DIC']->access()->checkAccess(
410 'edit_submissions_grades',
411 '',
412 $this->exercise->getRefId()
413 );
414 if ($has_rbac_access) {
416 $this,
417 $ilToolbar,
418 array(
419 'auto_complete_name' => $lng->txt('user'),
420 'submit_name' => $lng->txt('add'),
421 'add_search' => true,
422 'add_from_container' => $this->exercise->getRefId()
423 )
424 );
425 }
426
427 // #16168 - no assignments
428 if ($ass !== []) {
429 if ($has_rbac_access) {
430 $ilToolbar->addSeparator();
431 }
432
433 // we do not want the ilRepositorySearchGUI form action
434 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
435
436 $ilCtrl->setParameter($this, "ass_id", $this->assignment->getId());
437
438 if ($this->assignment->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) {
439 if (ilExAssignmentTeam::getAdoptableGroups($this->exercise->getRefId())) {
440 $ilToolbar->addButton(
441 $this->lng->txt("exc_adopt_group_teams"),
442 $this->ctrl->getLinkTarget($this, "adoptTeamsFromGroup")
443 );
444
445 $ilToolbar->addSeparator();
446 }
447 } elseif ($this->exercise->hasTutorFeedbackFile()) {
448 if (!$this->assignment->getAssignmentType()->usesTeams()) {
449
450 $mem_data = $this->assignment->getMemberListData();
451 if (count($mem_data) > 0) {
452 // multi-feedback
453 $ilToolbar->addButton(
454 $this->lng->txt("exc_multi_feedback"),
455 $this->ctrl->getLinkTarget($this, "showMultiFeedback")
456 );
457
458 $ilToolbar->addSeparator();
459 }
460 }
461 }
462
463 $submission_repository = $this->service->repo()->submission();
464
465 if ($submission_repository->hasSubmissions($this->assignment->getId()) !== 0) {
466 $ass_type = $this->assignment->getType();
467 //todo change addFormButton for addButtonInstance
468 if ($ass_type == ilExAssignment::TYPE_TEXT) {
469 $ilToolbar->addFormButton($lng->txt("exc_list_text_assignment"), "listTextAssignment");
470 }
471 $ilToolbar->addFormButton($lng->txt("download_all_returned_files"), "downloadSubmissions");
472 }
473 $this->ctrl->setParameter($this, "vw", self::VIEW_ASSIGNMENT);
474
476 $this,
477 "members",
478 $this->exercise,
479 $this->assignment->getId(),
480 $this->feedback_gui
481 );
483 $exc_tab->getHTML() .
484 $this->initIndividualDeadlineModal()
485 );
486 } else {
487 $this->tpl->setOnScreenMessage('info', $lng->txt("exc_no_assignments_available"));
488 }
489
490 $ilCtrl->setParameter($this, "ass_id", "0");
491 }
static getAdoptableGroups(int $a_exc_ref_id)
static getInstancesByExercise(int $a_exc_id)
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...
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

References Vendor\Package\$a, $ctrl, $GLOBALS, $lng, ILIAS\UI\Implementation\Component\Input\Field\$options, $toolbar, $tpl, addSubTabs(), ILIAS\Repository\ctrl(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), ilExAssignmentTeam\getAdoptableGroups(), ilExAssignment\getInstancesByExercise(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\setContent(), ilLanguage\txt(), ilExAssignment\TYPE_TEXT, and ilExAssignment\TYPE_UPLOAD_TEAM.

Referenced by membersApplyObject(), membersResetObject(), and waitingDownloadObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ membersResetObject()

ilExerciseManagementGUI::membersResetObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 552 of file class.ilExerciseManagementGUI.php.

552 : void
553 {
555 $this,
556 "members",
557 $this->exercise,
558 $this->assignment->getId(),
559 $this->feedback_gui
560 );
561 $exc_tab->resetOffset();
562 $exc_tab->resetFilter();
563
564 $this->membersObject();
565 }

References membersObject().

+ Here is the call graph for this function:

◆ openSubmissionPrintViewObject()

ilExerciseManagementGUI::openSubmissionPrintViewObject ( )

Open HTML view for portfolio submissions.

Definition at line 2124 of file class.ilExerciseManagementGUI.php.

2124 : void
2125 {
2126 $this->openSubmissionViewObject(true);
2127 }
openSubmissionViewObject(bool $print_version=false)
Open HTML view for portfolio submissions.

◆ openSubmissionViewObject()

ilExerciseManagementGUI::openSubmissionViewObject ( bool  $print_version = false)

Open HTML view for portfolio submissions.

Definition at line 2132 of file class.ilExerciseManagementGUI.php.

2132 : void
2133 {
2134 global $DIC;
2135
2136 $member_id = $this->requested_member_id;
2137
2138 $submission = new ilExSubmission($this->assignment, $member_id);
2139 $entry = $submission->getSubmittedEntry($print_version);
2140 if (is_null($entry)) {
2141 throw new ilExerciseException("No submission entry for " . $this->assignment->getId() . " / " .
2142 $member_id . ".");
2143 }
2144 $rid = $entry->getRid();
2145
2146 $last_opening = $submission->getLastOpeningHTMLView();
2147 $submission_time = $submission->getLastSubmission();
2148
2149 if ($rid !== "") {
2150 $zip_internal_path = "ilExercise/" . \ilFileSystemAbstractionStorage::createPathFromId(
2151 $this->assignment->getExerciseId(),
2152 "exc"
2153 ) . "/subm_" . $this->assignment->getId() . "/" . $member_id . "/resource.zip";
2154 $obj_id = str_replace([".zip", "print"], "", $entry->getTitle());
2155 $obj_id = $this->assignment->getAssignmentType()->getExportObjIdForResourceId($obj_id);
2156 }
2157 if ($print_version) {
2158 $obj_id .= "print";
2159 }
2160
2161 $obj_dir = $this->assignment->getAssignmentType()->getStringIdentifier() . "_" . $obj_id;
2162
2163 $index_html_file =
2165 DIRECTORY_SEPARATOR .
2166 CLIENT_ID .
2167 DIRECTORY_SEPARATOR .
2168 dirname($zip_internal_path) .
2169 //DIRECTORY_SEPARATOR .
2170 //$obj_dir .
2171 DIRECTORY_SEPARATOR .
2172 "index.html";
2173 $this->log->debug("index html file: " . $index_html_file);
2174
2175 $web_filesystem = $DIC->filesystem()->web();
2176 if ($last_opening > $submission_time && $web_filesystem->has($index_html_file)) {
2178 ilUtil::redirect($index_html_file);
2179 }
2180 $error_msg = "";
2181 if ($rid !== "") {
2182 $file_copied = $this->domain->submission($this->ass_id)->copyRidToWebDir($rid, $zip_internal_path);
2183 }
2184
2185 // e.g. data/ilias/ilExercise/3/exc_327/subm_9/2/20231212085734_167.zip ?
2186 if ($file_copied) {
2187 $this->zip->unzipFile($file_copied);
2188 $web_filesystem->delete($zip_internal_path);
2189 $this->log->debug("deleting: " . $zip_internal_path);
2190
2191 $submission_repository = $this->service->repo()->submission();
2192 $submission_repository->updateWebDirAccessTime($this->assignment->getId(), $member_id);
2194 ilUtil::redirect($index_html_file . "?" . time());
2195 }
2196
2197 $error_msg = $this->lng->txt("exc_copy_zip_error");
2198
2199 if ($error_msg === '' || $error_msg === '0') {
2200 $error_msg = $this->lng->txt("exc_find_zip_error");
2201 }
2202
2203 $this->tpl->setOnScreenMessage('failure', $error_msg);
2204 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static createPathFromId(int $a_container_id, string $a_name)
static redirect(string $a_script)
static signFolderOfStartFile(string $start_file_path)
const ILIAS_WEB_DIR
Definition: constants.php:45

References $DIC, CLIENT_ID, ilFileSystemAbstractionStorage\createPathFromId(), ILIAS_WEB_DIR, ILIAS\Repository\lng(), ilUtil\redirect(), and ilWACSignedPath\signFolderOfStartFile().

+ Here is the call graph for this function:

◆ parseIndividualDeadlineData()

ilExerciseManagementGUI::parseIndividualDeadlineData ( array  $a_data)
protected
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 1873 of file class.ilExerciseManagementGUI.php.

1875 : array {
1876 if ($a_data) {
1877 $map = array();
1878 $ass_tmp = array();
1879 foreach ($a_data as $item) {
1880 $item = explode("_", $item);
1881 $ass_id = $item[0];
1882 $user_id = $item[1];
1883
1884 if (!array_key_exists($ass_id, $ass_tmp)) {
1885 if ($this->assignment &&
1886 $ass_id == $this->assignment->getId()) {
1887 $ass_tmp[$ass_id] = $this->assignment;
1888 } else {
1889 $ass_tmp[$ass_id] = new ilExAssignment($ass_id);
1890 }
1891 }
1892
1893 $map[$ass_id][] = $user_id;
1894 }
1895
1896 return array($map, $ass_tmp);
1897 }
1898 return [];
1899 }

References $ass_id, and $user_id.

◆ redirectFeedbackMailObject()

ilExerciseManagementGUI::redirectFeedbackMailObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 1148 of file class.ilExerciseManagementGUI.php.

1148 : void
1149 {
1150 if ($this->requested_member_id > 0) {
1151 $submission = new ilExSubmission($this->assignment, $this->requested_member_id);
1152 $members = $submission->getUserIds();
1153 } elseif ($members = $this->getMultiActionUserIds()) {
1154 $members = array_keys($members);
1155 }
1156
1157 if ($members !== []) {
1158 $logins = array();
1159 foreach ($members as $user_id) {
1160 $member_status = $this->assignment->getMemberStatus($user_id);
1161 $member_status->setFeedback(true);
1162 $member_status->update();
1163
1164 $logins[] = ilObjUser::_lookupLogin($user_id);
1165 }
1166 $logins = implode(",", $logins);
1167
1168 // #16530 - see ilObjCourseGUI::createMailSignature
1169 $sig = chr(13) . chr(10) . chr(13) . chr(10);
1170 $sig .= $this->lng->txt('exc_mail_permanent_link');
1171 $sig .= chr(13) . chr(10) . chr(13) . chr(10);
1172 $sig .= ilLink::_getLink($this->exercise->getRefId());
1173 $sig = rawurlencode(base64_encode($sig));
1174
1176 $this,
1177 $this->getViewBack(),
1178 array(),
1179 array(
1180 'type' => 'new',
1181 'rcp_to' => $logins,
1183 )
1184 ));
1185 }
1186 }
final const string SIGNATURE_KEY
static getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
static _lookupLogin(int $a_user_id)

References $user_id, ilObjUser\_lookupLogin(), ilMailFormCall\getRedirectTarget(), ILIAS\Repository\lng(), ilUtil\redirect(), and ilMailFormCall\SIGNATURE_KEY.

+ Here is the call graph for this function:

◆ saveEvaluationFromModalObject()

ilExerciseManagementGUI::saveEvaluationFromModalObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 888 of file class.ilExerciseManagementGUI.php.

888 : void
889 {
890 $form = $this->getEvaluationModalForm([]);
891 $user_id = 0;
892 $comment = "";
893 $mark = "";
894 $grade = "";
895 if ($form->checkInput()) {
896 $comment = trim($form->getInput('comment'));
897 $user_id = (int) $form->getInput('mem_id');
898 $grade = trim($form->getInput('grade'));
899 $mark = trim($form->getInput('mark'));
900 }
901 if ($this->assignment->getId() && $user_id > 0) {
902 $member_status = $this->assignment->getMemberStatus($user_id);
903 $member_status->setComment(ilUtil::stripSlashes($comment));
904 if ($grade != "") {
905 $member_status->setStatus($grade);
906 }
907 $member_status->setMark($mark);
908 if ($comment != "") {
909 $member_status->setFeedback(true);
910 }
911 $member_status->update();
912 }
913 $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_status_saved"), true);
914 $this->ctrl->redirect($this, "listTextAssignment");
915 }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

References $comment, $user_id, ILIAS\Repository\ctrl(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ saveGradesObject()

ilExerciseManagementGUI::saveGradesObject ( )

Definition at line 567 of file class.ilExerciseManagementGUI.php.

567 : void
568 {
569 $ilCtrl = $this->ctrl;
571
572 foreach ($this->requested_learning_comments as $k => $v) {
573 $marks_obj = new ilLPMarks($this->exercise->getId(), (int) $k);
574 $marks_obj->setComment($v);
575 $marks_obj->update();
576 }
577 foreach ($this->requested_marks as $k => $v) {
578 $marks_obj = new ilLPMarks($this->exercise->getId(), (int) $k);
579 $marks_obj->setMark($v);
580 $marks_obj->update();
581 }
582 $this->tpl->setOnScreenMessage('success', $lng->txt("exc_msg_saved_grades"), true);
583 $ilCtrl->redirect($this, "showGradesOverview");
584 }

References $ctrl, $lng, and ilLanguage\txt().

+ Here is the call graph for this function:

◆ saveMultiFeedbackObject()

ilExerciseManagementGUI::saveMultiFeedbackObject ( )

Save multi feedback.

Definition at line 1828 of file class.ilExerciseManagementGUI.php.

1828 : void
1829 {
1830 $feedback_zip = $this->domain->assignment()->tutorFeedbackZip();
1831 $feedback_zip->saveMultiFeedbackFiles(
1832 $this->exercise,
1833 $this->assignment->getId(),
1834 $this->user->getId(),
1835 $this->requested_files
1836 );
1837
1838 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
1839 $this->ctrl->redirect($this, "members");
1840 }

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

+ Here is the call graph for this function:

◆ saveStatus()

ilExerciseManagementGUI::saveStatus ( array  $a_data,
bool  $a_redirect = true 
)
protected
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 1409 of file class.ilExerciseManagementGUI.php.

1412 : void {
1413 $ilCtrl = $this->ctrl;
1414 $saved_for = array();
1415 foreach ($a_data as $ass_id => $users) {
1416 $ass = ($ass_id < 0)
1417 ? $this->assignment
1418 : new ilExAssignment($ass_id);
1419 foreach ($users as $user_id => $values) {
1420 // this will add team members if available
1421 // $user_id is only the ID of one team member here,
1422 // $sub_user_id will be all team members
1423 $submission = new ilExSubmission($ass, $user_id);
1424 foreach ($submission->getUserIds() as $sub_user_id) {
1425 $uname = ilObjUser::_lookupName($sub_user_id);
1426 $saved_for[$sub_user_id] = $uname["lastname"] . ", " . $uname["firstname"];
1427
1428 $member_status = $ass->getMemberStatus($sub_user_id);
1429
1430 // see bug #22566
1431 $status = $values["status"];
1432 if ($status == "") {
1433 $status = self::GRADE_NOT_GRADED;
1434 }
1435 $member_status->setStatus($status);
1436 if (array_key_exists("mark", $values)) {
1437 $member_status->setMark($values["mark"]);
1438 }
1439 if (array_key_exists("notice", $values)) {
1440 $member_status->setNotice($values["notice"]);
1441 }
1442 $member_status->update();
1443 }
1444 }
1445 }
1446
1447 $save_for_str = "";
1448 if ($saved_for !== []) {
1449 $save_for_str = "(" . implode(" - ", $saved_for) . ")";
1450 }
1451
1452 if ($a_redirect) {
1453 $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_status_saved") . " " . $save_for_str, true);
1454 $ilCtrl->redirect($this, $this->getViewBack());
1455 }
1456 }

◆ saveStatusAllObject()

ilExerciseManagementGUI::saveStatusAllObject ( ?array  $a_selected = null,
bool  $a_redirect = true 
)
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 1355 of file class.ilExerciseManagementGUI.php.

1358 : void {
1359 $user_ids = $this->listed_participants;
1360 $marks = $this->requested_marks;
1362 $status = $this->requested_status;
1363 $filtered_user_ids = $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
1364 'edit_submissions_grades',
1365 'edit_submissions_grades',
1366 $this->exercise->getRefId(),
1367 $user_ids
1368 );
1369
1370 $data = array();
1371 foreach ($filtered_user_ids as $user_id) {
1372 if (is_array($a_selected) &&
1373 !in_array($user_id, $a_selected)) {
1374 continue;
1375 }
1376
1377 $data[-1][$user_id] = array(
1378 "status" => $status[$user_id] ?? null
1379 );
1380
1381 if (isset($marks[$user_id])) {
1382 $data[-1][$user_id]["mark"] = $marks[$user_id];
1383 }
1384 if (isset($notices[$user_id])) {
1385 $data[-1][$user_id]["notice"] = $notices[$user_id];
1386 }
1387 }
1388 $this->saveStatus($data, $a_redirect);
1389 }
saveStatus(array $a_data, bool $a_redirect=true)

Referenced by membersApplyObject().

+ Here is the caller graph for this function:

◆ saveStatusParticipantObject()

ilExerciseManagementGUI::saveStatusParticipantObject ( ?array  $selected_ass_ids = null)

Save assignment status (participant view)

Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 1322 of file class.ilExerciseManagementGUI.php.

1322 : void
1323 {
1324 $ilCtrl = $this->ctrl;
1325
1326 $member_id = $this->requested_part_id;
1327 $data = array();
1328 $marks = $this->requested_marks;
1329 $status = $this->requested_status;
1331 foreach ($this->listed_ass_ids as $ass_id) {
1332 if (is_array($selected_ass_ids) &&
1333 !in_array($ass_id, $selected_ass_ids)) {
1334 continue;
1335 }
1336
1337 $data[$ass_id][$member_id] = array(
1338 "status" => $status[$ass_id] ?? ""
1339 );
1340 if (isset($marks[$ass_id])) {
1341 $data[$ass_id][$member_id]["mark"] = $marks[$ass_id];
1342 }
1343 if (isset($notices[$ass_id])) {
1344 $data[$ass_id][$member_id]["notice"] = $notices[$ass_id];
1345 }
1346 }
1347
1348 $ilCtrl->setParameter($this, "part_id", $member_id); // #17629
1349 $this->saveStatus($data);
1350 }

References $ass_id, and $data.

◆ saveStatusSelectedObject()

ilExerciseManagementGUI::saveStatusSelectedObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 1394 of file class.ilExerciseManagementGUI.php.

1394 : void
1395 {
1396 //$members = $this->getMultiActionUserIds();
1397 if ($this->assignment !== null) {
1398 $this->saveStatusAllObject($this->selected_participants);
1399 } else {
1400 $this->saveStatusParticipantObject($this->selected_ass_ids);
1401 }
1402 }
saveStatusParticipantObject(?array $selected_ass_ids=null)
Save assignment status (participant view)

◆ selectAssignmentObject()

ilExerciseManagementGUI::selectAssignmentObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 965 of file class.ilExerciseManagementGUI.php.

965 : void
966 {
968 $ctrl->setParameter($this, "ass_id", $this->requested_ass_id);
969 $ctrl->redirect($this, "members");
970 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc

References ilCtrl\redirect(), and ilCtrl\setParameter().

+ Here is the call graph for this function:

◆ selectParticipantObject()

ilExerciseManagementGUI::selectParticipantObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 1102 of file class.ilExerciseManagementGUI.php.

1102 : void
1103 {
1105 $ctrl->setParameter($this, "part_id", $this->requested_part_id);
1106 $ctrl->redirect($this, "showParticipant");
1107 }

References ilCtrl\redirect(), and ilCtrl\setParameter().

+ Here is the call graph for this function:

◆ sendGradingNotificationObject()

ilExerciseManagementGUI::sendGradingNotificationObject ( )

Definition at line 2258 of file class.ilExerciseManagementGUI.php.

2258 : void
2259 {
2260
2261 $ass_id = $this->request->getAssId();
2262 $selected_users = $this->request->getSelectedParticipants();
2263
2264 $graded_users = array_filter($selected_users, function ($user_id) {
2265 return $this->assignment->getMemberStatus($user_id)->getStatus() !== "notgraded";
2266 });
2267
2268 if (count($graded_users) === 0) {
2269 $this->tpl->setOnScreenMessage("failure", $this->lng->txt("exc_no_graded_mem_selected"), true);
2270 $this->ctrl->redirect($this, $this->getViewBack());
2271 }
2272
2273 $not = new ilExerciseMailNotification();
2275 $not->setAssignmentId($ass_id);
2276 $not->setObjId($this->exercise->getId());
2277 $not->setRefId($this->exercise->getRefId());
2278 $not->setRecipients($graded_users);
2279 $not->send();
2280 $this->tpl->setOnScreenMessage("success", $this->lng->txt("exc_graded_mem_notified"), true);
2281 $this->ctrl->redirect($this, $this->getViewBack());
2282 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $ass_id, $user_id, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilExerciseMailNotification\TYPE_GRADING_DONE.

+ Here is the call graph for this function:

◆ sendMembersObject()

ilExerciseManagementGUI::sendMembersObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 1255 of file class.ilExerciseManagementGUI.php.

1255 : void
1256 {
1257 $members = $this->getMultiActionUserIds();
1258
1259 $this->tpl->setOnScreenMessage('success', $this->lng->txt("exc_sent"), true);
1260 if ($this->assignment !== null) {
1261 $this->exercise->sendAssignment($this->assignment, array_keys($members));
1262 $this->ctrl->redirect($this, "members");
1263 } else {
1264 foreach ($members as $ass_id => $users) {
1265 $this->exercise->sendAssignment(new ilExAssignment($ass_id), $users);
1266 }
1267 $this->ctrl->setParameter($this, "part_id", $this->requested_part_id); // #17629
1268 $this->ctrl->redirect($this, "showParticipant");
1269 }
1270 }

References $ass_id, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ setBackToMembers()

ilExerciseManagementGUI::setBackToMembers ( )
protected

Definition at line 2220 of file class.ilExerciseManagementGUI.php.

2220 : void
2221 {
2222 //tabs
2223 $this->tabs_gui->clearTargets();
2224 $this->tabs_gui->setBackTarget(
2225 $this->lng->txt("back"),
2226 $this->ctrl->getLinkTarget($this, "members")
2227 );
2228 }

References ILIAS\Repository\lng().

Referenced by compareTextAssignmentsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFailedObject()

ilExerciseManagementGUI::setFailedObject ( )
protected

Definition at line 2284 of file class.ilExerciseManagementGUI.php.

2284 : void
2285 {
2286 $members = $this->getMultiActionUserIds();
2287 $done = false;
2288 if ($this->assignment !== null) {
2289 foreach (array_keys($members) as $mem) {
2290 $done = true;
2291 $this->setSingleStatus($this->assignment->getId(), $mem, "failed");
2292 }
2293 if ($done) {
2294 $this->tpl->setOnScreenMessage("success", $this->lng->txt("msg_obj_modified"), true);
2295 }
2296 }
2297 $this->ctrl->redirect($this, "members");
2298 }
setSingleStatus($ass_id, $part_id, $status)

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

+ Here is the call graph for this function:

◆ setIndividualDeadlineObject()

ilExerciseManagementGUI::setIndividualDeadlineObject ( )
protected
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 2051 of file class.ilExerciseManagementGUI.php.

2051 : void
2052 {
2053 // this will only get called if no selection
2054 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("select_one"));
2055
2056 if ($this->assignment !== null) {
2057 $this->membersObject();
2058 } else {
2059 $this->showParticipantObject();
2060 }
2061 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ setPassedObject()

ilExerciseManagementGUI::setPassedObject ( )
protected

Definition at line 2300 of file class.ilExerciseManagementGUI.php.

2300 : void
2301 {
2302 $members = $this->getMultiActionUserIds();
2303 $done = false;
2304 if ($this->assignment !== null) {
2305 foreach (array_keys($members) as $mem) {
2306 $done = true;
2307 $this->setSingleStatus($this->assignment->getId(), $mem, "passed");
2308 }
2309 if ($done) {
2310 $this->tpl->setOnScreenMessage("success", $this->lng->txt("msg_obj_modified"), true);
2311 }
2312 }
2313 $this->ctrl->redirect($this, "members");
2314 }

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

+ Here is the call graph for this function:

◆ setSingleStatus()

ilExerciseManagementGUI::setSingleStatus (   $ass_id,
  $part_id,
  $status 
)
protected

Definition at line 2316 of file class.ilExerciseManagementGUI.php.

2316 : void
2317 {
2318 $ass = new ilExAssignment($ass_id);
2319 $submission = new ilExSubmission($ass, $part_id);
2320 $member_status = $ass->getMemberStatus($part_id);
2321 $member_status->setStatus($status);
2322 $member_status->update();
2323 }

References $ass_id.

◆ showGradesOverviewObject()

ilExerciseManagementGUI::showGradesOverviewObject ( )

Definition at line 1109 of file class.ilExerciseManagementGUI.php.

1109 : void
1110 {
1111 $tpl = $this->tpl;
1112 $ilToolbar = $this->toolbar;
1113 $ilCtrl = $this->ctrl;
1114 $lng = $this->lng;
1115
1116 $this->addSubTabs("grades");
1117
1118 $mem_obj = new ilExerciseMembers($this->exercise);
1119 $mems = $mem_obj->getMembers();
1120
1121 $mems = $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
1122 'edit_submissions_grades',
1123 'edit_submissions_grades',
1124 $this->exercise->getRefId(),
1125 $mems
1126 );
1127 if (count($mems) > 0) {
1128 $ilToolbar->addButton(
1129 $lng->txt("exc_export_excel"),
1130 $ilCtrl->getLinkTarget($this, "exportExcel")
1131 );
1132 }
1133
1134 $this->ctrl->setParameter($this, "vw", self::VIEW_GRADES);
1135
1136 $grades_tab = new ilExGradesTableGUI(
1137 $this,
1138 "showGradesOverview",
1139 $this->service,
1140 $mem_obj
1141 );
1142 $tpl->setContent($grades_tab->getHTML());
1143 }
Exercise participant table.
Class ilExerciseMembers.

References $GLOBALS, $lng, ILIAS\Repository\ctrl(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ showMultiFeedbackConfirmationTableObject()

ilExerciseManagementGUI::showMultiFeedbackConfirmationTableObject ( )

Show multi feedback confirmation table.

Definition at line 1807 of file class.ilExerciseManagementGUI.php.

1807 : void
1808 {
1809 $tpl = $this->tpl;
1810
1811 $this->addSubTabs("assignment");
1812
1813 $tab = new ilFeedbackConfirmationTable2GUI($this, "showMultiFeedbackConfirmationTable", $this->assignment);
1814 $tpl->setContent($tab->getHTML());
1815 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ showMultiFeedbackObject()

ilExerciseManagementGUI::showMultiFeedbackObject ( ?FormAdapterGUI  $form = null)

Definition at line 1751 of file class.ilExerciseManagementGUI.php.

1753 : void {
1754 $lng = $this->lng;
1755 $tpl = $this->tpl;
1756
1757 $this->tpl->setOnScreenMessage('info', $lng->txt("exc_multi_feedb_info"));
1758
1759 $this->addSubTabs("assignment");
1760
1761 // #13719
1762 $this->gui->button(
1763 $this->lng->txt("exc_download_zip_structure"),
1764 $this->ctrl->getLinkTarget($this, "downloadMultiFeedbackZip")
1765 )->toToolbar();
1766
1767 if ($form === null) {
1768 $form = $this->getMultiFeedbackForm($this->assignment->getId());
1769 }
1770
1771 $tpl->setContent($form->render());
1772 }
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.

◆ showParticipantApplyObject()

ilExerciseManagementGUI::showParticipantApplyObject ( )

Definition at line 1067 of file class.ilExerciseManagementGUI.php.

1067 : void
1068 {
1070 $this,
1071 "showParticipant",
1072 $this->exercise,
1073 $this->requested_part_id,
1074 $this->feedback_gui
1075 );
1076 $exc_tab->resetOffset();
1077 $exc_tab->writeFilterToSession();
1078
1079 $this->showParticipantObject();
1080 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ showParticipantObject()

ilExerciseManagementGUI::showParticipantObject ( )

Show Participant.

Definition at line 975 of file class.ilExerciseManagementGUI.php.

975 : void
976 {
978 $ilToolbar = $this->toolbar;
979 $ilCtrl = $this->ctrl;
982
983 $this->addSubTabs("participant");
984 $this->ctrl->setParameter($this, "ass_id", "0");
985
986 // participant selection
987 $members = $this->exercise->members_obj->getMembers();
988
990 'edit_submissions_grades',
991 'edit_submissions_grades',
992 $this->exercise->getRefId(),
993 $members
994 );
995
996
997 if (count($members) == 0) {
998 $this->tpl->setOnScreenMessage('info', $lng->txt("exc_no_participants"));
999 return;
1000 }
1001
1002 $mems = array();
1003 foreach ($members as $mem_id) {
1004 if (ilObject::_lookupType($mem_id) == "usr") {
1005 $name = ilObjUser::_lookupName($mem_id);
1006 if (trim($name["login"]) != "") { // #20073
1007 $mems[$mem_id] = $name;
1008 }
1009 }
1010 }
1011
1012 $mems = ilArrayUtil::sortArray($mems, "lastname", "asc", false, true);
1013
1014 if ($this->requested_part_id == 0 && $mems !== [] && key($mems) > 0) {
1015 $ilCtrl->setParameter($this, "part_id", key($mems));
1016 $ilCtrl->redirect($this, "showParticipant");
1017 }
1018
1019 $current_participant = $this->requested_part_id;
1020
1021 reset($mems);
1022 if (count($mems) > 1) {
1023 $options = array();
1024 foreach ($mems as $k => $m) {
1025 $options[$k] =
1026 $m["lastname"] . ", " . $m["firstname"] . " [" . $m["login"] . "]";
1027 }
1028 $si = new ilSelectInputGUI($this->lng->txt("exc_participant"), "part_id");
1029 $si->setOptions($options);
1030 $si->setValue($current_participant);
1031 $ilToolbar->addStickyItem($si, true);
1032
1033 $this->gui->button(
1034 $this->lng->txt("select"),
1035 "selectParticipant"
1036 )->submit()->toToolbar(true);
1037 }
1038
1039 if ($mems !== []) {
1040 $this->ctrl->setParameter($this, "vw", self::VIEW_PARTICIPANT);
1041 $this->ctrl->setParameter($this, "part_id", $current_participant);
1042
1043 $ass = ilExAssignment::getInstancesByExercise($this->exercise->getId());
1044
1045 if (count($ass) > 0) {
1046 $ilToolbar->addSeparator();
1047 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1048 $ilToolbar->addFormButton($lng->txt("download_all_returned_files"), "downloadSubmissions");
1049 }
1050
1052 $this,
1053 "showParticipant",
1054 $this->exercise,
1055 $current_participant,
1056 $this->feedback_gui
1057 );
1058 $tpl->setContent($part_tab->getHTML() .
1059 $this->initIndividualDeadlineModal());
1060 } else {
1061 $this->tpl->setOnScreenMessage('info', $this->lng->txt("exc_no_assignments_available"));
1062 }
1063 }
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
filterUserIdsByRbacOrPositionOfCurrentUser(string $rbac_perm, string $pos_perm, int $ref_id, array $user_ids)

References $lng, ILIAS\UI\Implementation\Component\Input\Field\$options, ilObjUser\_lookupName(), ilObject\_lookupType(), ILIAS\Repository\ctrl(), ilOrgUnitPositionAndRBACAccessHandler\filterUserIdsByRbacOrPositionOfCurrentUser(), ilExAssignment\getInstancesByExercise(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\setContent(), and ilArrayUtil\sortArray().

+ Here is the call graph for this function:

◆ showParticipantResetObject()

ilExerciseManagementGUI::showParticipantResetObject ( )

Definition at line 1084 of file class.ilExerciseManagementGUI.php.

1084 : void
1085 {
1087 $this,
1088 "showParticipant",
1089 $this->exercise,
1090 $this->requested_part_id,
1091 $this->feedback_gui
1092 );
1093 $exc_tab->resetOffset();
1094 $exc_tab->resetFilter();
1095
1096 $this->showParticipantObject();
1097 }

◆ uploadMultiFeedbackObject()

ilExerciseManagementGUI::uploadMultiFeedbackObject ( )

Upload multi feedback file.

Definition at line 1793 of file class.ilExerciseManagementGUI.php.

1793 : void
1794 {
1795 // #11983
1796 $form = $this->getMultiFeedbackForm($this->assignment->getId());
1797 if ($form->isValid()) {
1798 $this->ctrl->redirect($this, "showMultiFeedbackConfirmationTable");
1799 }
1800
1801 $this->showMultiFeedbackObject($form);
1802 }
showMultiFeedbackObject(?FormAdapterGUI $form=null)

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ waitingDownloadObject()

ilExerciseManagementGUI::waitingDownloadObject ( )
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 351 of file class.ilExerciseManagementGUI.php.

351 : void
352 {
354 $ilCtrl = $this->ctrl;
355
356 $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "member_id", $this->requested_member_id);
357 $url = $ilCtrl->getLinkTargetByClass(array("ilExerciseHandlerGUI", "ilObjExerciseGUI", "ilExerciseManagementGUI", "ilExSubmissionFileGUI"), "downloadNewReturned");
358 $js_url = $ilCtrl->getLinkTargetByClass(array("ilExerciseHandlerGUI", "ilObjExerciseGUI", "ilExerciseManagementGUI", "ilExSubmissionFileGUI"), "downloadNewReturned", "", "", false);
359 $this->tpl->setOnScreenMessage('info', $lng->txt("exc_wait_for_files") . "<a href='$url'> " . $lng->txt('exc_download_files') . "</a><script>window.location.href ='" . $js_url . "';</script>");
360 $this->membersObject();
361 }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
$url
Definition: shib_logout.php:70

References $ctrl, $lng, $url, membersObject(), ilCtrl\setParameterByClass(), and ilLanguage\txt().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilExerciseManagementGUI::$access
protected

Definition at line 64 of file class.ilExerciseManagementGUI.php.

◆ $ass_id

int ilExerciseManagementGUI::$ass_id = 0
protected

Definition at line 76 of file class.ilExerciseManagementGUI.php.

Referenced by addSubTabs().

◆ $assignment

ilExAssignment ilExerciseManagementGUI::$assignment = null
protected

Definition at line 70 of file class.ilExerciseManagementGUI.php.

◆ $ctrl

ilCtrl ilExerciseManagementGUI::$ctrl
protected

◆ $db

ilDBInterface ilExerciseManagementGUI::$db = null
protected

Definition at line 75 of file class.ilExerciseManagementGUI.php.

◆ $domain

ILIAS Exercise InternalDomainService ilExerciseManagementGUI::$domain
protected

Definition at line 55 of file class.ilExerciseManagementGUI.php.

Referenced by __construct().

◆ $done

bool ilExerciseManagementGUI::$done = false
protected

Definition at line 81 of file class.ilExerciseManagementGUI.php.

◆ $exercise

ilObjExercise ilExerciseManagementGUI::$exercise
protected

Definition at line 69 of file class.ilExerciseManagementGUI.php.

◆ $feedback_gui

ilExerciseSubmissionFeedbackGUI ilExerciseManagementGUI::$feedback_gui
protected

Definition at line 98 of file class.ilExerciseManagementGUI.php.

◆ $filter

array ilExerciseManagementGUI::$filter = []
protected

Definition at line 67 of file class.ilExerciseManagementGUI.php.

◆ $gui

InternalGUIService ilExerciseManagementGUI::$gui
protected

Definition at line 58 of file class.ilExerciseManagementGUI.php.

Referenced by __construct(), and executeCommand().

◆ $http

ILIAS HTTP Services ilExerciseManagementGUI::$http
protected

Definition at line 59 of file class.ilExerciseManagementGUI.php.

◆ $listed_ass_ids

array ilExerciseManagementGUI::$listed_ass_ids
protected

Definition at line 88 of file class.ilExerciseManagementGUI.php.

◆ $listed_participants

array ilExerciseManagementGUI::$listed_participants
protected

Definition at line 86 of file class.ilExerciseManagementGUI.php.

◆ $lng

ilLanguage ilExerciseManagementGUI::$lng
protected

◆ $log

ilLogger ilExerciseManagementGUI::$log
protected

Definition at line 72 of file class.ilExerciseManagementGUI.php.

◆ $notification

ILIAS Exercise Notification NotificationManager ilExerciseManagementGUI::$notification
protected

Definition at line 56 of file class.ilExerciseManagementGUI.php.

◆ $request

GUIRequest ilExerciseManagementGUI::$request
protected

Definition at line 97 of file class.ilExerciseManagementGUI.php.

Referenced by __construct().

◆ $requested_ass_id

int ilExerciseManagementGUI::$requested_ass_id = 0
protected

Definition at line 79 of file class.ilExerciseManagementGUI.php.

◆ $requested_comment

string ilExerciseManagementGUI::$requested_comment
protected

Definition at line 83 of file class.ilExerciseManagementGUI.php.

◆ $requested_files

array ilExerciseManagementGUI::$requested_files
protected

Definition at line 94 of file class.ilExerciseManagementGUI.php.

◆ $requested_filter_feedback

string ilExerciseManagementGUI::$requested_filter_feedback
protected

Definition at line 96 of file class.ilExerciseManagementGUI.php.

◆ $requested_filter_status

string ilExerciseManagementGUI::$requested_filter_status
protected

Definition at line 95 of file class.ilExerciseManagementGUI.php.

◆ $requested_group_members

array ilExerciseManagementGUI::$requested_group_members
protected

Definition at line 92 of file class.ilExerciseManagementGUI.php.

◆ $requested_idl_id

string ilExerciseManagementGUI::$requested_idl_id
protected

Definition at line 80 of file class.ilExerciseManagementGUI.php.

◆ $requested_learning_comments

array ilExerciseManagementGUI::$requested_learning_comments
protected

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

◆ $requested_marks

array ilExerciseManagementGUI::$requested_marks
protected

Definition at line 89 of file class.ilExerciseManagementGUI.php.

◆ $requested_member_id

int ilExerciseManagementGUI::$requested_member_id = 0
protected

Definition at line 77 of file class.ilExerciseManagementGUI.php.

◆ $requested_part_id

int ilExerciseManagementGUI::$requested_part_id = 0
protected

Definition at line 78 of file class.ilExerciseManagementGUI.php.

Referenced by addSubTabs(), and downloadSubmissionsObject().

◆ $requested_status

array ilExerciseManagementGUI::$requested_status
protected

Definition at line 90 of file class.ilExerciseManagementGUI.php.

◆ $requested_tutor_notices

array ilExerciseManagementGUI::$requested_tutor_notices
protected

Definition at line 91 of file class.ilExerciseManagementGUI.php.

◆ $requested_user_login

string ilExerciseManagementGUI::$requested_user_login
protected

Definition at line 84 of file class.ilExerciseManagementGUI.php.

◆ $selected_ass_ids

array ilExerciseManagementGUI::$selected_ass_ids
protected

Definition at line 87 of file class.ilExerciseManagementGUI.php.

◆ $selected_participants

array ilExerciseManagementGUI::$selected_participants
protected

Definition at line 85 of file class.ilExerciseManagementGUI.php.

Referenced by downloadSubmissionsObject().

◆ $service

InternalService ilExerciseManagementGUI::$service
protected

Definition at line 74 of file class.ilExerciseManagementGUI.php.

Referenced by __construct().

◆ $tabs_gui

ilTabsGUI ilExerciseManagementGUI::$tabs_gui
protected

Definition at line 62 of file class.ilExerciseManagementGUI.php.

Referenced by addSubTabs(), and executeCommand().

◆ $task_factory

TaskFactory ilExerciseManagementGUI::$task_factory
protected

Definition at line 71 of file class.ilExerciseManagementGUI.php.

◆ $toolbar

ilToolbarGUI ilExerciseManagementGUI::$toolbar
protected

Definition at line 68 of file class.ilExerciseManagementGUI.php.

Referenced by membersObject().

◆ $tpl

ilGlobalTemplateInterface ilExerciseManagementGUI::$tpl
protected

Definition at line 54 of file class.ilExerciseManagementGUI.php.

Referenced by membersObject().

◆ $tutor_feedback_file

TutorFeedbackFileManager ilExerciseManagementGUI::$tutor_feedback_file
protected

Definition at line 57 of file class.ilExerciseManagementGUI.php.

◆ $ui_factory

Factory ilExerciseManagementGUI::$ui_factory
protected

Definition at line 65 of file class.ilExerciseManagementGUI.php.

◆ $ui_renderer

Renderer ilExerciseManagementGUI::$ui_renderer
protected

Definition at line 66 of file class.ilExerciseManagementGUI.php.

◆ $user

ilObjUser ilExerciseManagementGUI::$user
protected

Definition at line 73 of file class.ilExerciseManagementGUI.php.

Referenced by getReportPanel().

◆ $zip

ZipAdapter ilExerciseManagementGUI::$zip
protected

Definition at line 53 of file class.ilExerciseManagementGUI.php.

◆ FEEDBACK_FULL_SUBMISSION

const ilExerciseManagementGUI::FEEDBACK_FULL_SUBMISSION = "submission_feedback"

Definition at line 48 of file class.ilExerciseManagementGUI.php.

◆ FEEDBACK_ONLY_SUBMISSION

const ilExerciseManagementGUI::FEEDBACK_ONLY_SUBMISSION = "submission_only"

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

◆ GRADE_FAILED

const ilExerciseManagementGUI::GRADE_FAILED = "failed"

Definition at line 52 of file class.ilExerciseManagementGUI.php.

◆ GRADE_NOT_GRADED

const ilExerciseManagementGUI::GRADE_NOT_GRADED = "notgraded"

◆ GRADE_PASSED

const ilExerciseManagementGUI::GRADE_PASSED = "passed"

Definition at line 51 of file class.ilExerciseManagementGUI.php.

◆ VIEW_ASSIGNMENT

const ilExerciseManagementGUI::VIEW_ASSIGNMENT = 1

Definition at line 43 of file class.ilExerciseManagementGUI.php.

◆ VIEW_GRADES

const ilExerciseManagementGUI::VIEW_GRADES = 3

Definition at line 45 of file class.ilExerciseManagementGUI.php.

Referenced by getViewBack().

◆ VIEW_PARTICIPANT

const ilExerciseManagementGUI::VIEW_PARTICIPANT = 2

Definition at line 44 of file class.ilExerciseManagementGUI.php.

Referenced by getViewBack().


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