ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilExerciseManagementGUI Class Reference

Class ilExerciseManagementGUI. More...

+ Collaboration diagram for ilExerciseManagementGUI:

Public Member Functions

 __construct (ilObjExercise $a_exercise, ilExAssignment $a_ass=null)
 Constructor. More...
 
 executeCommand ()
 
 addSubTabs ($a_activate)
 adds tabs to tab gui object More...
 
 waitingDownloadObject ()
 
 membersObject ()
 All participants and submission of one assignment. More...
 
 downloadSubmissionsObject ()
 
 membersApplyObject ()
 
 membersResetObject ()
 
 saveGradesObject ()
 Save grades. More...
 
 listTextAssignmentObject ()
 todo: Pagination. More...
 
 getReportPanel ($a_data)
 
 getEvaluationModal ($a_data)
 
 saveEvaluationFromModalObject ()
 Save assignment submission grade(status) and comment from the roundtrip modal. More...
 
 addUserFromAutoCompleteObject ()
 Add user as member. More...
 
 addMembersObject ($a_user_ids=array())
 Add new partipant. More...
 
 selectAssignmentObject ()
 Select assignment. More...
 
 showParticipantObject ()
 Show Participant. More...
 
 showParticipantApplyObject ()
 
 showParticipantResetObject ()
 
 selectParticipantObject ()
 Select participant. More...
 
 showGradesOverviewObject ()
 Show grades overview. More...
 
 redirectFeedbackMailObject ()
 set feedback status for member and redirect to mail screen More...
 
 downloadAllObject ()
 Download all submitted files (of all members). More...
 
 sendMembersObject ()
 Send assignment per mail to participants. More...
 
 confirmDeassignMembersObject ()
 Confirm deassigning members. More...
 
 deassignMembersObject ()
 Deassign members from exercise. More...
 
 saveCommentsObject ()
 
 saveStatusParticipantObject (array $a_selected=null)
 Save assignment status (participant view) More...
 
 saveStatusAllObject (array $a_selected=null, $a_redirect=true)
 
 saveStatusSelectedObject ()
 
 saveCommentForLearnersObject ()
 Save comment for learner (asynch) More...
 
 exportExcelObject ()
 Export as excel. More...
 
 createTeamsObject ()
 
 dissolveTeamsObject ()
 
 adoptTeamsFromGroupObject (ilPropertyFormGUI $a_form=null)
 
 createTeamsFromGroupsObject ()
 
 initMultiFeedbackForm ($a_ass_id)
 
 showMultiFeedbackObject (ilPropertyFormGUI $a_form=null)
 Show multi-feedback screen. More...
 
 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 ()
 

Data Fields

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

Protected Member Functions

 getViewBack ()
 
 initSubmission ()
 
 getMultiActionUserIds ($a_keep_teams=false)
 
 saveStatus (array $a_data, $a_redirect=true)
 Save status of selecte members. More...
 
 initGroupForm ()
 
 initIndividualDeadlineModal ()
 
 parseIndividualDeadlineData (array $a_data)
 
 handleIndividualDeadlineCallsObject ()
 
 initIndividualDeadlineForm (array $a_ass_map, array $ids)
 
 setIndividualDeadlineObject ()
 

Protected Attributes

 $ctrl
 
 $tabs_gui
 
 $lng
 
 $tpl
 
 $ui_factory
 
 $ui_renderer
 
 $filter
 
 $toolbar
 
 $exercise
 
 $assignment
 
 $task_factory
 
 $user
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilExerciseManagementGUI::__construct ( ilObjExercise  $a_exercise,
ilExAssignment  $a_ass = null 
)

Constructor.

Parameters
int$a_exercise_id
Returns
object

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

References $DIC, ilObject\getId(), and user().

88  {
89  global $DIC;
90 
91  $this->ui_factory = $DIC->ui()->factory();
92  $this->ui_renderer = $DIC->ui()->renderer();
93  $this->user = $DIC->user();
94  $this->toolbar = $DIC->toolbar();
95 
96  $this->ctrl = $DIC->ctrl();
97  $this->tabs_gui = $DIC->tabs();
98  $this->lng = $DIC->language();
99  $this->tpl = $DIC["tpl"];
100 
101  $this->task_factory = $DIC->backgroundTasks()->taskFactory();
102 
103 
104  $this->exercise = $a_exercise;
105  if ($a_ass) {
106  $this->assignment = $a_ass;
107  $this->ass_id = $this->assignment->getId();
108  }
109 
110  $this->ctrl->saveParameter($this, array("vw", "member_id"));
111  }
global $DIC
Definition: saml.php:7
getId()
Get assignment id.
user()
Definition: user.php:4
+ Here is the call graph for this function:

Member Function Documentation

◆ addMembersObject()

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

Add new partipant.

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

References ilUtil\sendFailure().

Referenced by addUserFromAutoCompleteObject().

831  {
832  if (!count($a_user_ids)) {
833  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
834  return false;
835  }
836 
837  if (!$this->exercise->members_obj->assignMembers($a_user_ids)) {
838  ilUtil::sendFailure($this->lng->txt("exc_members_already_assigned"));
839  return false;
840  } else {
841  /* #16921
842  // #9946 - create team for new user(s) for each team upload assignment
843  foreach(ilExAssignment::getInstancesByExercise($this->exercise->getId()) as $ass)
844  {
845  if($ass->hasTeam())
846  {
847  include_once "Modules/Exercise/classes/class.ilExAssignmentTeam.php";
848  foreach($a_user_ids as $user_id)
849  {
850  // #15915
851  ilExAssignmentTeam::getTeamId($ass->getId(), $user_id, true);
852  }
853  }
854  }
855  */
856 
857  ilUtil::sendSuccess($this->lng->txt("exc_members_assigned"), true);
858  }
859 
860  $this->ctrl->redirect($this, "members");
861  return true;
862  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSubTabs()

ilExerciseManagementGUI::addSubTabs (   $a_activate)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

References $_GET, $ctrl, $ilCtrl, $lng, and $tabs_gui.

Referenced by executeCommand(), membersObject(), showGradesOverviewObject(), showMultiFeedbackConfirmationTableObject(), showMultiFeedbackObject(), and showParticipantObject().

273  {
274  $ilTabs = $this->tabs_gui;
275  $lng = $this->lng;
277 
278  $ass_id = $_GET["ass_id"];
279  $part_id = $_GET["part_id"];
280 
281  $ilCtrl->setParameter($this, "vw", "");
282  $ilCtrl->setParameter($this, "member_id", "");
283  $ilCtrl->setParameter($this, "ass_id", "");
284  $ilCtrl->setParameter($this, "part_id", "");
285 
286  $ilTabs->addSubTab(
287  "assignment",
288  $lng->txt("exc_assignment_view"),
289  $ilCtrl->getLinkTarget($this, "members")
290  );
291  $ilTabs->addSubTab(
292  "participant",
293  $lng->txt("exc_participant_view"),
294  $ilCtrl->getLinkTarget($this, "showParticipant")
295  );
296  $ilTabs->addSubTab(
297  "grades",
298  $lng->txt("exc_grades_overview"),
299  $ilCtrl->getLinkTarget($this, "showGradesOverview")
300  );
301  $ilTabs->activateSubTab($a_activate);
302 
303  $ilCtrl->setParameter($this, "ass_id", $ass_id);
304  $ilCtrl->setParameter($this, "part_id", $part_id);
305  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ addUserFromAutoCompleteObject()

ilExerciseManagementGUI::addUserFromAutoCompleteObject ( )

Add user as member.

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

References $_POST, $user, $users, ilObjUser\_lookupId(), addMembersObject(), membersObject(), and ilUtil\sendFailure().

800  {
801  if (!strlen(trim($_POST['user_login']))) {
802  ilUtil::sendFailure($this->lng->txt('msg_no_search_string'));
803  $this->membersObject();
804  return false;
805  }
806  $users = explode(',', $_POST['user_login']);
807 
808  $user_ids = array();
809  foreach ($users as $user) {
810  $user_id = ilObjUser::_lookupId($user);
811 
812  if (!$user_id) {
813  ilUtil::sendFailure($this->lng->txt('user_not_known'));
814  return $this->membersObject();
815  }
816 
817  $user_ids[] = $user_id;
818  }
819 
820  if (!$this->addMembersObject($user_ids)) {
821  $this->membersObject();
822  return false;
823  }
824  return true;
825  }
addMembersObject($a_user_ids=array())
Add new partipant.
static _lookupId($a_user_str)
Lookup id by login.
$users
Definition: authpage.php:44
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
membersObject()
All participants and submission of one assignment.
$_POST["username"]
+ Here is the call graph for this function:

◆ adoptTeamsFromGroupObject()

ilExerciseManagementGUI::adoptTeamsFromGroupObject ( ilPropertyFormGUI  $a_form = null)

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

References $ctrl, $ilCtrl, $lng, $tabs_gui, $tpl, getViewBack(), and initGroupForm().

Referenced by createTeamsFromGroupsObject().

1531  {
1532  $ilCtrl = $this->ctrl;
1533  $ilTabs = $this->tabs_gui;
1534  $lng = $this->lng;
1535  $tpl = $this->tpl;
1536 
1537  $ilTabs->clearTargets();
1538  $ilTabs->setBackTarget(
1539  $lng->txt("back"),
1540  $ilCtrl->getLinkTarget($this, $this->getViewBack())
1541  );
1542 
1543  if (!$a_form) {
1544  $a_form = $this->initGroupForm();
1545  }
1546  $tpl->setContent($a_form->getHTML());
1547  }
global $ilCtrl
Definition: ilias.php:18
+ 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 1795 of file class.ilExerciseManagementGUI.php.

1796  {
1797  $this->assignment->clearMultiFeedbackDirectory();
1798  $this->ctrl->redirect($this, "members");
1799  }

◆ confirmDeassignMembersObject()

ilExerciseManagementGUI::confirmDeassignMembersObject ( )

Confirm deassigning members.

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

References $ctrl, $ilCtrl, $lng, $m, $tpl, getMultiActionUserIds(), and ilUserUtil\getNamePresentation().

1203  {
1204  $ilCtrl = $this->ctrl;
1205  $tpl = $this->tpl;
1206  $lng = $this->lng;
1207 
1208  $members = $this->getMultiActionUserIds();
1209 
1210  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1211  $cgui = new ilConfirmationGUI();
1212  $cgui->setFormAction($ilCtrl->getFormAction($this));
1213  $cgui->setHeaderText($lng->txt("exc_msg_sure_to_deassign_participant"));
1214  $cgui->setCancel($lng->txt("cancel"), "members");
1215  $cgui->setConfirm($lng->txt("remove"), "deassignMembers");
1216 
1217  include_once("./Services/User/classes/class.ilUserUtil.php");
1218  foreach ($members as $k => $m) {
1219  $cgui->addItem(
1220  "member[$k]",
1221  $m,
1222  ilUserUtil::getNamePresentation((int) $k, false, false, "", true)
1223  );
1224  }
1225 
1226  $tpl->setContent($cgui->getHTML());
1227  }
global $ilCtrl
Definition: ilias.php:18
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
Confirmation screen class.
+ Here is the call graph for this function:

◆ createTeamsFromGroupsObject()

ilExerciseManagementGUI::createTeamsFromGroupsObject ( )

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

References $_POST, $form, $input, $lng, $map, $valid, adoptTeamsFromGroupObject(), ilExAssignmentTeam\getAssignmentTeamMap(), ilExAssignmentTeam\getGroupMembersMap(), ilExAssignmentTeam\getInstanceByUserId(), ilUserUtil\getNamePresentation(), initGroupForm(), and ilUtil\sendFailure().

1595  {
1596  $lng = $this->lng;
1597 
1598  $form = $this->initGroupForm();
1599  if ($form->checkInput()) {
1600  include_once "Services/User/classes/class.ilUserUtil.php";
1601  $map = ilExAssignmentTeam::getGroupMembersMap($this->exercise->getRefId());
1602  $all_members = $teams = array();
1603  $valid = true;
1604  foreach (array_keys($map) as $grp_id) {
1605  $postvar = "grpt_" . $grp_id;
1606  $members = $_POST[$postvar];
1607  if (is_array($members)) {
1608  $teams[] = $members;
1609  $invalid_team_members = array();
1610 
1611  foreach ($members as $user_id) {
1612  if (!array_key_exists($user_id, $all_members)) {
1613  $all_members[$user_id] = $grp_id;
1614  } else {
1615  // user is selected in multiple groups
1616  $invalid_team_members[] = $user_id;
1617  }
1618  }
1619 
1620  if (sizeof($invalid_team_members)) {
1621  $valid = false;
1622 
1623  $alert = array();
1624  foreach ($invalid_team_members as $user_id) {
1625  $user_name = ilUserUtil::getNamePresentation($user_id, false, false, "", true);
1626  $grp_title = $map[$all_members[$user_id]]["title"];
1627  $alert[] = sprintf($lng->txt("exc_adopt_group_teams_conflict"), $user_name, $grp_title);
1628  }
1629  $input = $form->getItemByPostVar($postvar);
1630  $input->setAlert(implode("<br/>", $alert));
1631  }
1632  }
1633  }
1634  if ($valid) {
1635  if (sizeof($teams)) {
1636  $existing_users = array_keys(ilExAssignmentTeam::getAssignmentTeamMap($this->assignment->getId()));
1637 
1638  // create teams from group selections
1639  $sum = array("added" => 0, "blocked" => 0);
1640  foreach ($teams as $members) {
1641  foreach ($members as $user_id) {
1642  if (!$this->exercise->members_obj->isAssigned($user_id)) {
1643  $this->exercise->members_obj->assignMember($user_id);
1644  }
1645 
1646  if (!in_array($user_id, $existing_users)) {
1647  $sum["added"]++;
1648  } else {
1649  $sum["blocked"]++;
1650  }
1651  }
1652 
1653  $first = array_shift($members);
1654  $team = ilExAssignmentTeam::getInstanceByUserId($this->assignment->getId(), $first, true);
1655 
1656  // getTeamId() does NOT send notification
1657  // $team->sendNotification($this->exercise->getRefId(), $first, "add");
1658 
1659  if (sizeof($members)) {
1660  foreach ($members as $user_id) {
1661  $team->addTeamMember($user_id);
1662  }
1663  }
1664  }
1665 
1666  $mess = array();
1667  if ($sum["added"]) {
1668  $mess[] = sprintf($lng->txt("exc_adopt_group_teams_added"), $sum["added"]);
1669  }
1670  if ($sum["blocked"]) {
1671  $mess[] = sprintf($lng->txt("exc_adopt_group_teams_blocked"), $sum["blocked"]);
1672  }
1673  if ($sum["added"]) {
1674  ilUtil::sendSuccess(implode(" ", $mess), true);
1675  } else {
1676  ilUtil::sendFailure(implode(" ", $mess), true);
1677  }
1678  }
1679  $this->ctrl->redirect($this, "members");
1680  } else {
1681  ilUtil::sendFailure($lng->txt("form_input_not_valid"));
1682  }
1683  }
1684 
1685  $form->setValuesByPost();
1687  }
static getGroupMembersMap($a_exc_ref_id)
static getAssignmentTeamMap($a_ass_id)
Get team structure for assignment.
$valid
if(isset($_POST['submit'])) $form
static getInstanceByUserId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
adoptTeamsFromGroupObject(ilPropertyFormGUI $a_form=null)
$_POST["username"]
+ Here is the call graph for this function:

◆ createTeamsObject()

ilExerciseManagementGUI::createTeamsObject ( )

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

References $ctrl, $ilCtrl, ilExAssignmentTeam\getInstanceByUserId(), and getMultiActionUserIds().

1450  {
1451  $ilCtrl = $this->ctrl;
1452 
1453  $members = $this->getMultiActionUserIds(true);
1454 
1455  $new_members = array();
1456 
1457  include_once "Modules/Exercise/classes/class.ilExAssignmentTeam.php";
1458  foreach ($members as $group) {
1459  if (is_array($group)) {
1460  $new_members = array_merge($new_members, $group);
1461 
1462  $first_user = $group;
1463  $first_user = array_shift($first_user);
1464  $team = ilExAssignmentTeam::getInstanceByUserId($this->assignment->getId(), $first_user);
1465  foreach ($group as $user_id) {
1466  $team->removeTeamMember($user_id);
1467  }
1468  } else {
1469  $new_members[] = $group;
1470  }
1471  }
1472 
1473  if (sizeof($new_members)) {
1474  // see ilExSubmissionTeamGUI::addTeamMemberActionObject()
1475 
1476  $first_user = array_shift($new_members);
1477  $team = ilExAssignmentTeam::getInstanceByUserId($this->assignment->getId(), $first_user, true);
1478  if (sizeof($new_members)) {
1479  foreach ($new_members as $user_id) {
1480  $team->addTeamMember($user_id);
1481  }
1482  }
1483 
1484  // re-evaluate complete team, as some members might have had submitted
1485  $submission = new ilExSubmission($this->assignment, $first_user);
1486  $this->exercise->processExerciseStatus(
1487  $this->assignment,
1488  $team->getMembers(),
1489  $submission->hasSubmitted(),
1490  $submission->validatePeerReviews()
1491  );
1492  }
1493 
1494  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1495  $ilCtrl->redirect($this, "members");
1496  }
global $ilCtrl
Definition: ilias.php:18
static getInstanceByUserId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
+ Here is the call graph for this function:

◆ deassignMembersObject()

ilExerciseManagementGUI::deassignMembersObject ( )

Deassign members from exercise.

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

References $ctrl, $ilCtrl, $lng, and getMultiActionUserIds().

1233  {
1234  $ilCtrl = $this->ctrl;
1235  $lng = $this->lng;
1236 
1237  $members = $this->getMultiActionUserIds();
1238 
1239  foreach (array_keys($members) as $usr_id) {
1240  $this->exercise->members_obj->deassignMember((int) $usr_id);
1241  }
1242  ilUtil::sendSuccess($lng->txt("exc_msg_participants_removed"), true);
1243  $ilCtrl->redirect($this, "members");
1244  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ dissolveTeamsObject()

ilExerciseManagementGUI::dissolveTeamsObject ( )

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

References $ctrl, $ilCtrl, ilExAssignmentTeam\getInstanceByUserId(), and getMultiActionUserIds().

1499  {
1500  $ilCtrl = $this->ctrl;
1501 
1502  $members = $this->getMultiActionUserIds(true);
1503 
1504  include_once "Modules/Exercise/classes/class.ilExAssignmentTeam.php";
1505  foreach ($members as $group) {
1506  // if single member - nothing to do
1507  if (is_array($group)) {
1508  // see ilExSubmissionTeamGUI::removeTeamMemberObject()
1509 
1510  $first_user = $group;
1511  $first_user = array_shift($first_user);
1512  $team = ilExAssignmentTeam::getInstanceByUserId($this->assignment->getId(), $first_user);
1513  foreach ($group as $user_id) {
1514  $team->removeTeamMember($user_id);
1515  }
1516 
1517  // reset ex team members, as any submission is not valid without team
1518  $this->exercise->processExerciseStatus(
1519  $this->assignment,
1520  $group,
1521  false
1522  );
1523  }
1524  }
1525 
1526  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1527  $ilCtrl->redirect($this, "members");
1528  }
global $ilCtrl
Definition: ilias.php:18
static getInstanceByUserId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
+ Here is the call graph for this function:

◆ downloadAllObject()

ilExerciseManagementGUI::downloadAllObject ( )

Download all submitted files (of all members).

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

References $name, ilObject\_exists(), ilExSubmission\downloadAllAssignmentFiles(), and ilObjectFactory\getInstanceByObjId().

1086  {
1087  $members = array();
1088 
1089  foreach ($this->exercise->members_obj->getMembers() as $member_id) {
1090  $submission = new ilExSubmission($this->assignment, $member_id);
1091  $submission->updateTutorDownloadTime();
1092 
1093  // get member object (ilObjUser)
1094  if (ilObject::_exists($member_id)) {
1095  $storage_id = "";
1096  // adding file metadata
1097  foreach ($submission->getFiles() as $file) {
1098  if ($this->assignment->getAssignmentType()->isSubmissionAssignedToTeam()) {
1099  $storage_id = $file["team_id"];
1100  } else {
1101  $storage_id = $file["user_id"];
1102  }
1103 
1104  $members[$storage_id]["files"][$file["returned_id"]] = $file;
1105  }
1106  if ($this->assignment->getAssignmentType()->isSubmissionAssignedToTeam()) {
1107  $name = "Team " . $submission->getTeam()->getId();
1108  } else {
1109  $tmp_obj = ilObjectFactory::getInstanceByObjId($member_id);
1110  $name = $tmp_obj->getFirstname() . " " . $tmp_obj->getLastname();
1111  }
1112  if ($storage_id > 0) {
1113  $members[$storage_id]["name"] = $name;
1114  }
1115  unset($tmp_obj);
1116  }
1117  }
1118 
1119  ilExSubmission::downloadAllAssignmentFiles($this->assignment, $members);
1120  }
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
static downloadAllAssignmentFiles(ilExAssignment $a_ass, array $members, $to_path)
Download all submitted files of an assignment (all user)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
+ Here is the call graph for this function:

◆ downloadMultiFeedbackZipObject()

ilExerciseManagementGUI::downloadMultiFeedbackZipObject ( )

Download multi-feedback structrue file.

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

1750  {
1751  $this->assignment->sendMultiFeedbackStructureFile($this->exercise);
1752  }

◆ downloadSubmissionsObject()

ilExerciseManagementGUI::downloadSubmissionsObject ( )

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

References $GLOBALS, and user().

447  {
448  include_once './Modules/Exercise/classes/BackgroundTasks/class.ilDownloadSubmissionsBackgroundTask.php';
449 
450  $participant_id = $_REQUEST['part_id'];
451 
452  $download_task = new ilDownloadSubmissionsBackgroundTask(
453  (int) $GLOBALS['DIC']->user()->getId(),
454  (int) $this->exercise->getRefId(),
455  (int) $this->exercise->getId(),
456  (int) $this->ass_id,
457  (int) $participant_id
458  );
459 
460  if ($download_task->run()) {
461  ilUtil::sendSuccess($this->lng->txt('exc_down_files_started_bg'), true);
462  }
463 
464  if ($this->assignment) {
465  $this->ctrl->redirect($this, "members");
466  } else {
467  $this->ctrl->redirect($this, "showParticipant");
468  }
469  }
user()
Definition: user.php:4
Download submissions and feedback for exercises.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ executeCommand()

ilExerciseManagementGUI::executeCommand ( )

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

References $_GET, $ctrl, $GLOBALS, $ilCtrl, $lng, $tabs_gui, addSubTabs(), ilFSStorageExercise\create(), ilUserUtil\getNamePresentation(), getViewBack(), initSubmission(), ilUtil\sendInfo(), and ilFileSystemGUI\setTableId().

114  {
116  $lng = $this->lng;
117  $ilTabs = $this->tabs_gui;
118 
119  $class = $ilCtrl->getNextClass($this);
120  //$cmd = $ilCtrl->getCmd("listPublicSubmissions");
121 
122  switch ($class) {
123  case "ilfilesystemgui":
124  $ilTabs->clearTargets();
125  $ilTabs->setBackTarget(
126  $lng->txt("back"),
127  $ilCtrl->getLinkTarget($this, $this->getViewBack())
128  );
129 
130  ilUtil::sendInfo($lng->txt("exc_fb_tutor_info"));
131 
132  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
133  $fstorage = new ilFSStorageExercise($this->exercise->getId(), $this->assignment->getId());
134  $fstorage->create();
135 
136  $submission = new ilExSubmission($this->assignment, (int) $_GET["member_id"]);
137  $feedback_id = $submission->getFeedbackId();
138  $noti_rec_ids = $submission->getUserIds();
139 
140  include_once("./Services/User/classes/class.ilUserUtil.php");
141  $fs_title = array();
142  foreach ($noti_rec_ids as $rec_id) {
143  $fs_title[] = ilUserUtil::getNamePresentation($rec_id, false, false, "", true);
144  }
145  $fs_title = implode(" / ", $fs_title);
146 
147  include_once("./Services/FileSystem/classes/class.ilFileSystemGUI.php");
148  $fs_gui = new ilFileSystemGUI($fstorage->getFeedbackPath($feedback_id));
149  $fs_gui->setTableId("excfbfil" . $this->assignment->getId() . "_" . $feedback_id);
150  $fs_gui->setAllowDirectories(false);
151  $fs_gui->setTitle($lng->txt("exc_fb_files") . " - " .
152  $this->assignment->getTitle() . " - " .
153  $fs_title);
154  $pcommand = $fs_gui->getLastPerformedCommand();
155  if (is_array($pcommand) && $pcommand["cmd"] == "create_file") {
156  foreach ($noti_rec_ids as $user_id) {
157  $member_status = $this->assignment->getMemberStatus($user_id);
158  $member_status->setFeedback(true);
159  $member_status->update();
160  }
161 
162  $this->exercise->sendFeedbackFileNotification(
163  $pcommand["name"],
164  $noti_rec_ids,
165  $this->assignment->getId()
166  );
167  }
168  $this->ctrl->forwardCommand($fs_gui);
169  break;
170 
171  case 'ilrepositorysearchgui':
172  include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
173  $rep_search = new ilRepositorySearchGUI();
174  $ref_id = $this->exercise->getRefId();
175  $rep_search->addUserAccessFilterCallable(function ($a_user_ids) use ($ref_id) {
176  return $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
177  'edit_submissions_grades',
178  'edit_submissions_grades',
179  $ref_id,
180  $a_user_ids
181  );
182  });
183  $rep_search->setTitle($this->lng->txt("exc_add_participant"));
184  $rep_search->setCallback($this, 'addMembersObject');
185 
186  // Set tabs
187  $this->addSubTabs("assignment");
188  $this->ctrl->setReturn($this, 'members');
189 
190  $this->ctrl->forwardCommand($rep_search);
191  break;
192 
193  case "ilexsubmissionteamgui":
194  include_once "Modules/Exercise/classes/class.ilExSubmissionTeamGUI.php";
195  $gui = new ilExSubmissionTeamGUI($this->exercise, $this->initSubmission());
196  $ilCtrl->forwardCommand($gui);
197  break;
198 
199  case "ilexsubmissionfilegui":
200  include_once "Modules/Exercise/classes/class.ilExSubmissionFileGUI.php";
201  $gui = new ilExSubmissionFileGUI($this->exercise, $this->initSubmission());
202  $ilCtrl->forwardCommand($gui);
203  break;
204 
205  case "ilexsubmissiontextgui":
206  $ilCtrl->saveParameter($this, array("part_id"));
207  include_once "Modules/Exercise/classes/class.ilExSubmissionTextGUI.php";
208  $gui = new ilExSubmissionTextGUI($this->exercise, $this->initSubmission());
209  $ilCtrl->forwardCommand($gui);
210  break;
211 
212  case "ilexpeerreviewgui":
213  include_once "Modules/Exercise/classes/class.ilExPeerReviewGUI.php";
214  $gui = new ilExPeerReviewGUI($this->assignment, $this->initSubmission());
215  $ilCtrl->forwardCommand($gui);
216  break;
217 
218  default:
219  $cmd = $ilCtrl->getCmd();
220  switch ($cmd) {
221  case 'downloadSubmissions':
222  $cmd = $ilCtrl->getCmd("downloadSubmissions");
223  break;
224  default:
225  $cmd = $ilCtrl->getCmd("listPublicSubmissions");
226  break;
227  }
228  $this->{$cmd . "Object"}();
229  break;
230  }
231  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setTableId($a_val)
Set table id.
addSubTabs($a_activate)
adds tabs to tab gui object
Class ilExPeerReviewGUI.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
File System Explorer GUI class.
Object-based submissions (ends up as static file)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ exportExcelObject()

ilExerciseManagementGUI::exportExcelObject ( )

Export as excel.

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

References exit.

1439  {
1440  $this->exercise->exportGradesExcel();
1441  exit;
1442  }
exit
Definition: backend.php:16

◆ getEvaluationModal()

ilExerciseManagementGUI::getEvaluationModal (   $a_data)

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

References $form, $id, PHPMailer\PHPMailer\$options, $si, $text, ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilTextInputGUI\setValue(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

Referenced by getReportPanel().

706  {
707  $modal_tpl = new ilTemplate("tpl.exc_report_evaluation_modal.html", true, true, "Modules/Exercise");
708  $modal_tpl->setVariable("USER_NAME", $a_data['uname']);
709 
710  $form = new ilPropertyFormGUI();
711  $form->setFormAction($this->ctrl->getFormAction($this, "saveEvaluationFromModal"));
712  $form->setId(uniqid('form'));
713 
714  //Grade
715  $options = array(
716  self::GRADE_NOT_GRADED => $this->lng->txt("exc_notgraded"),
717  self::GRADE_PASSED => $this->lng->txt("exc_passed"),
718  self::GRADE_FAILED => $this->lng->txt("exc_failed")
719  );
720  $si = new ilSelectInputGUI($this->lng->txt("exc_tbl_status"), "grade");
721  $si->setOptions($options);
722  $si->setValue($a_data['status']);
723  $form->addItem($si);
724 
725  //Mark
726  $mark_input = new ilTextInputGUI($this->lng->txt("exc_tbl_mark"), "mark");
727  $mark_input->setValue($a_data['mark']);
728  $mark_input->setMaxLength(32);
729  $mark_input->setSize(4);
730  $form->addItem($mark_input);
731 
732  $item = new ilHiddenInputGUI('mem_id');
733  $item->setValue($a_data['uid']);
734  $form->addItem($item);
735 
736  //TODO: CHECK ilias string utils. ilUtil shortenText with net blank.
737  if ($this->exercise->hasTutorFeedbackText()) {
738  $max_chars = 500;
739 
740  $u_text = strip_tags($a_data["utext"]); //otherwise will get open P
741  $text = $u_text;
742  //show more
743  if (strlen($u_text) > $max_chars) {
744  $text = "<input type='checkbox' class='read-more-state' id='post-1' />";
745  $text .= "<div class='read-more-wrap'>";
746  $text .= mb_substr($u_text, 0, $max_chars);
747  $text .= "<span class='read-more-target'>";
748  $text .= mb_substr($u_text, $max_chars);
749  $text .= "</span></div>";
750  $text .= "<label for='post-1' class='read-more-trigger'></label>";
751  }
752  $modal_tpl->setVariable("USER_TEXT", $text);
753 
754  $ta = new ilTextAreaInputGUI($this->lng->txt("exc_comment"), 'comment');
755  $ta->setInfo($this->lng->txt("exc_comment_for_learner_info"));
756  $ta->setValue($a_data['comment']);
757  $ta->setRows(10);
758  $form->addItem($ta);
759  }
760 
761  $modal_tpl->setVariable("FORM", $form->getHTML());
762 
763  $form_id = 'form_' . $form->getId();
764  $submit_btn = $this->ui_factory->button()->primary($this->lng->txt("save"), '#')
765  ->withOnLoadCode(function ($id) use ($form_id) {
766  return "$('#{$id}').click(function() { $('#{$form_id}').submit(); return false; });";
767  });
768 
769  return $this->ui_factory->modal()->roundtrip(strtoupper($this->lng->txt("grade_evaluate")), $this->ui_factory->legacy($modal_tpl->get()))->withActionButtons([$submit_btn]);
770  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
if(!array_key_exists('StateId', $_REQUEST)) $id
setInfo($a_info)
Set Information Text.
This class represents a hidden form property in a property form.
if(isset($_POST['submit'])) $form
special template class to simplify handling of ITX/PEAR
$text
Definition: errorreport.php:18
This class represents a text property in a property form.
setOptions($a_options)
Set Options.
This class represents a text area property in a property form.
setValue($a_value)
Set Value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMultiActionUserIds()

ilExerciseManagementGUI::getMultiActionUserIds (   $a_keep_teams = false)
protected

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

References $_GET, $_POST, and ilUtil\sendFailure().

Referenced by confirmDeassignMembersObject(), createTeamsObject(), deassignMembersObject(), dissolveTeamsObject(), redirectFeedbackMailObject(), saveStatusSelectedObject(), and sendMembersObject().

1123  {
1124  // multi-user
1125  if ($this->assignment) {
1126  if (!$_POST["member"]) {
1127  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
1128  $this->ctrl->redirect($this, "members");
1129  }
1130 
1131  foreach (array_keys($_POST["member"]) as $user_id) {
1132  $submission = new ilExSubmission($this->assignment, $user_id);
1133  $tmembers = $submission->getUserIds();
1134  if (!(bool) $a_keep_teams) {
1135  foreach ($tmembers as $tuser_id) {
1136  $members[$tuser_id] = 1;
1137  }
1138  } else {
1139  if ($tmembers) {
1140  $members[] = $tmembers;
1141  } else {
1142  // no team yet
1143  $members[] = $user_id;
1144  }
1145  }
1146  }
1147  }
1148  // multi-ass
1149  else {
1150  if (!$_POST["ass"]) {
1151  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
1152  $this->ctrl->redirect($this, "showParticipant");
1153  }
1154 
1155  $user_id = $_GET["part_id"];
1156 
1157  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
1158  foreach (array_keys($_POST["ass"]) as $ass_id) {
1159  $submission = new ilExSubmission(new ilExAssignment($ass_id), $user_id);
1160  $tmembers = $submission->getUserIds();
1161  if (!(bool) $a_keep_teams) {
1162  foreach ($tmembers as $tuser_id) {
1163  $members[$ass_id][] = $tuser_id;
1164  }
1165  } else {
1166  if ($tmembers) {
1167  $members[$ass_id][] = $tmembers;
1168  } else {
1169  // no team yet
1170  $members[$ass_id][] = $user_id;
1171  }
1172  }
1173  }
1174  }
1175 
1176  return $members;
1177  }
Exercise assignment.
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getReportPanel()

ilExerciseManagementGUI::getReportPanel (   $a_data)

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

References $key, $user, $values, ilObject\_lookupType(), ilDatePresentation\formatDate(), getEvaluationModal(), and IL_CAL_DATETIME.

Referenced by listTextAssignmentObject().

596  {
597  $modal = $this->getEvaluationModal($a_data);
598 
599  $this->ctrl->setParameter($this, "member_id", $a_data['uid']);
600  $actions = array(
601  $this->ui_factory->button()->shy($this->lng->txt("grade_evaluate"), "#")->withOnClick($modal->getShowSignal())
602  );
603  if ($this->exercise->hasTutorFeedbackMail()) {
604  $actions[] = $this->ui_factory->button()->shy(
605  $this->lng->txt("exc_tbl_action_feedback_mail"),
606  $this->ctrl->getLinkTarget($this, "redirectFeedbackMail")
607  );
608  }
609  if ($this->exercise->hasTutorFeedbackFile()) {
610  $actions[] = $this->ui_factory->button()->shy(
611  $this->lng->txt("exc_tbl_action_feedback_file"),
612  $this->ctrl->getLinkTargetByClass("ilFileSystemGUI", "listFiles")
613  );
614  }
615 
616  $this->ctrl->setParameter($this, "member_id", "");
617 
618  $actions_dropdown = $this->ui_factory->dropdown()->standard($actions);
619 
620  if ($a_data['status'] == self::GRADE_NOT_GRADED) {
621  $str_status_key = $this->lng->txt('exc_tbl_status');
622  $str_status_value = $this->lng->txt('not_yet');
623  } else {
624  $str_status_key = $this->lng->txt('exc_tbl_status_time');
625  $str_status_value = ilDatePresentation::formatDate(new ilDateTime($a_data["status_time"], IL_CAL_DATETIME));
626  }
627 
628  $str_mark_key = $this->lng->txt("exc_tbl_mark");
629  $str_mark_value = $this->lng->txt('not_yet');
630 
631  if (($a_data['mark'] != "")) {
632  $str_mark_value = $a_data['mark'];
633  }
634 
635  if ($a_data['feedback_time']) {
636  $str_evaluation_key = $this->lng->txt('exc_tbl_feedback_time');
637  $str_evaluation_value = ilDatePresentation::formatDate(new ilDateTime($a_data["feedback_time"], IL_CAL_DATETIME));
638  } else {
639  $str_evaluation_key = $this->lng->txt('exc_settings_feedback');
640  $str_evaluation_value = $this->lng->txt('not_yet');
641  }
642 
643  $card_content = array(
644  $this->lng->txt("exc_tbl_submission_date") => ilDatePresentation::formatDate(new ilDateTime($a_data["udate"], IL_CAL_DATETIME)),
645  $str_status_key => $str_status_value,
646  $str_mark_key => $str_mark_value,
647  $str_evaluation_key => $str_evaluation_value,
648  $this->lng->txt('feedback_given') => $a_data['fb_given'],
649  $this->lng->txt('feedback_received') => $a_data['fb_received']
650  );
651  $card_tpl = new ilTemplate("tpl.exc_report_details_card.html", true, true, "Modules/Exercise");
652  foreach ($card_content as $key => $value) {
653  $card_tpl->setCurrentBlock("assingment_card");
654  $card_tpl->setVariable("ROW_KEY", $key);
655  $card_tpl->setVariable("ROW_VALUE", $value);
656  $card_tpl->parseCurrentBlock();
657  }
658 
659  $main_panel = $this->ui_factory->panel()->sub($a_data['uname'], $this->ui_factory->legacy($a_data['utext']))
660  ->withCard($this->ui_factory->card()->standard($this->lng->txt('text_assignment'))->withSections(array($this->ui_factory->legacy($card_tpl->get()))))->withActions($actions_dropdown);
661 
662  $feedback_tpl = new ilTemplate("tpl.exc_report_feedback.html", true, true, "Modules/Exercise");
663  if (array_key_exists("peer", $a_data) && $this->filter["feedback"] == "submission_feedback") {
664  $feedback_tpl->setCurrentBlock("feedback");
665  foreach ($a_data["peer"] as $peer_id) {
666  if (ilObject::_lookupType($peer_id) == "usr") {
667  $user = new ilObjUser($peer_id);
668  $peer_name = $user->getFirstname() . " " . $user->getLastname();
669  } else {
670  $peer_name = $this->lng->txt("exc_deleted_user");
671  }
672 
673  $feedback_tpl->setCurrentBlock("peer_feedback");
674  $feedback_tpl->setVariable("PEER_NAME", $peer_name);
675 
676  $submission = new ilExSubmission($this->assignment, $a_data["uid"]);
677  $values = $submission->getPeerReview()->getPeerReviewValues($peer_id, $a_data["uid"]);
678 
679  $review_html = "";
680  foreach ($this->assignment->getPeerReviewCriteriaCatalogueItems() as $crit) {
681  $crit_id = $crit->getId()
682  ? $crit->getId()
683  : $crit->getType();
684  $crit->setPeerReviewContext($this->assignment, $peer_id, $a_data["uid"]);
685 
686  $review_html .=
687  '<div class="ilBlockPropertyCaption">' . $crit->getTitle() . '</div>' .
688  '<div style="margin:2px 0;">' . $crit->getHTML($values[$crit_id]) . '</div>';
689  }
690  $feedback_tpl->setVariable("PEER_FEEDBACK", $review_html);
691  $feedback_tpl->parseCurrentBlock();
692  }
693  $feedback_tpl->parseCurrentBlock();
694  }
695  $feedback_tpl->setVariable("GRADE", $this->lng->txt('grade') . ": " . $this->lng->txt('exc_' . $a_data['status']));
696  $feedback_tpl->setVariable("COMMENT", $this->lng->txt('exc_comment') . "<br>" . $a_data['comment']);
697 
698  $feedback_panel = $this->ui_factory->panel()->sub("", $this->ui_factory->legacy($feedback_tpl->get()));
699 
700  $report = $this->ui_factory->panel()->report("", array($main_panel, $feedback_panel));
701 
702  return $this->ui_renderer->render([$modal,$report]);
703  }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
$values
special template class to simplify handling of ITX/PEAR
Date and time handling
static _lookupType($a_id, $a_reference=false)
lookup object type
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewBack()

ilExerciseManagementGUI::getViewBack ( )
protected

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

Referenced by adoptTeamsFromGroupObject(), executeCommand(), initSubmission(), redirectFeedbackMailObject(), and saveStatus().

234  {
235  switch ($_REQUEST["vw"]) {
236  case self::VIEW_PARTICIPANT:
237  $back_cmd = "showParticipant";
238  break;
239 
240  case self::VIEW_GRADES:
241  $back_cmd = "showGradesOverview";
242  break;
243 
244  default:
245  // case self::VIEW_ASSIGNMENT:
246  $back_cmd = "members";
247  break;
248  }
249  return $back_cmd;
250  }
+ Here is the caller graph for this function:

◆ handleIndividualDeadlineCallsObject()

ilExerciseManagementGUI::handleIndividualDeadlineCallsObject ( )
protected

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

References $_GET, $_POST, $form, $id, $res, $tpl, $users, $valid, ilDateTime\_before(), exit, ilDatePresentation\formatDate(), IL_CAL_UNIX, initIndividualDeadlineForm(), and parseIndividualDeadlineData().

1868  {
1869  $tpl = $this->tpl;
1870 
1871  $this->ctrl->saveParameter($this, "part_id");
1872 
1873  // we are done
1874  if ((bool) $_GET["dn"]) {
1875  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
1876  $this->ctrl->redirect($this, $this->assignment
1877  ? "members"
1878  : "showParticipant");
1879  }
1880 
1881  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
1882 
1883  // initial form call
1884  if ($_GET["idlid"]) {
1885  $tmp = $this->parseIndividualDeadlineData(explode(",", $_GET["idlid"]));
1886  if (is_array($tmp)) {
1887  $form = $this->initIndividualDeadlineForm($tmp[1], $tmp[0]);
1888  echo $form->getHTML() .
1889  $tpl->getOnLoadCodeForAsynch();
1890  }
1891  }
1892  // form "submit"
1893  else {
1894  $tmp = array();
1895  foreach (array_keys($_POST) as $id) {
1896  if (substr($id, 0, 3) == "dl_") {
1897  $tmp[] = substr($id, 3);
1898  }
1899  }
1900  $tmp = $this->parseIndividualDeadlineData($tmp);
1901  $ass_map = $tmp[1];
1902  $users = $tmp[0];
1903  unset($tmp);
1904 
1905  $form = $this->initIndividualDeadlineForm($ass_map, $users);
1906  $res = array();
1907  if ($valid = $form->checkInput()) {
1908  foreach ($users as $ass_id => $users) {
1909  $ass = $ass_map[$ass_id];
1910 
1911  // :TODO: should individual deadlines BEFORE extended be possible?
1912  $dl = new ilDateTime($ass->getDeadline(), IL_CAL_UNIX);
1913 
1914  foreach ($users as $user_id) {
1915  $date_field = $form->getItemByPostVar("dl_" . $ass_id . "_" . $user_id);
1916  if (ilDate::_before($date_field->getDate(), $dl)) {
1917  $date_field->setAlert(sprintf($this->lng->txt("exc_individual_deadline_before_global"), ilDatePresentation::formatDate($dl)));
1918  $valid = false;
1919  } else {
1920  $res[$ass_id][$user_id] = $date_field->getDate();
1921  }
1922  }
1923  }
1924  }
1925 
1926  if (!$valid) {
1927  $form->setValuesByPost();
1928  echo $form->getHTML() .
1929  $tpl->getOnLoadCodeForAsynch();
1930  } else {
1931  foreach ($res as $ass_id => $users) {
1932  $ass = $ass_map[$ass_id];
1933 
1934  foreach ($users as $id => $date) {
1935  $ass->setIndividualDeadline($id, $date);
1936  }
1937 
1938  $ass->recalculateLateSubmissions();
1939  }
1940 
1941  echo "ok";
1942  }
1943  }
1944 
1945  exit();
1946  }
$_GET["client_id"]
$valid
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
if(!array_key_exists('StateId', $_REQUEST)) $id
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
foreach($_POST as $key=> $value) $res
if(isset($_POST['submit'])) $form
Date and time handling
$users
Definition: authpage.php:44
exit
Definition: backend.php:16
$_POST["username"]
initIndividualDeadlineForm(array $a_ass_map, array $ids)
+ Here is the call graph for this function:

◆ initFilter()

ilExerciseManagementGUI::initFilter ( )

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

References $_POST, PHPMailer\PHPMailer\$options, ilSubmitButton\getInstance(), ilSelectInputGUI\setOptions(), and ilUtil\stripSlashes().

Referenced by listTextAssignmentObject().

2018  {
2019  $this->lng->loadLanguageModule("search");
2020 
2021  $this->toolbar->setFormAction($this->ctrl->getFormAction($this, "listTextAssignment"));
2022 
2023  // Status
2024 
2025  if ($_POST["filter_status"]) {
2026  $this->filter["status"] = trim(ilUtil::stripSlashes($_POST["filter_status"]));
2027  }
2028 
2029  $si_status = new ilSelectInputGUI($this->lng->txt("exc_tbl_status"), "filter_status");
2030  $options = array(
2031  "" => $this->lng->txt("search_any"),
2032  self::GRADE_NOT_GRADED => $this->lng->txt("exc_notgraded"),
2033  self::GRADE_PASSED => $this->lng->txt("exc_passed"),
2034  self::GRADE_FAILED => $this->lng->txt("exc_failed")
2035  );
2036  $si_status->setOptions($options);
2037  $si_status->setValue($this->filter["status"]);
2038 
2039  $this->toolbar->addInputItem($si_status, true);
2040 
2041  // Submissions and Feedback
2042  #24713
2043  if ($this->assignment->getPeerReview()) {
2044  if ($_POST["filter_feedback"]) {
2045  $this->filter["feedback"] = trim(ilUtil::stripSlashes($_POST["filter_feedback"]));
2046  } else {
2047  $this->filter["feedback"] = "submission_feedback";
2048  }
2049 
2050  $si_feedback = new ilSelectInputGUI($this->lng->txt("feedback"), "filter_feedback");
2051  $options = array(
2052  "submission_feedback" => $this->lng->txt("submissions_feedback"),
2053  "submission_only" => $this->lng->txt("submissions_only")
2054  );
2055  $si_feedback->setOptions($options);
2056  $si_feedback->setValue($this->filter["feedback"]);
2057 
2058  $this->toolbar->addInputItem($si_feedback, true);
2059  }
2060 
2061  //todo: old school here.
2062  include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
2063  $submit = ilSubmitButton::getInstance();
2064  $submit->setCaption("filter");
2065  $submit->setCommand("listTextAssignment");
2066  $this->toolbar->addButtonInstance($submit);
2067  }
This class represents a selection list property in a property form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setOptions($a_options)
Set Options.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initGroupForm()

ilExerciseManagementGUI::initGroupForm ( )
protected

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

References $form, $lng, PHPMailer\PHPMailer\$options, ilExAssignmentTeam\getGroupMembersMap(), and ilUserUtil\getNamePresentation().

Referenced by adoptTeamsFromGroupObject(), and createTeamsFromGroupsObject().

1550  {
1551  $lng = $this->lng;
1552 
1553  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1554  $form = new ilPropertyFormGUI();
1555  $form->setTitle($lng->txt("exc_adopt_group_teams") . " - " . $this->assignment->getTitle());
1556  $form->setFormAction($this->ctrl->getFormAction($this, "createTeamsFromGroups"));
1557 
1558  include_once "Modules/Exercise/classes/class.ilExAssignmentTeam.php";
1559  include_once "Services/User/classes/class.ilUserUtil.php";
1560  $all_members = array();
1561  foreach (ilExAssignmentTeam::getGroupMembersMap($this->exercise->getRefId()) as $grp_id => $group) {
1562  if (sizeof($group["members"])) {
1563  $grp_team = new ilCheckboxGroupInputGUI($lng->txt("obj_grp") . " \"" . $group["title"] . "\"", "grpt_" . $grp_id);
1564  $grp_value = $options = array();
1565  foreach ($group["members"] as $user_id) {
1566  $user_name = ilUserUtil::getNamePresentation($user_id, false, false, "", true);
1567  $options[$user_id] = $user_name;
1568  if (!in_array($user_id, $all_members)) {
1569  $grp_value[] = $user_id;
1570  $all_members[] = $user_id;
1571  }
1572  }
1573  asort($options);
1574  foreach ($options as $user_id => $user_name) {
1575  $grp_team->addOption(new ilCheckboxOption($user_name, $user_id));
1576  }
1577  $grp_team->setValue($grp_value);
1578  $form->addItem($grp_team);
1579  } else {
1580  $grp_team = new ilNonEditableValueGUI($group["title"]);
1581  $grp_team->setValue($lng->txt("exc_adopt_group_teams_no_members"));
1582  $form->addItem($grp_team);
1583  }
1584  }
1585 
1586  if (sizeof($all_members)) {
1587  $form->addCommandButton("createTeamsFromGroups", $lng->txt("save"));
1588  }
1589  $form->addCommandButton("members", $lng->txt("cancel"));
1590 
1591  return $form;
1592  }
This class represents an option in a checkbox group.
static getGroupMembersMap($a_exc_ref_id)
This class represents a property form user interface.
if(isset($_POST['submit'])) $form
This class represents a property in a property form.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
This class represents a non editable value in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initIndividualDeadlineForm()

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

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

References $form, $id, $name, $section, $users, $values, ilObjUser\_lookupName(), ilExAssignmentTeam\getInstancesFromMap(), and IL_CAL_UNIX.

Referenced by handleIndividualDeadlineCallsObject().

1949  {
1950  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
1951  $form = new ilPropertyFormGUI();
1952  $form->setFormAction($this->ctrl->getFormAction($this));
1953  $form->setName("ilExcIDlForm");
1954 
1955  include_once "Services/User/classes/class.ilUserUtil.php";
1956  foreach ($ids as $ass_id => $users) {
1957  $ass = $a_ass_map[$ass_id];
1958 
1960  $section->setTitle($ass->getTitle());
1961  $form->addItem($section);
1962 
1963  include_once("./Modules/Exercise/classes/class.ilExAssignmentTeam.php");
1964  $teams = ilExAssignmentTeam::getInstancesFromMap($ass->getId());
1965 
1966  $values = $ass->getIndividualDeadlines();
1967 
1968  foreach ($users as $id) {
1969  // single user
1970  if (is_numeric($id)) {
1972  $name = $name["lastname"] . ", " . $name["firstname"];
1973  }
1974  // team
1975  else {
1976  $name = "";
1977  $team_id = (int) substr($id, 1);
1978  if (array_key_exists($team_id, $teams)) {
1979  $name = array();
1980  foreach ($teams[$team_id]->getMembers() as $member_id) {
1981  $uname = ilObjUser::_lookupName($member_id);
1982  $name[] = $uname["lastname"] . ", " . $uname["firstname"];
1983  }
1984  asort($name);
1985  $name = implode("<br />", $name);
1986  }
1987  }
1988 
1989  $dl = new ilDateTimeInputGUI($name, "dl_" . $ass_id . "_" . $id);
1990  $dl->setShowTime(true);
1991  $dl->setRequired(true);
1992  $form->addItem($dl);
1993 
1994  if (array_key_exists($id, $values)) {
1995  $dl->setDate(new ilDateTime($values[$id], IL_CAL_UNIX));
1996  }
1997  }
1998  }
1999 
2000  $form->addCommandButton("", $this->lng->txt("save"));
2001 
2002  return $form;
2003  }
static _lookupName($a_user_id)
lookup user name
This class represents a property form user interface.
static getInstancesFromMap($a_assignment_id)
This class represents a section header in a property form.
if(!array_key_exists('StateId', $_REQUEST)) $id
const IL_CAL_UNIX
This class represents a date/time property in a property form.
$section
Definition: Utf8Test.php:83
if(isset($_POST['submit'])) $form
$values
Date and time handling
$users
Definition: authpage.php:44
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initIndividualDeadlineModal()

ilExerciseManagementGUI::initIndividualDeadlineModal ( )
protected

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

References $lng, $tpl, ilModalGUI\getInstance(), and ilCalendarUtil\initDateTimePicker().

Referenced by membersObject(), and showParticipantObject().

1818  {
1819  $lng = $this->lng;
1820  $tpl = $this->tpl;
1821 
1822  // prepare modal+
1823  include_once "./Services/UIComponent/Modal/classes/class.ilModalGUI.php";
1824  $modal = ilModalGUI::getInstance();
1825  $modal->setHeading($lng->txt("exc_individual_deadline"));
1826  $modal->setId("ilExcIDl");
1827  $modal->setBody('<div id="ilExcIDlBody"></div>');
1828  $modal = $modal->getHTML();
1829 
1830  $ajax_url = $this->ctrl->getLinkTarget($this, "handleIndividualDeadlineCalls", "", true, false);
1831 
1832  $tpl->addJavaScript("./Modules/Exercise/js/ilExcIDl.js", true, 3);
1833  $tpl->addOnloadCode('il.ExcIDl.init("' . $ajax_url . '");');
1834 
1835  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
1837 
1838  return $modal;
1839  }
static getInstance()
Get instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMultiFeedbackForm()

ilExerciseManagementGUI::initMultiFeedbackForm (   $a_ass_id)

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

References $form, $lng, ilExAssignment\lookupTitle(), and ilFileInputGUI\setSuffixes().

Referenced by showMultiFeedbackObject(), and uploadMultiFeedbackObject().

1695  {
1696  $lng = $this->lng;
1697 
1698  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1699  $form = new ilPropertyFormGUI();
1700  $form->addCommandButton("uploadMultiFeedback", $lng->txt("upload"));
1701  $form->addCommandButton("members", $lng->txt("cancel"));
1702 
1703  // multi feedback file
1704  $fi = new ilFileInputGUI($lng->txt("exc_multi_feedback_file"), "mfzip");
1705  $fi->setSuffixes(array("zip"));
1706  $fi->setRequired(true);
1707  $form->addItem($fi);
1708 
1709  $form->setTitle(ilExAssignment::lookupTitle($a_ass_id));
1710  $form->setFormAction($this->ctrl->getFormAction($this, "uploadMultiFeedback"));
1711 
1712  return $form;
1713  }
This class represents a property form user interface.
This class represents a file property in a property form.
if(isset($_POST['submit'])) $form
setSuffixes($a_suffixes)
Set Accepted Suffixes.
static lookupTitle($a_id)
Lookup title.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSubmission()

ilExerciseManagementGUI::initSubmission ( )
protected

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

References getViewBack().

Referenced by executeCommand().

253  {
254  $back_cmd = $this->getViewBack();
255  $this->ctrl->setReturn($this, $back_cmd);
256 
257  $this->tabs_gui->clearTargets();
258  $this->tabs_gui->setBackTarget(
259  $this->lng->txt("back"),
260  $this->ctrl->getLinkTarget($this, $back_cmd)
261  );
262 
263  include_once "Modules/Exercise/classes/class.ilExSubmission.php";
264  return new ilExSubmission($this->assignment, $_REQUEST["member_id"], null, true);
265  }
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listTextAssignmentObject()

ilExerciseManagementGUI::listTextAssignmentObject ( )

todo: Pagination.

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

References $data, $id, $user, ilObject\_exists(), ilRTE\_replaceMediaObjectImageSrc(), ilExerciseMembersFilter\filterParticipantsByAccess(), ilExSubmission\getAssignmentFilesByUsers(), ilExSubmission\getAssignmentParticipants(), getReportPanel(), initFilter(), user(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

521  {
522  $this->initFilter();
523 
524  //tabs
525  $this->tabs_gui->clearTargets();
526  $this->tabs_gui->setBackTarget(
527  $this->lng->txt("back"),
528  $this->ctrl->getLinkTarget($this, "members")
529  );
530 
531  $button_print = $this->ui_factory->button()->standard($this->lng->txt('print'), "#")
532  ->withOnLoadCode(function ($id) {
533  return "$('#{$id}').click(function() { window.print(); return false; });";
534  });
535  $this->toolbar->addSeparator();
536  $this->toolbar->addComponent($button_print);
537 
538  //retrieve data
539  $peer_review = new ilExPeerReview($this->assignment);
540  $peer_data = $peer_review->getAllPeerReviews();
541 
542  include_once "Services/User/classes/class.ilUserUtil.php";
543  include_once "Services/RTE/classes/class.ilRTE.php";
544 
545  $report_html = "";
546  //TODO create proper title.
547  $report_title = $this->lng->txt("exc_list_text_assignment") . ": " . $this->assignment->getTitle();
548  $report_html .= "<h1>" . $report_title . "</h1>";
549  $total_reports = 0;
550 
551  $members = ilExSubmission::getAssignmentParticipants($this->exercise->getId(), $this->ass_id);
552  $members_filter = new ilExerciseMembersFilter($this->exercise->getRefId(), $members, $this->user->getId());
553  $members = $members_filter->filterParticipantsByAccess();
554 
555  foreach (ilExSubmission::getAssignmentFilesByUsers($this->exercise->getId(), $this->assignment->getId(), $members) as $file) {
556  if (trim($file["atext"]) && ilObjUser::_exists($file["user_id"])) {
557  $user = new ilObjUser($file["user_id"]);
558  $uname = $user->getFirstname() . " " . $user->getLastname();
559  $data = array(
560  "uid" => $file["user_id"],
561  "uname" => $uname,
562  "udate" => $file["ts"],
563  "utext" => ilRTE::_replaceMediaObjectImageSrc($file["atext"], 1) // mob id to mob src
564  );
565 
566  if (isset($peer_data[$file["user_id"]])) {
567  $data["peer"] = array_keys($peer_data[$file["user_id"]]);
568  }
569 
570  $data["fb_received"] = (is_array($data["peer"]))
571  ? count($data["peer"])
572  : 0;
573  $data["fb_given"] = $peer_review->countGivenFeedback(true, $file["user_id"]);
574 
575  $submission_data = $this->assignment->getExerciseMemberAssignmentData($file["user_id"], $this->filter["status"]);
576 
577  if (is_array($submission_data)) {
578  $data = array_merge($data, $submission_data);
579  $report_html .= $this->getReportPanel($data);
580  $total_reports++;
581  }
582  }
583  }
584  if ($total_reports == 0) {
585  $mtpl = new ilTemplate("tpl.message.html", true, true, "Services/Utilities");
586  $mtpl->setCurrentBlock("info_message");
587  $mtpl->setVariable("TEXT", $this->lng->txt("fiter_no_results"));
588  $mtpl->parseCurrentBlock();
589  $report_html .= $mtpl->get();
590  }
591 
592  $this->tpl->setContent($report_html);
593  }
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
if(!array_key_exists('StateId', $_REQUEST)) $id
Class ilExerciseMembersFilter.
filterParticipantsByAccess()
Filter manageable members by position or rbac access.
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
static getAssignmentParticipants(int $a_exercise_id, int $a_ass_id)
user()
Definition: user.php:4
Exercise peer review.
special template class to simplify handling of ITX/PEAR
static getAssignmentFilesByUsers(int $a_exc_id, int $a_ass_id, array $a_users)
$data
Definition: bench.php:6
+ Here is the call graph for this function:

◆ membersApplyObject()

ilExerciseManagementGUI::membersApplyObject ( )

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

References membersObject(), ilTable2GUI\resetOffset(), and saveStatusAllObject().

472  {
473  $this->saveStatusAllObject(null, false);
474  include_once("./Modules/Exercise/classes/class.ilExerciseMemberTableGUI.php");
475  $exc_tab = new ilExerciseMemberTableGUI($this, "members", $this->exercise, $this->assignment->getId());
476  $exc_tab->resetOffset();
477  $exc_tab->writeFilterToSession();
478 
479  $this->membersObject();
480  }
saveStatusAllObject(array $a_selected=null, $a_redirect=true)
resetOffset($a_in_determination=false)
Reset offset.
membersObject()
All participants and submission of one assignment.
+ Here is the call graph for this function:

◆ membersObject()

ilExerciseManagementGUI::membersObject ( )

All participants and submission of one assignment.

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

References $ctrl, $GLOBALS, $ilCtrl, $lng, PHPMailer\PHPMailer\$options, $si, $toolbar, $tpl, addSubTabs(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), ilExAssignmentTeam\getAdoptableGroups(), ilSubmitButton\getInstance(), ilExAssignment\getInstancesByExercise(), ilExSubmission\hasAnySubmissions(), initIndividualDeadlineModal(), ilUtil\sendInfo(), ilExAssignment\TYPE_TEXT, and ilExAssignment\TYPE_UPLOAD_TEAM.

Referenced by addUserFromAutoCompleteObject(), membersApplyObject(), membersResetObject(), saveCommentsObject(), selectAssignmentObject(), setIndividualDeadlineObject(), and waitingDownloadObject().

323  {
324  $tpl = $this->tpl;
325  $ilToolbar = $this->toolbar;
327  $lng = $this->lng;
328 
329  include_once 'Services/Tracking/classes/class.ilLPMarks.php';
330 
331  $this->addSubTabs("assignment");
332 
333  // assignment selection
334  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
335  $ass = ilExAssignment::getInstancesByExercise($this->exercise->getId());
336 
337  if (!$this->assignment) {
338  $this->assignment = current($ass);
339  }
340 
341  reset($ass);
342  if (count($ass) > 1) {
343  $options = array();
344  foreach ($ass as $a) {
345  $options[$a->getId()] = $a->getTitle();
346  }
347  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
348  $si = new ilSelectInputGUI($this->lng->txt(""), "ass_id");
349  $si->setOptions($options);
350  $si->setValue($this->assignment->getId());
351  $ilToolbar->addStickyItem($si);
352 
353  include_once("./Services/UIComponent/Button/classes/class.ilSubmitButton.php");
354  $button = ilSubmitButton::getInstance();
355  $button->setCaption("exc_select_ass");
356  $button->setCommand("selectAssignment");
357  $ilToolbar->addStickyItem($button);
358 
359  $ilToolbar->addSeparator();
360  }
361  // #16165 - if only 1 assignment dropdown is not displayed;
362  elseif ($this->assignment) {
363  $ilCtrl->setParameter($this, "ass_id", $this->assignment->getId());
364  }
365 
366  // add member
367  // is only shown if 'edit_submissions_grades' is granted by rbac. positions
368  // access is not sufficient.
369  $has_rbac_access = $GLOBALS['DIC']->access()->checkAccess(
370  'edit_submissions_grades',
371  '',
372  $this->exercise->getRefId()
373  );
374  if ($has_rbac_access) {
375  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
377  $this,
378  $ilToolbar,
379  array(
380  'auto_complete_name' => $lng->txt('user'),
381  'submit_name' => $lng->txt('add'),
382  'add_search' => true,
383  'add_from_container' => $this->exercise->getRefId()
384  )
385  );
386  }
387 
388  // #16168 - no assignments
389  if (count($ass) > 0) {
390  if ($has_rbac_access) {
391  $ilToolbar->addSeparator();
392  }
393 
394  // we do not want the ilRepositorySearchGUI form action
395  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
396 
397  $ilCtrl->setParameter($this, "ass_id", $this->assignment->getId());
398 
399  if ($this->assignment->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) {
400  include_once("./Modules/Exercise/classes/class.ilExAssignmentTeam.php");
401  if (ilExAssignmentTeam::getAdoptableGroups($this->exercise->getRefId())) {
402  $ilToolbar->addButton(
403  $this->lng->txt("exc_adopt_group_teams"),
404  $this->ctrl->getLinkTarget($this, "adoptTeamsFromGroup")
405  );
406 
407  $ilToolbar->addSeparator();
408  }
409  } elseif ($this->exercise->hasTutorFeedbackFile()) {
410  if (!$this->assignment->getAssignmentType()->usesTeams()) {
411  // multi-feedback
412  $ilToolbar->addButton(
413  $this->lng->txt("exc_multi_feedback"),
414  $this->ctrl->getLinkTarget($this, "showMultiFeedback")
415  );
416 
417  $ilToolbar->addSeparator();
418  }
419  }
420 
421  if (ilExSubmission::hasAnySubmissions($this->assignment->getId())) {
422  $ass_type = $this->assignment->getType();
423  //todo change addFormButton for addButtonInstance
424  if ($ass_type == ilExAssignment::TYPE_TEXT) {
425  $ilToolbar->addFormButton($lng->txt("exc_list_text_assignment"), "listTextAssignment");
426  }
427  $ilToolbar->addFormButton($lng->txt("download_all_returned_files"), "downloadSubmissions");
428  }
429  $this->ctrl->setParameter($this, "vw", self::VIEW_ASSIGNMENT);
430 
431  include_once("./Modules/Exercise/classes/class.ilExerciseMemberTableGUI.php");
432  $exc_tab = new ilExerciseMemberTableGUI($this, "members", $this->exercise, $this->assignment->getId());
433  $tpl->setContent(
434  $exc_tab->getHTML() .
436  );
437  } else {
438  ilUtil::sendInfo($lng->txt("exc_no_assignments_available"));
439  }
440 
441  $ilCtrl->setParameter($this, "ass_id", "");
442 
443  return;
444  }
static getAdoptableGroups($a_exc_ref_id)
This class represents a selection list property in a property form.
static hasAnySubmissions($a_ass_id)
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
addSubTabs($a_activate)
adds tabs to tab gui object
static getInstancesByExercise($a_exc_id)
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ membersResetObject()

ilExerciseManagementGUI::membersResetObject ( )

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

References membersObject(), and ilTable2GUI\resetOffset().

483  {
484  include_once("./Modules/Exercise/classes/class.ilExerciseMemberTableGUI.php");
485  $exc_tab = new ilExerciseMemberTableGUI($this, "members", $this->exercise, $this->assignment->getId());
486  $exc_tab->resetOffset();
487  $exc_tab->resetFilter();
488 
489  $this->membersObject();
490  }
resetOffset($a_in_determination=false)
Reset offset.
membersObject()
All participants and submission of one assignment.
+ Here is the call graph for this function:

◆ parseIndividualDeadlineData()

ilExerciseManagementGUI::parseIndividualDeadlineData ( array  $a_data)
protected

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

References $assignment, and $map.

Referenced by handleIndividualDeadlineCallsObject().

1842  {
1843  if ($a_data) {
1844  $map = array();
1845  $ass_tmp = array();
1846  foreach ($a_data as $item) {
1847  $item = explode("_", $item);
1848  $ass_id = $item[0];
1849  $user_id = $item[1];
1850 
1851  if (!array_key_exists($ass_id, $ass_tmp)) {
1852  if ($this->assignment &&
1853  $ass_id == $this->assignment->getId()) {
1854  $ass_tmp[$ass_id] = $this->assignment;
1855  } else {
1856  $ass_tmp[$ass_id] = new ilExAssignment($ass_id);
1857  }
1858  }
1859 
1860  $map[$ass_id][] = $user_id;
1861  }
1862 
1863  return array($map, $ass_tmp);
1864  }
1865  }
Exercise assignment.
+ Here is the caller graph for this function:

◆ redirectFeedbackMailObject()

ilExerciseManagementGUI::redirectFeedbackMailObject ( )

set feedback status for member and redirect to mail screen

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

References $_GET, ilLink\_getLink(), ilObjUser\_lookupLogin(), getMultiActionUserIds(), ilMailFormCall\getRedirectTarget(), getViewBack(), ilUtil\redirect(), and ilMailFormCall\SIGNATURE_KEY.

1039  {
1040  $members = array();
1041 
1042  if ($_GET["member_id"] != "") {
1043  $submission = new ilExSubmission($this->assignment, $_GET["member_id"]);
1044  $members = $submission->getUserIds();
1045  } elseif ($members = $this->getMultiActionUserIds()) {
1046  $members = array_keys($members);
1047  }
1048 
1049  if ($members) {
1050  $logins = array();
1051  foreach ($members as $user_id) {
1052  $member_status = $this->assignment->getMemberStatus($user_id);
1053  $member_status->setFeedback(true);
1054  $member_status->update();
1055 
1056  $logins[] = ilObjUser::_lookupLogin($user_id);
1057  }
1058  $logins = implode($logins, ",");
1059 
1060  // #16530 - see ilObjCourseGUI::createMailSignature
1061  $sig = chr(13) . chr(10) . chr(13) . chr(10);
1062  $sig .= $this->lng->txt('exc_mail_permanent_link');
1063  $sig .= chr(13) . chr(10) . chr(13) . chr(10);
1064  include_once './Services/Link/classes/class.ilLink.php';
1065  $sig .= ilLink::_getLink($this->exercise->getRefId());
1066  $sig = rawurlencode(base64_encode($sig));
1067 
1068  require_once 'Services/Mail/classes/class.ilMailFormCall.php';
1070  $this,
1071  $this->getViewBack(),
1072  array(),
1073  array(
1074  'type' => 'new',
1075  'rcp_to' => $logins,
1077  )
1078  ));
1079  }
1080  }
static _lookupLogin($a_user_id)
lookup login
$_GET["client_id"]
const SIGNATURE_KEY
Session parameter for the hash.
static getRedirectTarget($gui, $cmd, array $gui_params=array(), array $mail_params=array(), array $context_params=array())
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
static redirect($a_script)
+ Here is the call graph for this function:

◆ saveCommentForLearnersObject()

ilExerciseManagementGUI::saveCommentForLearnersObject ( )

Save comment for learner (asynch)

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

References $_POST, $comment, $res, exit, and ilUtil\stripSlashes().

1388  {
1389  $res = array("result" => false);
1390 
1391  if ($this->ctrl->isAsynch()) {
1392  $ass_id = (int) $_POST["ass_id"];
1393  $user_id = (int) $_POST["mem_id"];
1394  $comment = trim($_POST["comm"]);
1395 
1396  if ($ass_id && $user_id) {
1397  $submission = new ilExSubmission($this->assignment, $user_id);
1398  $user_ids = $submission->getUserIds();
1399 
1400  $all_members = new ilExerciseMembers($this->exercise);
1401  $all_members = $all_members->getMembers();
1402 
1403  $reci_ids = array();
1404  foreach ($user_ids as $user_id) {
1405  if (in_array($user_id, $all_members)) {
1406  $member_status = $this->assignment->getMemberStatus($user_id);
1407  $member_status->setComment(ilUtil::stripSlashes($comment));
1408  $member_status->setFeedback(true);
1409  $member_status->update();
1410 
1411  if (trim($comment)) {
1412  $reci_ids[] = $user_id;
1413  }
1414  }
1415  }
1416 
1417  if (sizeof($reci_ids)) {
1418  // send notification
1419  $this->exercise->sendFeedbackFileNotification(
1420  null,
1421  $reci_ids,
1422  $ass_id,
1423  true
1424  );
1425  }
1426 
1427  $res = array("result" => true, "snippet" => nl2br($comment));
1428  }
1429  }
1430 
1431  echo(json_encode($res));
1432  exit();
1433  }
Class ilExerciseMembers.
foreach($_POST as $key=> $value) $res
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$comment
Definition: buildRTE.php:83
exit
Definition: backend.php:16
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
$_POST["username"]
+ Here is the call graph for this function:

◆ saveCommentsObject()

ilExerciseManagementGUI::saveCommentsObject ( )

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

References $_GET, $_POST, membersObject(), and ilUtil\stripSlashes().

1247  {
1248  if (!isset($_POST['comments_value'])) {
1249  return;
1250  }
1251 
1252  $this->exercise->members_obj->setNoticeForMember(
1253  $_GET["member_id"],
1254  ilUtil::stripSlashes($_POST["comments_value"])
1255  );
1256  ilUtil::sendSuccess($this->lng->txt("exc_members_comments_saved"));
1257  $this->membersObject();
1258  }
$_GET["client_id"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
membersObject()
All participants and submission of one assignment.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveEvaluationFromModalObject()

ilExerciseManagementGUI::saveEvaluationFromModalObject ( )

Save assignment submission grade(status) and comment from the roundtrip modal.

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

References $_POST, $comment, and ilUtil\stripSlashes().

776  {
777  $comment = trim($_POST['comment']);
778  $user_id = (int) $_POST['mem_id'];
779  $grade = trim($_POST["grade"]);
780  $mark = trim($_POST['mark']);
781 
782  if ($this->assignment->getId() && $user_id) {
783  $member_status = $this->assignment->getMemberStatus($user_id);
784  $member_status->setComment(ilUtil::stripSlashes($comment));
785  $member_status->setStatus($grade);
786  $member_status->setMark($mark);
787  if ($comment != "") {
788  $member_status->setFeedback(true);
789  }
790  $member_status->update();
791  }
792  ilUtil::sendSuccess($this->lng->txt("exc_status_saved"), true);
793  $this->ctrl->redirect($this, "listTextAssignment");
794  }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$comment
Definition: buildRTE.php:83
$_POST["username"]
+ Here is the call graph for this function:

◆ saveGradesObject()

ilExerciseManagementGUI::saveGradesObject ( )

Save grades.

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

References $_POST, $ctrl, $ilCtrl, $lng, and ilUtil\stripSlashes().

496  {
498  $lng = $this->lng;
499 
500  include_once 'Services/Tracking/classes/class.ilLPMarks.php';
501 
502  if (is_array($_POST["lcomment"])) {
503  foreach ($_POST["lcomment"] as $k => $v) {
504  $marks_obj = new ilLPMarks($this->exercise->getId(), (int) $k);
505  $marks_obj->setComment(ilUtil::stripSlashes($v));
506  $marks_obj->setMark(ilUtil::stripSlashes($_POST["mark"][$k]));
507  $marks_obj->update();
508  }
509  }
510  ilUtil::sendSuccess($lng->txt("exc_msg_saved_grades"), true);
511  $ilCtrl->redirect($this, "showGradesOverview");
512  }
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ saveMultiFeedbackObject()

ilExerciseManagementGUI::saveMultiFeedbackObject ( )

Save multi feedback.

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

References $_POST.

1805  {
1806  $this->assignment->saveMultiFeedbackFiles($_POST["file"], $this->exercise);
1807 
1808  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1809  $this->ctrl->redirect($this, "members");
1810  }
$_POST["username"]

◆ saveStatus()

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

Save status of selecte members.

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

References $ctrl, $ilCtrl, $users, $values, ilObjUser\_lookupName(), and getViewBack().

Referenced by saveStatusAllObject(), and saveStatusParticipantObject().

1338  {
1339  $ilCtrl = $this->ctrl;
1340 
1341  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
1342 
1343  $saved_for = array();
1344  foreach ($a_data as $ass_id => $users) {
1345  $ass = ($ass_id < 0)
1346  ? $this->assignment
1347  : new ilExAssignment($ass_id);
1348  foreach ($users as $user_id => $values) {
1349  // this will add team members if available
1350  $submission = new ilExSubmission($ass, $user_id);
1351  foreach ($submission->getUserIds() as $sub_user_id) {
1352  $uname = ilObjUser::_lookupName($sub_user_id);
1353  $saved_for[$sub_user_id] = $uname["lastname"] . ", " . $uname["firstname"];
1354 
1355  $member_status = $ass->getMemberStatus($sub_user_id);
1356 
1357  // see bug #22566
1358  $status = $values["status"];
1359  if ($status == "") {
1360  $status = self::GRADE_NOT_GRADED;
1361  }
1362  $member_status->setStatus($status);
1363  if (array_key_exists("mark", $values)) {
1364  $member_status->setMark($values["mark"]);
1365  }
1366  if (array_key_exists("notice", $values)) {
1367  $member_status->setNotice($values["notice"]);
1368  }
1369  $member_status->update();
1370  }
1371  }
1372  }
1373 
1374  if (count($saved_for) > 0) {
1375  $save_for_str = "(" . implode($saved_for, " - ") . ")";
1376  }
1377 
1378  if ($a_redirect) {
1379  ilUtil::sendSuccess($this->lng->txt("exc_status_saved") . " " . $save_for_str, true);
1380  $ilCtrl->redirect($this, $this->getViewBack());
1381  }
1382  }
static _lookupName($a_user_id)
lookup user name
Exercise assignment.
global $ilCtrl
Definition: ilias.php:18
$values
$users
Definition: authpage.php:44
Exercise submission //TODO: This class has to much static methods related to delivered "files"...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveStatusAllObject()

ilExerciseManagementGUI::saveStatusAllObject ( array  $a_selected = null,
  $a_redirect = true 
)

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

References $_POST, $data, $GLOBALS, saveStatus(), and ilUtil\stripSlashes().

Referenced by membersApplyObject(), and saveStatusSelectedObject().

1293  {
1294  $user_ids = (array) array_keys((array) $_POST['id']);
1295  $filtered_user_ids = $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
1296  'edit_submissions_grades',
1297  'edit_submissions_grades',
1298  $this->exercise->getRefId(),
1299  $user_ids
1300  );
1301 
1302  $data = array();
1303  foreach ($filtered_user_ids as $user_id) {
1304  if (is_array($a_selected) &&
1305  !in_array($user_id, $a_selected)) {
1306  continue;
1307  }
1308 
1309  $data[-1][$user_id] = array(
1310  "status" => ilUtil::stripSlashes($_POST["status"][$user_id])
1311  );
1312 
1313  if (array_key_exists("mark", $_POST)) {
1314  $data[-1][$user_id]["mark"] = ilUtil::stripSlashes($_POST["mark"][$user_id]);
1315  }
1316  if (array_key_exists("notice", $_POST)) {
1317  $data[-1][$user_id]["notice"] = ilUtil::stripSlashes($_POST["notice"][$user_id]);
1318  }
1319  }
1320  $this->saveStatus($data, $a_redirect);
1321  }
saveStatus(array $a_data, $a_redirect=true)
Save status of selecte members.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
$data
Definition: bench.php:6
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveStatusParticipantObject()

ilExerciseManagementGUI::saveStatusParticipantObject ( array  $a_selected = null)

Save assignment status (participant view)

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

References $_GET, $_POST, $ctrl, $data, $ilCtrl, saveStatus(), and ilUtil\stripSlashes().

Referenced by saveStatusSelectedObject().

1264  {
1265  $ilCtrl = $this->ctrl;
1266 
1267  $member_id = (int) $_GET["part_id"];
1268  $data = array();
1269  foreach (array_keys($_POST["id"]) as $ass_id) {
1270  if (is_array($a_selected) &&
1271  !in_array($ass_id, $a_selected)) {
1272  continue;
1273  }
1274 
1275  $data[$ass_id][$member_id] = array(
1276  "status" => ilUtil::stripSlashes($_POST["status"][$ass_id])
1277  );
1278 
1279  if (array_key_exists("mark", $_POST)) {
1280  $data[$ass_id][$member_id]["mark"] = ilUtil::stripSlashes($_POST["mark"][$ass_id]);
1281  }
1282  if (array_key_exists("notice", $_POST)) {
1283  $data[$ass_id][$member_id]["notice"] = ilUtil::stripSlashes($_POST["notice"][$ass_id]);
1284  }
1285  }
1286 
1287  $ilCtrl->setParameter($this, "part_id", $member_id); // #17629
1288  $this->saveStatus($data);
1289  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
saveStatus(array $a_data, $a_redirect=true)
Save status of selecte members.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
$data
Definition: bench.php:6
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveStatusSelectedObject()

ilExerciseManagementGUI::saveStatusSelectedObject ( )

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

References getMultiActionUserIds(), saveStatusAllObject(), and saveStatusParticipantObject().

1324  {
1325  $members = $this->getMultiActionUserIds();
1326 
1327  if ($this->assignment) {
1328  $this->saveStatusAllObject(array_keys($members));
1329  } else {
1330  $this->saveStatusParticipantObject(array_keys($members));
1331  }
1332  }
saveStatusParticipantObject(array $a_selected=null)
Save assignment status (participant view)
saveStatusAllObject(array $a_selected=null, $a_redirect=true)
+ Here is the call graph for this function:

◆ selectAssignmentObject()

ilExerciseManagementGUI::selectAssignmentObject ( )

Select assignment.

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

References $_GET, $_POST, membersObject(), and ilUtil\stripSlashes().

869  {
870  $_GET["ass_id"] = ilUtil::stripSlashes($_POST["ass_id"]);
871  $this->membersObject();
872  }
$_GET["client_id"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
membersObject()
All participants and submission of one assignment.
$_POST["username"]
+ Here is the call graph for this function:

◆ selectParticipantObject()

ilExerciseManagementGUI::selectParticipantObject ( )

Select participant.

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

References $_GET, $_POST, showParticipantObject(), and ilUtil\stripSlashes().

989  {
990  $_GET["part_id"] = ilUtil::stripSlashes($_POST["part_id"]);
991  $this->showParticipantObject();
992  }
$_GET["client_id"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ sendMembersObject()

ilExerciseManagementGUI::sendMembersObject ( )

Send assignment per mail to participants.

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

References $_GET, $users, and getMultiActionUserIds().

1183  {
1184  $members = $this->getMultiActionUserIds();
1185 
1186  ilUtil::sendSuccess($this->lng->txt("exc_sent"), true);
1187  if ($this->assignment) {
1188  $this->exercise->sendAssignment($this->assignment, array_keys($members));
1189  $this->ctrl->redirect($this, "members");
1190  } else {
1191  foreach ($members as $ass_id => $users) {
1192  $this->exercise->sendAssignment(new ilExAssignment($ass_id), $users);
1193  }
1194  $this->ctrl->setParameter($this, "part_id", $_GET["part_id"]); // #17629
1195  $this->ctrl->redirect($this, "showParticipant");
1196  }
1197  }
Exercise assignment.
$_GET["client_id"]
$users
Definition: authpage.php:44
+ Here is the call graph for this function:

◆ setIndividualDeadlineObject()

ilExerciseManagementGUI::setIndividualDeadlineObject ( )
protected

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

References membersObject(), ilUtil\sendFailure(), and showParticipantObject().

2006  {
2007  // this will only get called if no selection
2008  ilUtil::sendFailure($this->lng->txt("select_one"));
2009 
2010  if ($this->assignment) {
2011  $this->membersObject();
2012  } else {
2013  $this->showParticipantObject();
2014  }
2015  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
membersObject()
All participants and submission of one assignment.
+ Here is the call graph for this function:

◆ showGradesOverviewObject()

ilExerciseManagementGUI::showGradesOverviewObject ( )

Show grades overview.

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

References $ctrl, $GLOBALS, $ilCtrl, $lng, $toolbar, $tpl, and addSubTabs().

998  {
999  $tpl = $this->tpl;
1000  $ilToolbar = $this->toolbar;
1001  $ilCtrl = $this->ctrl;
1002  $lng = $this->lng;
1003 
1004  $this->addSubTabs("grades");
1005 
1006  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
1007  $mem_obj = new ilExerciseMembers($this->exercise);
1008  $mems = $mem_obj->getMembers();
1009 
1010  $mems = $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
1011  'edit_submissions_grades',
1012  'edit_submissions_grades',
1013  $this->exercise->getRefId(),
1014  $mems
1015  );
1016  if (count($mems) > 0) {
1017  $ilToolbar->addButton(
1018  $lng->txt("exc_export_excel"),
1019  $ilCtrl->getLinkTarget($this, "exportExcel")
1020  );
1021  }
1022 
1023  $this->ctrl->setParameter($this, "vw", self::VIEW_GRADES);
1024 
1025  include_once("./Modules/Exercise/classes/class.ilExGradesTableGUI.php");
1026  $grades_tab = new ilExGradesTableGUI(
1027  $this,
1028  "showGradesOverview",
1029  $this->exercise,
1030  $mem_obj
1031  );
1032  $tpl->setContent($grades_tab->getHTML());
1033  }
Class ilExerciseMembers.
global $ilCtrl
Definition: ilias.php:18
addSubTabs($a_activate)
adds tabs to tab gui object
Exercise participant table.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ showMultiFeedbackConfirmationTableObject()

ilExerciseManagementGUI::showMultiFeedbackConfirmationTableObject ( )

Show multi feedback confirmation table.

Parameters

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

References $tab, $tpl, and addSubTabs().

1782  {
1783  $tpl = $this->tpl;
1784 
1785  $this->addSubTabs("assignment");
1786 
1787  include_once("./Modules/Exercise/classes/class.ilFeedbackConfirmationTable2GUI.php");
1788  $tab = new ilFeedbackConfirmationTable2GUI($this, "showMultiFeedbackConfirmationTable", $this->assignment);
1789  $tpl->setContent($tab->getHTML());
1790  }
addSubTabs($a_activate)
adds tabs to tab gui object
+ Here is the call graph for this function:

◆ showMultiFeedbackObject()

ilExerciseManagementGUI::showMultiFeedbackObject ( ilPropertyFormGUI  $a_form = null)

Show multi-feedback screen.

Parameters

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

References $lng, $toolbar, $tpl, addSubTabs(), ilLinkButton\getInstance(), initMultiFeedbackForm(), and ilUtil\sendInfo().

Referenced by uploadMultiFeedbackObject().

1722  {
1723  $ilToolbar = $this->toolbar;
1724  $lng = $this->lng;
1725  $tpl = $this->tpl;
1726 
1727  ilUtil::sendInfo($lng->txt("exc_multi_feedb_info"));
1728 
1729  $this->addSubTabs("assignment");
1730 
1731  // #13719
1732  include_once("./Services/UIComponent/Button/classes/class.ilLinkButton.php");
1733  $button = ilLinkButton::getInstance();
1734  $button->setCaption("exc_download_zip_structure");
1735  $button->setUrl($this->ctrl->getLinkTarget($this, "downloadMultiFeedbackZip"));
1736  $button->setOmitPreventDoubleSubmission(true);
1737  $ilToolbar->addButtonInstance($button);
1738 
1739  if (!$a_form) {
1740  $a_form = $this->initMultiFeedbackForm($this->assignment->getId());
1741  }
1742 
1743  $tpl->setContent($a_form->getHTML());
1744  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
addSubTabs($a_activate)
adds tabs to tab gui object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showParticipantApplyObject()

ilExerciseManagementGUI::showParticipantApplyObject ( )

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

References $_GET, and showParticipantObject().

966  {
967  include_once("./Modules/Exercise/classes/class.ilExParticipantTableGUI.php");
968  $exc_tab = new ilExParticipantTableGUI($this, "showParticipant", $this->exercise, $_GET["part_id"]);
969  $exc_tab->resetOffset();
970  $exc_tab->writeFilterToSession();
971 
972  $this->showParticipantObject();
973  }
$_GET["client_id"]
Exercise participant table.
+ Here is the call graph for this function:

◆ showParticipantObject()

ilExerciseManagementGUI::showParticipantObject ( )

Show Participant.

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

References $_GET, $ctrl, $GLOBALS, $ilCtrl, $lng, $m, $name, PHPMailer\PHPMailer\$options, $si, $toolbar, $tpl, ilObjUser\_lookupName(), ilObject\_lookupType(), addSubTabs(), ilExAssignment\getAssignmentDataOfExercise(), ilSubmitButton\getInstance(), initIndividualDeadlineModal(), ilUtil\sendInfo(), and ilUtil\sortArray().

Referenced by selectParticipantObject(), setIndividualDeadlineObject(), showParticipantApplyObject(), and showParticipantResetObject().

878  {
879  $tpl = $this->tpl;
880  $ilToolbar = $this->toolbar;
882  $lng = $this->lng;
883 
884  $this->addSubTabs("participant");
885  $this->ctrl->setParameter($this, "ass_id", "");
886 
887  // participant selection
888  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
889  $ass = ilExAssignment::getAssignmentDataOfExercise($this->exercise->getId());
890  $members = $this->exercise->members_obj->getMembers();
891 
892  $members = $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
893  'edit_submissions_grades',
894  'edit_submissions_grades',
895  $this->exercise->getRefId(),
896  $members
897  );
898 
899 
900  if (count($members) == 0) {
901  ilUtil::sendInfo($lng->txt("exc_no_participants"));
902  return;
903  }
904 
905  $mems = array();
906  foreach ($members as $mem_id) {
907  if (ilObject::_lookupType($mem_id) == "usr") {
908  include_once("./Services/User/classes/class.ilObjUser.php");
909  $name = ilObjUser::_lookupName($mem_id);
910  if (trim($name["login"]) != "") { // #20073
911  $mems[$mem_id] = $name;
912  }
913  }
914  }
915 
916  $mems = ilUtil::sortArray($mems, "lastname", "asc", false, true);
917 
918  if ($_GET["part_id"] == "" && count($mems) > 0) {
919  $_GET["part_id"] = key($mems);
920  }
921 
922  $current_participant = $_GET["part_id"];
923 
924  reset($mems);
925  if (count($mems) > 1) {
926  $options = array();
927  foreach ($mems as $k => $m) {
928  $options[$k] =
929  $m["lastname"] . ", " . $m["firstname"] . " [" . $m["login"] . "]";
930  }
931  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
932  $si = new ilSelectInputGUI($this->lng->txt(""), "part_id");
933  $si->setOptions($options);
934  $si->setValue($current_participant);
935  $ilToolbar->addStickyItem($si);
936 
937  include_once("./Services/UIComponent/Button/classes/class.ilSubmitButton.php");
938  $button = ilSubmitButton::getInstance();
939  $button->setCaption("exc_select_part");
940  $button->setCommand("selectParticipant");
941  $ilToolbar->addStickyItem($button);
942  }
943 
944  if (count($mems) > 0) {
945  $this->ctrl->setParameter($this, "vw", self::VIEW_PARTICIPANT);
946  $this->ctrl->setParameter($this, "part_id", $current_participant);
947 
948  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
949  $ilToolbar->addFormButton($lng->txt("download_all_returned_files"), "downloadSubmissions");
950 
951  include_once("./Modules/Exercise/classes/class.ilExParticipantTableGUI.php");
952  $part_tab = new ilExParticipantTableGUI(
953  $this,
954  "showParticipant",
955  $this->exercise,
956  $current_participant
957  );
958  $tpl->setContent($part_tab->getHTML() .
959  $this->initIndividualDeadlineModal());
960  } else {
961  ilUtil::sendInfo($this->lng->txt("exc_no_assignments_available"));
962  }
963  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static _lookupName($a_user_id)
lookup user name
static getAssignmentDataOfExercise($a_exc_id)
Get assignments data of an exercise in an array.
This class represents a selection list property in a property form.
$_GET["client_id"]
Exercise participant table.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
addSubTabs($a_activate)
adds tabs to tab gui object
static _lookupType($a_id, $a_reference=false)
lookup object type
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showParticipantResetObject()

ilExerciseManagementGUI::showParticipantResetObject ( )

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

References $_GET, and showParticipantObject().

976  {
977  include_once("./Modules/Exercise/classes/class.ilExParticipantTableGUI.php");
978  $exc_tab = new ilExParticipantTableGUI($this, "showParticipant", $this->exercise, $_GET["part_id"]);
979  $exc_tab->resetOffset();
980  $exc_tab->resetFilter();
981 
982  $this->showParticipantObject();
983  }
$_GET["client_id"]
Exercise participant table.
+ Here is the call graph for this function:

◆ uploadMultiFeedbackObject()

ilExerciseManagementGUI::uploadMultiFeedbackObject ( )

Upload multi feedback file.

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

References $form, initMultiFeedbackForm(), ilUtil\sendFailure(), showMultiFeedbackObject(), and ilUtil\stripSlashesArray().

1758  {
1759  // #11983
1760  $form = $this->initMultiFeedbackForm($this->assignment->getId());
1761  if ($form->checkInput()) {
1762  try {
1763  $this->assignment->uploadMultiFeedbackFile(ilUtil::stripSlashesArray($_FILES["mfzip"]));
1764  $this->ctrl->redirect($this, "showMultiFeedbackConfirmationTable");
1765  } catch (ilExerciseException $e) {
1766  ilUtil::sendFailure($e->getMessage(), true);
1767  $this->ctrl->redirect($this, "showMultiFeedback");
1768  }
1769  }
1770 
1771  $form->setValuesByPost();
1773  }
showMultiFeedbackObject(ilPropertyFormGUI $a_form=null)
Show multi-feedback screen.
if(isset($_POST['submit'])) $form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
Exercise exceptions class.
+ Here is the call graph for this function:

◆ waitingDownloadObject()

ilExerciseManagementGUI::waitingDownloadObject ( )

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

References $_GET, $ctrl, $ilCtrl, $lng, $url, membersObject(), and ilUtil\sendInfo().

308  {
309  $lng = $this->lng;
311 
312  $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "member_id", (int) $_GET["member_id"]);
313  $url = $ilCtrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilExerciseHandlerGUI", "ilObjExerciseGUI", "ilExerciseManagementGUI", "ilExSubmissionFileGUI"), "downloadNewReturned");
314  $js_url = $ilCtrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilExerciseHandlerGUI", "ilObjExerciseGUI", "ilExerciseManagementGUI", "ilExSubmissionFileGUI"), "downloadNewReturned", "", "", false);
315  ilUtil::sendInfo($lng->txt("exc_wait_for_files") . "<a href='$url'> " . $lng->txt('exc_download_files') . "</a><script>window.location.href ='" . $js_url . "';</script>");
316  $this->membersObject();
317  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
membersObject()
All participants and submission of one assignment.
$url
+ Here is the call graph for this function:

Field Documentation

◆ $assignment

ilExerciseManagementGUI::$assignment
protected

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

Referenced by parseIndividualDeadlineData().

◆ $ctrl

◆ $exercise

ilExerciseManagementGUI::$exercise
protected

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

◆ $filter

ilExerciseManagementGUI::$filter
protected

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

◆ $lng

◆ $tabs_gui

ilExerciseManagementGUI::$tabs_gui
protected

◆ $task_factory

ilExerciseManagementGUI::$task_factory
protected

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

◆ $toolbar

ilExerciseManagementGUI::$toolbar
protected

◆ $tpl

◆ $ui_factory

ilExerciseManagementGUI::$ui_factory
protected

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

◆ $ui_renderer

ilExerciseManagementGUI::$ui_renderer
protected

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

◆ $user

ilExerciseManagementGUI::$user
protected

◆ FEEDBACK_FULL_SUBMISSION

const ilExerciseManagementGUI::FEEDBACK_FULL_SUBMISSION = "submission_only"

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

◆ FEEDBACK_ONLY_SUBMISSION

const ilExerciseManagementGUI::FEEDBACK_ONLY_SUBMISSION = "submission_feedback"

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

◆ GRADE_FAILED

const ilExerciseManagementGUI::GRADE_FAILED = "failed"

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

◆ GRADE_NOT_GRADED

const ilExerciseManagementGUI::GRADE_NOT_GRADED = "notgraded"

◆ GRADE_PASSED

const ilExerciseManagementGUI::GRADE_PASSED = "passed"

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

◆ VIEW_ASSIGNMENT

const ilExerciseManagementGUI::VIEW_ASSIGNMENT = 1

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

◆ VIEW_GRADES

const ilExerciseManagementGUI::VIEW_GRADES = 3

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

◆ VIEW_PARTICIPANT

const ilExerciseManagementGUI::VIEW_PARTICIPANT = 2

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


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