ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 membersApplyObject ()
 
 membersResetObject ()
 
 saveGradesObject ()
 Save grades. More...
 
 listTextAssignmentWithPeerReviewObject ()
 
 listTextAssignmentObject ($a_show_peer_review=false)
 
 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...
 

Data Fields

const VIEW_ASSIGNMENT = 1
 
const VIEW_PARTICIPANT = 2
 
const VIEW_GRADES = 3
 

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
 
 $toolbar
 
 $exercise
 
 $assignment
 

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 58 of file class.ilExerciseManagementGUI.php.

References $DIC, $ilCtrl, $lng, $tpl, and array.

59  {
60  global $DIC;
61 
62  $this->toolbar = $DIC->toolbar();
63  $ilCtrl = $DIC->ctrl();
64  $ilTabs = $DIC->tabs();
65  $lng = $DIC->language();
66  $tpl = $DIC["tpl"];
67 
68  $this->exercise = $a_exercise;
69  $this->assignment = $a_ass;
70 
71  $ilCtrl->saveParameter($this, array("vw", "member_id"));
72 
73  // :TODO:
74  $this->ctrl = $ilCtrl;
75  $this->tabs_gui = $ilTabs;
76  $this->lng = $lng;
77  $this->tpl = $tpl;
78  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.

Member Function Documentation

◆ addMembersObject()

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

Add new partipant.

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

References ilUtil\sendFailure(), and ilUtil\sendSuccess().

Referenced by addUserFromAutoCompleteObject().

515  {
516  if (!count($a_user_ids)) {
517  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
518  return false;
519  }
520 
521  if (!$this->exercise->members_obj->assignMembers($a_user_ids)) {
522  ilUtil::sendFailure($this->lng->txt("exc_members_already_assigned"));
523  return false;
524  } else {
525  /* #16921
526  // #9946 - create team for new user(s) for each team upload assignment
527  foreach(ilExAssignment::getInstancesByExercise($this->exercise->getId()) as $ass)
528  {
529  if($ass->hasTeam())
530  {
531  include_once "Modules/Exercise/classes/class.ilExAssignmentTeam.php";
532  foreach($a_user_ids as $user_id)
533  {
534  // #15915
535  ilExAssignmentTeam::getTeamId($ass->getId(), $user_id, true);
536  }
537  }
538  }
539  */
540 
541  ilUtil::sendSuccess($this->lng->txt("exc_members_assigned"), true);
542  }
543 
544  $this->ctrl->redirect($this, "members");
545  return true;
546  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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 230 of file class.ilExerciseManagementGUI.php.

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

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

231  {
232  $ilTabs = $this->tabs_gui;
233  $lng = $this->lng;
235 
236  $ass_id = $_GET["ass_id"];
237  $part_id = $_GET["part_id"];
238 
239  $ilCtrl->setParameter($this, "vw", "");
240  $ilCtrl->setParameter($this, "member_id", "");
241  $ilCtrl->setParameter($this, "ass_id", "");
242  $ilCtrl->setParameter($this, "part_id", "");
243 
244  $ilTabs->addSubTab(
245  "assignment",
246  $lng->txt("exc_assignment_view"),
247  $ilCtrl->getLinkTarget($this, "members")
248  );
249  $ilTabs->addSubTab(
250  "participant",
251  $lng->txt("exc_participant_view"),
252  $ilCtrl->getLinkTarget($this, "showParticipant")
253  );
254  $ilTabs->addSubTab(
255  "grades",
256  $lng->txt("exc_grades_overview"),
257  $ilCtrl->getLinkTarget($this, "showGradesOverview")
258  );
259  $ilTabs->activateSubTab($a_activate);
260 
261  $ilCtrl->setParameter($this, "ass_id", $ass_id);
262  $ilCtrl->setParameter($this, "part_id", $part_id);
263  }
$_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 483 of file class.ilExerciseManagementGUI.php.

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

484  {
485  if (!strlen(trim($_POST['user_login']))) {
486  ilUtil::sendFailure($this->lng->txt('msg_no_search_string'));
487  $this->membersObject();
488  return false;
489  }
490  $users = explode(',', $_POST['user_login']);
491 
492  $user_ids = array();
493  foreach ($users as $user) {
494  $user_id = ilObjUser::_lookupId($user);
495 
496  if (!$user_id) {
497  ilUtil::sendFailure($this->lng->txt('user_not_known'));
498  return $this->membersObject();
499  }
500 
501  $user_ids[] = $user_id;
502  }
503 
504  if (!$this->addMembersObject($user_ids)) {
505  $this->membersObject();
506  return false;
507  }
508  return true;
509  }
addMembersObject($a_user_ids=array())
Add new partipant.
static _lookupId($a_user_str)
Lookup id by login.
Create styles array
The data for the language used.
$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 1200 of file class.ilExerciseManagementGUI.php.

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

Referenced by createTeamsFromGroupsObject().

1201  {
1202  $ilCtrl = $this->ctrl;
1203  $ilTabs = $this->tabs_gui;
1204  $lng = $this->lng;
1205  $tpl = $this->tpl;
1206 
1207  $ilTabs->clearTargets();
1208  $ilTabs->setBackTarget(
1209  $lng->txt("back"),
1210  $ilCtrl->getLinkTarget($this, $this->getViewBack())
1211  );
1212 
1213  if (!$a_form) {
1214  $a_form = $this->initGroupForm();
1215  }
1216  $tpl->setContent($a_form->getHTML());
1217  }
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 1465 of file class.ilExerciseManagementGUI.php.

1466  {
1467  $this->assignment->clearMultiFeedbackDirectory();
1468  $this->ctrl->redirect($this, "members");
1469  }

◆ confirmDeassignMembersObject()

ilExerciseManagementGUI::confirmDeassignMembersObject ( )

Confirm deassigning members.

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

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

873  {
875  $tpl = $this->tpl;
876  $lng = $this->lng;
877 
878  $members = $this->getMultiActionUserIds();
879 
880  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
881  $cgui = new ilConfirmationGUI();
882  $cgui->setFormAction($ilCtrl->getFormAction($this));
883  $cgui->setHeaderText($lng->txt("exc_msg_sure_to_deassign_participant"));
884  $cgui->setCancel($lng->txt("cancel"), "members");
885  $cgui->setConfirm($lng->txt("remove"), "deassignMembers");
886 
887  include_once("./Services/User/classes/class.ilUserUtil.php");
888  foreach ($members as $k => $m) {
889  $cgui->addItem(
890  "member[$k]",
891  $m,
892  ilUserUtil::getNamePresentation((int) $k, false, false, "", true)
893  );
894  }
895 
896  $tpl->setContent($cgui->getHTML());
897  }
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 1264 of file class.ilExerciseManagementGUI.php.

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

1265  {
1266  $lng = $this->lng;
1267 
1268  $form = $this->initGroupForm();
1269  if ($form->checkInput()) {
1270  include_once "Services/User/classes/class.ilUserUtil.php";
1271  $map = ilExAssignmentTeam::getGroupMembersMap($this->exercise->getRefId());
1272  $all_members = $teams = array();
1273  $valid = true;
1274  foreach (array_keys($map) as $grp_id) {
1275  $postvar = "grpt_" . $grp_id;
1276  $members = $_POST[$postvar];
1277  if (is_array($members)) {
1278  $teams[] = $members;
1279  $invalid_team_members = array();
1280 
1281  foreach ($members as $user_id) {
1282  if (!array_key_exists($user_id, $all_members)) {
1283  $all_members[$user_id] = $grp_id;
1284  } else {
1285  // user is selected in multiple groups
1286  $invalid_team_members[] = $user_id;
1287  }
1288  }
1289 
1290  if (sizeof($invalid_team_members)) {
1291  $valid = false;
1292 
1293  $alert = array();
1294  foreach ($invalid_team_members as $user_id) {
1295  $user_name = ilUserUtil::getNamePresentation($user_id, false, false, "", true);
1296  $grp_title = $map[$all_members[$user_id]]["title"];
1297  $alert[] = sprintf($lng->txt("exc_adopt_group_teams_conflict"), $user_name, $grp_title);
1298  }
1299  $input = $form->getItemByPostVar($postvar);
1300  $input->setAlert(implode("<br/>", $alert));
1301  }
1302  }
1303  }
1304  if ($valid) {
1305  if (sizeof($teams)) {
1306  $existing_users = array_keys(ilExAssignmentTeam::getAssignmentTeamMap($this->assignment->getId()));
1307 
1308  // create teams from group selections
1309  $sum = array("added"=>0, "blocked"=>0);
1310  foreach ($teams as $members) {
1311  foreach ($members as $user_id) {
1312  if (!$this->exercise->members_obj->isAssigned($user_id)) {
1313  $this->exercise->members_obj->assignMember($user_id);
1314  }
1315 
1316  if (!in_array($user_id, $existing_users)) {
1317  $sum["added"]++;
1318  } else {
1319  $sum["blocked"]++;
1320  }
1321  }
1322 
1323  $first = array_shift($members);
1324  $team = ilExAssignmentTeam::getInstanceByUserId($this->assignment->getId(), $first, true);
1325 
1326  // getTeamId() does NOT send notification
1327  // $team->sendNotification($this->exercise->getRefId(), $first, "add");
1328 
1329  if (sizeof($members)) {
1330  foreach ($members as $user_id) {
1331  $team->addTeamMember($user_id);
1332  }
1333  }
1334  }
1335 
1336  $mess = array();
1337  if ($sum["added"]) {
1338  $mess[] = sprintf($lng->txt("exc_adopt_group_teams_added"), $sum["added"]);
1339  }
1340  if ($sum["blocked"]) {
1341  $mess[] = sprintf($lng->txt("exc_adopt_group_teams_blocked"), $sum["blocked"]);
1342  }
1343  if ($sum["added"]) {
1344  ilUtil::sendSuccess(implode(" ", $mess), true);
1345  } else {
1346  ilUtil::sendFailure(implode(" ", $mess), true);
1347  }
1348  }
1349  $this->ctrl->redirect($this, "members");
1350  } else {
1351  ilUtil::sendFailure($lng->txt("form_input_not_valid"));
1352  }
1353  }
1354 
1355  $form->setValuesByPost();
1357  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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:
Create styles array
The data for the language used.
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 1119 of file class.ilExerciseManagementGUI.php.

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

1120  {
1121  $ilCtrl = $this->ctrl;
1122 
1123  $members = $this->getMultiActionUserIds(true);
1124 
1125  $new_members = array();
1126 
1127  include_once "Modules/Exercise/classes/class.ilExAssignmentTeam.php";
1128  foreach ($members as $group) {
1129  if (is_array($group)) {
1130  $new_members = array_merge($new_members, $group);
1131 
1132  $first_user = $group;
1133  $first_user = array_shift($first_user);
1134  $team = ilExAssignmentTeam::getInstanceByUserId($this->assignment->getId(), $first_user);
1135  foreach ($group as $user_id) {
1136  $team->removeTeamMember($user_id);
1137  }
1138  } else {
1139  $new_members[] = $group;
1140  }
1141  }
1142 
1143  if (sizeof($new_members)) {
1144  // see ilExSubmissionTeamGUI::addTeamMemberActionObject()
1145 
1146  $first_user = array_shift($new_members);
1147  $team = ilExAssignmentTeam::getInstanceByUserId($this->assignment->getId(), $first_user, true);
1148  if (sizeof($new_members)) {
1149  foreach ($new_members as $user_id) {
1150  $team->addTeamMember($user_id);
1151  }
1152  }
1153 
1154  // re-evaluate complete team, as some members might have had submitted
1155  $submission = new ilExSubmission($this->assignment, $first_user);
1156  $this->exercise->processExerciseStatus(
1157  $this->assignment,
1158  $team->getMembers(),
1159  $submission->hasSubmitted(),
1160  $submission->validatePeerReviews()
1161  );
1162  }
1163 
1164  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1165  $ilCtrl->redirect($this, "members");
1166  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
static getInstanceByUserId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
Create styles array
The data for the language used.
Exercise submission.
+ Here is the call graph for this function:

◆ deassignMembersObject()

ilExerciseManagementGUI::deassignMembersObject ( )

Deassign members from exercise.

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

References $ctrl, $ilCtrl, $lng, getMultiActionUserIds(), and ilUtil\sendSuccess().

903  {
905  $lng = $this->lng;
906 
907  $members = $this->getMultiActionUserIds();
908 
909  foreach (array_keys($members) as $usr_id) {
910  $this->exercise->members_obj->deassignMember((int) $usr_id);
911  }
912  ilUtil::sendSuccess($lng->txt("exc_msg_participants_removed"), true);
913  $ilCtrl->redirect($this, "members");
914  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ dissolveTeamsObject()

ilExerciseManagementGUI::dissolveTeamsObject ( )

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

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

1169  {
1170  $ilCtrl = $this->ctrl;
1171 
1172  $members = $this->getMultiActionUserIds(true);
1173 
1174  include_once "Modules/Exercise/classes/class.ilExAssignmentTeam.php";
1175  foreach ($members as $group) {
1176  // if single member - nothing to do
1177  if (is_array($group)) {
1178  // see ilExSubmissionTeamGUI::removeTeamMemberObject()
1179 
1180  $first_user = $group;
1181  $first_user = array_shift($first_user);
1182  $team = ilExAssignmentTeam::getInstanceByUserId($this->assignment->getId(), $first_user);
1183  foreach ($group as $user_id) {
1184  $team->removeTeamMember($user_id);
1185  }
1186 
1187  // reset ex team members, as any submission is not valid without team
1188  $this->exercise->processExerciseStatus(
1189  $this->assignment,
1190  $group,
1191  false
1192  );
1193  }
1194  }
1195 
1196  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1197  $ilCtrl->redirect($this, "members");
1198  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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 768 of file class.ilExerciseManagementGUI.php.

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

769  {
770  $members = array();
771 
772  foreach ($this->exercise->members_obj->getMembers() as $member_id) {
773  $submission = new ilExSubmission($this->assignment, $member_id);
774  $submission->updateTutorDownloadTime();
775 
776  // get member object (ilObjUser)
777  if (ilObject::_exists($member_id)) {
778  // adding file metadata
779  foreach ($submission->getFiles() as $file) {
780  $members[$file["user_id"]]["files"][$file["returned_id"]] = $file;
781  }
782 
783  $tmp_obj =&ilObjectFactory::getInstanceByObjId($member_id);
784  $members[$member_id]["name"] = $tmp_obj->getFirstname() . " " . $tmp_obj->getLastname();
785  unset($tmp_obj);
786  }
787  }
788 
789  ilExSubmission::downloadAllAssignmentFiles($this->assignment, $members);
790  }
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)
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
Create styles array
The data for the language used.
Exercise submission.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:

◆ downloadMultiFeedbackZipObject()

ilExerciseManagementGUI::downloadMultiFeedbackZipObject ( )

Download multi-feedback structrue file.

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

1420  {
1421  $this->assignment->sendMultiFeedbackStructureFile($this->exercise);
1422  }

◆ executeCommand()

ilExerciseManagementGUI::executeCommand ( )

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

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

81  {
83  $lng = $this->lng;
84  $ilTabs = $this->tabs_gui;
85 
86  $class = $ilCtrl->getNextClass($this);
87  $cmd = $ilCtrl->getCmd("listPublicSubmissions");
88 
89  switch ($class) {
90  case "ilfilesystemgui":
91  $ilTabs->clearTargets();
92  $ilTabs->setBackTarget(
93  $lng->txt("back"),
94  $ilCtrl->getLinkTarget($this, $this->getViewBack())
95  );
96 
97  ilUtil::sendInfo($lng->txt("exc_fb_tutor_info"));
98 
99  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
100  $fstorage = new ilFSStorageExercise($this->exercise->getId(), $this->assignment->getId());
101  $fstorage->create();
102 
103  $submission = new ilExSubmission($this->assignment, (int) $_GET["member_id"]);
104  $feedback_id = $submission->getFeedbackId();
105  $noti_rec_ids = $submission->getUserIds();
106 
107  include_once("./Services/User/classes/class.ilUserUtil.php");
108  $fs_title = array();
109  foreach ($noti_rec_ids as $rec_id) {
110  $fs_title[] = ilUserUtil::getNamePresentation($rec_id, false, false, "", true);
111  }
112  $fs_title = implode(" / ", $fs_title);
113 
114  include_once("./Services/FileSystem/classes/class.ilFileSystemGUI.php");
115  $fs_gui = new ilFileSystemGUI($fstorage->getFeedbackPath($feedback_id));
116  $fs_gui->setTableId("excfbfil" . $this->assignment->getId() . "_" . $feedback_id);
117  $fs_gui->setAllowDirectories(false);
118  $fs_gui->setTitle($lng->txt("exc_fb_files") . " - " .
119  $this->assignment->getTitle() . " - " .
120  $fs_title);
121  $pcommand = $fs_gui->getLastPerformedCommand();
122  if (is_array($pcommand) && $pcommand["cmd"] == "create_file") {
123  foreach ($noti_rec_ids as $user_id) {
124  $member_status = $this->assignment->getMemberStatus($user_id);
125  $member_status->setFeedback(true);
126  $member_status->update();
127  }
128 
129  $this->exercise->sendFeedbackFileNotification(
130  $pcommand["name"],
131  $noti_rec_ids,
132  $this->assignment->getId()
133  );
134  }
135  $this->ctrl->forwardCommand($fs_gui);
136  break;
137 
138  case 'ilrepositorysearchgui':
139  include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
140  $rep_search = new ilRepositorySearchGUI();
141  $ref_id = $this->exercise->getRefId();
142  $rep_search->addUserAccessFilterCallable(function ($a_user_ids) use ($ref_id) {
143  return $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
144  'edit_submissions_grades',
145  'edit_submissions_grades',
146  $ref_id,
147  $a_user_ids
148  );
149  });
150  $rep_search->setTitle($this->lng->txt("exc_add_participant"));
151  $rep_search->setCallback($this, 'addMembersObject');
152 
153  // Set tabs
154  $this->addSubTabs("assignment");
155  $this->ctrl->setReturn($this, 'members');
156 
157  $this->ctrl->forwardCommand($rep_search);
158  break;
159 
160  case "ilexsubmissionteamgui":
161  include_once "Modules/Exercise/classes/class.ilExSubmissionTeamGUI.php";
162  $gui = new ilExSubmissionTeamGUI($this->exercise, $this->initSubmission());
163  $ilCtrl->forwardCommand($gui);
164  break;
165 
166  case "ilexsubmissionfilegui":
167  include_once "Modules/Exercise/classes/class.ilExSubmissionFileGUI.php";
168  $gui = new ilExSubmissionFileGUI($this->exercise, $this->initSubmission());
169  $ilCtrl->forwardCommand($gui);
170  break;
171 
172  case "ilexsubmissiontextgui":
173  $ilCtrl->saveParameter($this, array("part_id"));
174  include_once "Modules/Exercise/classes/class.ilExSubmissionTextGUI.php";
175  $gui = new ilExSubmissionTextGUI($this->exercise, $this->initSubmission());
176  $ilCtrl->forwardCommand($gui);
177  break;
178 
179  case "ilexpeerreviewgui":
180  include_once "Modules/Exercise/classes/class.ilExPeerReviewGUI.php";
181  $gui = new ilExPeerReviewGUI($this->assignment, $this->initSubmission());
182  $ilCtrl->forwardCommand($gui);
183  break;
184 
185  default:
186  $this->{$cmd . "Object"}();
187  break;
188  }
189  }
$_GET["client_id"]
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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:
Create styles array
The data for the language used.
Exercise submission.
File System Explorer GUI class.
Object-based submissions (ends up as static file)
+ Here is the call graph for this function:

◆ exportExcelObject()

ilExerciseManagementGUI::exportExcelObject ( )

Export as excel.

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

References exit.

1109  {
1110  $this->exercise->exportGradesExcel();
1111  exit;
1112  }

◆ getMultiActionUserIds()

ilExerciseManagementGUI::getMultiActionUserIds (   $a_keep_teams = false)
protected

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

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

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

793  {
794  // multi-user
795  if ($this->assignment) {
796  if (!$_POST["member"]) {
797  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
798  $this->ctrl->redirect($this, "members");
799  }
800 
801  foreach (array_keys($_POST["member"]) as $user_id) {
802  $submission = new ilExSubmission($this->assignment, $user_id);
803  $tmembers = $submission->getUserIds();
804  if (!(bool) $a_keep_teams) {
805  foreach ($tmembers as $tuser_id) {
806  $members[$tuser_id] = 1;
807  }
808  } else {
809  if ($tmembers) {
810  $members[] = $tmembers;
811  } else {
812  // no team yet
813  $members[] = $user_id;
814  }
815  }
816  }
817  }
818  // multi-ass
819  else {
820  if (!$_POST["ass"]) {
821  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
822  $this->ctrl->redirect($this, "showParticipant");
823  }
824 
825  $user_id = $_GET["part_id"];
826 
827  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
828  foreach (array_keys($_POST["ass"]) as $ass_id) {
829  $submission = new ilExSubmission(new ilExAssignment($ass_id), $user_id);
830  $tmembers = $submission->getUserIds();
831  if (!(bool) $a_keep_teams) {
832  foreach ($tmembers as $tuser_id) {
833  $members[$ass_id][] = $tuser_id;
834  }
835  } else {
836  if ($tmembers) {
837  $members[$ass_id][] = $tmembers;
838  } else {
839  // no team yet
840  $members[$ass_id][] = $user_id;
841  }
842  }
843  }
844  }
845 
846  return $members;
847  }
Exercise assignment.
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Exercise submission.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewBack()

ilExerciseManagementGUI::getViewBack ( )
protected

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

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

192  {
193  switch ($_REQUEST["vw"]) {
194  case self::VIEW_PARTICIPANT:
195  $back_cmd = "showParticipant";
196  break;
197 
198  case self::VIEW_GRADES:
199  $back_cmd = "showGradesOverview";
200  break;
201 
202  default:
203  // case self::VIEW_ASSIGNMENT:
204  $back_cmd = "members";
205  break;
206  }
207  return $back_cmd;
208  }
+ Here is the caller graph for this function:

◆ handleIndividualDeadlineCallsObject()

ilExerciseManagementGUI::handleIndividualDeadlineCallsObject ( )
protected

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

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

1538  {
1539  $tpl = $this->tpl;
1540 
1541  $this->ctrl->saveParameter($this, "part_id");
1542 
1543  // we are done
1544  if ((bool) $_GET["dn"]) {
1545  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
1546  $this->ctrl->redirect($this, $this->assignment
1547  ? "members"
1548  : "showParticipant");
1549  }
1550 
1551  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
1552 
1553  // initial form call
1554  if ($_GET["idlid"]) {
1555  $tmp = $this->parseIndividualDeadlineData(explode(",", $_GET["idlid"]));
1556  if (is_array($tmp)) {
1557  $form = $this->initIndividualDeadlineForm($tmp[1], $tmp[0]);
1558  echo $form->getHTML() .
1559  $tpl->getOnLoadCodeForAsynch();
1560  }
1561  }
1562  // form "submit"
1563  else {
1564  $tmp = array();
1565  foreach (array_keys($_POST) as $id) {
1566  if (substr($id, 0, 3) == "dl_") {
1567  $tmp[] = substr($id, 3);
1568  }
1569  }
1570  $tmp = $this->parseIndividualDeadlineData($tmp);
1571  $ass_map = $tmp[1];
1572  $users = $tmp[0];
1573  unset($tmp);
1574 
1575  $form = $this->initIndividualDeadlineForm($ass_map, $users);
1576  $res = array();
1577  if ($valid = $form->checkInput()) {
1578  foreach ($users as $ass_id => $users) {
1579  $ass = $ass_map[$ass_id];
1580 
1581  // :TODO: should individual deadlines BEFORE extended be possible?
1582  $dl = new ilDateTime($ass->getDeadline(), IL_CAL_UNIX);
1583 
1584  foreach ($users as $user_id) {
1585  $date_field = $form->getItemByPostVar("dl_" . $ass_id . "_" . $user_id);
1586  if (ilDate::_before($date_field->getDate(), $dl)) {
1587  $date_field->setAlert(sprintf($this->lng->txt("exc_individual_deadline_before_global"), ilDatePresentation::formatDate($dl)));
1588  $valid = false;
1589  } else {
1590  $res[$ass_id][$user_id] = $date_field->getDate();
1591  }
1592  }
1593  }
1594  }
1595 
1596  if (!$valid) {
1597  $form->setValuesByPost();
1598  echo $form->getHTML() .
1599  $tpl->getOnLoadCodeForAsynch();
1600  } else {
1601  foreach ($res as $ass_id => $users) {
1602  $ass = $ass_map[$ass_id];
1603 
1604  foreach ($users as $id => $date) {
1605  $ass->setIndividualDeadline($id, $date);
1606  }
1607 
1608  $ass->recalculateLateSubmissions();
1609  }
1610 
1611  echo "ok";
1612  }
1613  }
1614 
1615  exit();
1616  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_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.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
if(!array_key_exists('StateId', $_REQUEST)) $id
const IL_CAL_UNIX
foreach($_POST as $key=> $value) $res
if(isset($_POST['submit'])) $form
Date and time handling
Create styles array
The data for the language used.
$users
Definition: authpage.php:44
$_POST["username"]
initIndividualDeadlineForm(array $a_ass_map, array $ids)
+ Here is the call graph for this function:

◆ initGroupForm()

ilExerciseManagementGUI::initGroupForm ( )
protected

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

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

Referenced by adoptTeamsFromGroupObject(), and createTeamsFromGroupsObject().

1220  {
1221  $lng = $this->lng;
1222 
1223  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1224  $form = new ilPropertyFormGUI();
1225  $form->setTitle($lng->txt("exc_adopt_group_teams") . " - " . $this->assignment->getTitle());
1226  $form->setFormAction($this->ctrl->getFormAction($this, "createTeamsFromGroups"));
1227 
1228  include_once "Modules/Exercise/classes/class.ilExAssignmentTeam.php";
1229  include_once "Services/User/classes/class.ilUserUtil.php";
1230  $all_members = array();
1231  foreach (ilExAssignmentTeam::getGroupMembersMap($this->exercise->getRefId()) as $grp_id => $group) {
1232  if (sizeof($group["members"])) {
1233  $grp_team = new ilCheckboxGroupInputGUI($lng->txt("obj_grp") . " \"" . $group["title"] . "\"", "grpt_" . $grp_id);
1234  $grp_value = $options = array();
1235  foreach ($group["members"] as $user_id) {
1236  $user_name = ilUserUtil::getNamePresentation($user_id, false, false, "", true);
1237  $options[$user_id] = $user_name;
1238  if (!in_array($user_id, $all_members)) {
1239  $grp_value[] = $user_id;
1240  $all_members[] = $user_id;
1241  }
1242  }
1243  asort($options);
1244  foreach ($options as $user_id => $user_name) {
1245  $grp_team->addOption(new ilCheckboxOption($user_name, $user_id));
1246  }
1247  $grp_team->setValue($grp_value);
1248  $form->addItem($grp_team);
1249  } else {
1250  $grp_team = new ilNonEditableValueGUI($group["title"]);
1251  $grp_team->setValue($lng->txt("exc_adopt_group_teams_no_members"));
1252  $form->addItem($grp_team);
1253  }
1254  }
1255 
1256  if (sizeof($all_members)) {
1257  $form->addCommandButton("createTeamsFromGroups", $lng->txt("save"));
1258  }
1259  $form->addCommandButton("members", $lng->txt("cancel"));
1260 
1261  return $form;
1262  }
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:
Create styles array
The data for the language used.
This class represents a non editable value in a property form.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ 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 1618 of file class.ilExerciseManagementGUI.php.

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

Referenced by handleIndividualDeadlineCallsObject().

1619  {
1620  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
1621  $form = new ilPropertyFormGUI();
1622  $form->setFormAction($this->ctrl->getFormAction($this));
1623  $form->setName("ilExcIDlForm");
1624 
1625  include_once "Services/User/classes/class.ilUserUtil.php";
1626  foreach ($ids as $ass_id => $users) {
1627  $ass = $a_ass_map[$ass_id];
1628 
1630  $section->setTitle($ass->getTitle());
1631  $form->addItem($section);
1632 
1633  include_once("./Modules/Exercise/classes/class.ilExAssignmentTeam.php");
1634  $teams = ilExAssignmentTeam::getInstancesFromMap($ass->getId());
1635 
1636  $values = $ass->getIndividualDeadlines();
1637 
1638  foreach ($users as $id) {
1639  // single user
1640  if (is_numeric($id)) {
1642  $name = $name["lastname"] . ", " . $name["firstname"];
1643  }
1644  // team
1645  else {
1646  $name = "";
1647  $team_id = (int) substr($id, 1);
1648  if (array_key_exists($team_id, $teams)) {
1649  $name = array();
1650  foreach ($teams[$team_id]->getMembers() as $member_id) {
1651  $uname = ilObjUser::_lookupName($member_id);
1652  $name[] = $uname["lastname"] . ", " . $uname["firstname"];
1653  }
1654  asort($name);
1655  $name = implode("<br />", $name);
1656  }
1657  }
1658 
1659  $dl = new ilDateTimeInputGUI($name, "dl_" . $ass_id . "_" . $id);
1660  $dl->setShowTime(true);
1661  $dl->setRequired(true);
1662  $form->addItem($dl);
1663 
1664  if (array_key_exists($id, $values)) {
1665  $dl->setDate(new ilDateTime($values[$id], IL_CAL_UNIX));
1666  }
1667  }
1668  }
1669 
1670  $form->addCommandButton("", $this->lng->txt("save"));
1671 
1672  return $form;
1673  }
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($format !==null) $name
Definition: metadata.php:146
if(isset($_POST['submit'])) $form
Date and time handling
Create styles array
The data for the language used.
$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 1487 of file class.ilExerciseManagementGUI.php.

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

Referenced by membersObject(), and showParticipantObject().

1488  {
1489  $lng = $this->lng;
1490  $tpl = $this->tpl;
1491 
1492  // prepare modal+
1493  include_once "./Services/UIComponent/Modal/classes/class.ilModalGUI.php";
1494  $modal = ilModalGUI::getInstance();
1495  $modal->setHeading($lng->txt("exc_individual_deadline"));
1496  $modal->setId("ilExcIDl");
1497  $modal->setBody('<div id="ilExcIDlBody"></div>');
1498  $modal = $modal->getHTML();
1499 
1500  $ajax_url = $this->ctrl->getLinkTarget($this, "handleIndividualDeadlineCalls", "", true, false);
1501 
1502  $tpl->addJavaScript("./Modules/Exercise/js/ilExcIDl.js", true, 3);
1503  $tpl->addOnloadCode('il.ExcIDl.init("' . $ajax_url . '");');
1504 
1505  include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
1507 
1508  return $modal;
1509  }
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 1364 of file class.ilExerciseManagementGUI.php.

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

Referenced by showMultiFeedbackObject(), and uploadMultiFeedbackObject().

1365  {
1366  $lng = $this->lng;
1367 
1368  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1369  $form = new ilPropertyFormGUI();
1370  $form->addCommandButton("uploadMultiFeedback", $lng->txt("upload"));
1371  $form->addCommandButton("members", $lng->txt("cancel"));
1372 
1373  // multi feedback file
1374  $fi = new ilFileInputGUI($lng->txt("exc_multi_feedback_file"), "mfzip");
1375  $fi->setSuffixes(array("zip"));
1376  $fi->setRequired(true);
1377  $form->addItem($fi);
1378 
1379  $form->setTitle(ilExAssignment::lookupTitle($a_ass_id));
1380  $form->setFormAction($this->ctrl->getFormAction($this, "uploadMultiFeedback"));
1381 
1382  return $form;
1383  }
This class represents a property form user interface.
This class represents a file property in a property form.
if(isset($_POST['submit'])) $form
Create styles array
The data for the language used.
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 210 of file class.ilExerciseManagementGUI.php.

References getViewBack().

Referenced by executeCommand().

211  {
212  $back_cmd = $this->getViewBack();
213  $this->ctrl->setReturn($this, $back_cmd);
214 
215  $this->tabs_gui->clearTargets();
216  $this->tabs_gui->setBackTarget(
217  $this->lng->txt("back"),
218  $this->ctrl->getLinkTarget($this, $back_cmd)
219  );
220 
221  include_once "Modules/Exercise/classes/class.ilExSubmission.php";
222  return new ilExSubmission($this->assignment, $_REQUEST["member_id"], null, true);
223  }
Exercise submission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listTextAssignmentObject()

ilExerciseManagementGUI::listTextAssignmentObject (   $a_show_peer_review = false)

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

References $ctrl, $ilCtrl, $lng, $tabs_gui, $tbl, $tpl, and ilExAssignment\TYPE_TEXT.

Referenced by listTextAssignmentWithPeerReviewObject().

453  {
454  $tpl = $this->tpl;
456  $ilTabs = $this->tabs_gui;
457  $lng = $this->lng;
458 
459  if (!$this->assignment || $this->assignment->getType() != ilExAssignment::TYPE_TEXT) {
460  $ilCtrl->redirect($this, "members");
461  }
462 
463  $ilTabs->clearTargets();
464  $ilTabs->setBackTarget(
465  $lng->txt("back"),
466  $ilCtrl->getLinkTarget($this, "members")
467  );
468 
469  if ($a_show_peer_review) {
470  $cmd = "listTextAssignmentWithPeerReview";
471  } else {
472  $cmd = "listTextAssignment";
473  }
474  include_once "Modules/Exercise/classes/class.ilExAssignmentListTextTableGUI.php";
475  $tbl = new ilExAssignmentListTextTableGUI($this, $cmd, $this->assignment, $a_show_peer_review);
476  $tpl->setContent($tbl->getHTML());
477  }
$tbl
Definition: example_048.php:81
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ listTextAssignmentWithPeerReviewObject()

ilExerciseManagementGUI::listTextAssignmentWithPeerReviewObject ( )

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

References listTextAssignmentObject().

448  {
449  $this->listTextAssignmentObject(true);
450  }
listTextAssignmentObject($a_show_peer_review=false)
+ Here is the call graph for this function:

◆ membersApplyObject()

ilExerciseManagementGUI::membersApplyObject ( )

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

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

402  {
403  $this->saveStatusAllObject(null, false);
404  include_once("./Modules/Exercise/classes/class.ilExerciseMemberTableGUI.php");
405  $exc_tab = new ilExerciseMemberTableGUI($this, "members", $this->exercise, $this->assignment->getId());
406  $exc_tab->resetOffset();
407  $exc_tab->writeFilterToSession();
408 
409  $this->membersObject();
410  }
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 280 of file class.ilExerciseManagementGUI.php.

References $ctrl, $GLOBALS, $ilCtrl, $lng, $options, $si, $toolbar, $tpl, addSubTabs(), array, 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().

281  {
282  $tpl = $this->tpl;
283  $ilToolbar = $this->toolbar;
285  $lng = $this->lng;
286 
287  include_once 'Services/Tracking/classes/class.ilLPMarks.php';
288 
289  $this->addSubTabs("assignment");
290 
291  // assignment selection
292  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
293  $ass = ilExAssignment::getInstancesByExercise($this->exercise->getId());
294 
295  if (!$this->assignment) {
296  $this->assignment = current($ass);
297  }
298 
299  reset($ass);
300  if (count($ass) > 1) {
301  $options = array();
302  foreach ($ass as $a) {
303  $options[$a->getId()] = $a->getTitle();
304  }
305  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
306  $si = new ilSelectInputGUI($this->lng->txt(""), "ass_id");
307  $si->setOptions($options);
308  $si->setValue($this->assignment->getId());
309  $ilToolbar->addStickyItem($si);
310 
311  include_once("./Services/UIComponent/Button/classes/class.ilSubmitButton.php");
312  $button = ilSubmitButton::getInstance();
313  $button->setCaption("exc_select_ass");
314  $button->setCommand("selectAssignment");
315  $ilToolbar->addStickyItem($button);
316 
317  $ilToolbar->addSeparator();
318  }
319  // #16165 - if only 1 assignment dropdown is not displayed;
320  elseif ($this->assignment) {
321  $ilCtrl->setParameter($this, "ass_id", $this->assignment->getId());
322  }
323 
324  // add member
325  // is only shown if 'edit_submissions_grades' is granted by rbac. positions
326  // access is not sufficient.
327  $has_rbac_access = $GLOBALS['DIC']->access()->checkAccess(
328  'edit_submissions_grades',
329  '',
330  $this->exercise->getRefId()
331  );
332  if ($has_rbac_access) {
333  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
335  $this,
336  $ilToolbar,
337  array(
338  'auto_complete_name' => $lng->txt('user'),
339  'submit_name' => $lng->txt('add'),
340  'add_search' => true,
341  'add_from_container' => $this->exercise->getRefId()
342  )
343  );
344  }
345 
346  // #16168 - no assignments
347  if (count($ass) > 0) {
348  if ($has_rbac_access) {
349  $ilToolbar->addSeparator();
350  }
351 
352  // we do not want the ilRepositorySearchGUI form action
353  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
354 
355  $ilCtrl->setParameter($this, "ass_id", $this->assignment->getId());
356 
357  if ($this->assignment->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) {
358  include_once("./Modules/Exercise/classes/class.ilExAssignmentTeam.php");
359  if (ilExAssignmentTeam::getAdoptableGroups($this->exercise->getRefId())) {
360  $ilToolbar->addButton(
361  $this->lng->txt("exc_adopt_group_teams"),
362  $this->ctrl->getLinkTarget($this, "adoptTeamsFromGroup")
363  );
364 
365  $ilToolbar->addSeparator();
366  }
367  } elseif ($this->exercise->hasTutorFeedbackFile()) {
368  // multi-feedback
369  $ilToolbar->addButton(
370  $this->lng->txt("exc_multi_feedback"),
371  $this->ctrl->getLinkTarget($this, "showMultiFeedback")
372  );
373 
374  $ilToolbar->addSeparator();
375  }
376 
377  if (ilExSubmission::hasAnySubmissions($this->assignment->getId())) {
378  if ($this->assignment->getType() == ilExAssignment::TYPE_TEXT) {
379  $ilToolbar->addFormButton($lng->txt("exc_list_text_assignment"), "listTextAssignment");
380  } else {
381  $ilToolbar->addFormButton($lng->txt("download_all_returned_files"), "downloadAll");
382  }
383  }
384  $this->ctrl->setParameter($this, "vw", self::VIEW_ASSIGNMENT);
385 
386  include_once("./Modules/Exercise/classes/class.ilExerciseMemberTableGUI.php");
387  $exc_tab = new ilExerciseMemberTableGUI($this, "members", $this->exercise, $this->assignment->getId());
388  $tpl->setContent(
389  $exc_tab->getHTML() .
391  );
392  } else {
393  ilUtil::sendInfo($lng->txt("exc_no_assignments_available"));
394  }
395 
396  $ilCtrl->setParameter($this, "ass_id", "");
397 
398  return;
399  }
static getAdoptableGroups($a_exc_ref_id)
This class represents a selection list property in a property form.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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)
Create styles array
The data for the language used.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ membersResetObject()

ilExerciseManagementGUI::membersResetObject ( )

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

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

413  {
414  include_once("./Modules/Exercise/classes/class.ilExerciseMemberTableGUI.php");
415  $exc_tab = new ilExerciseMemberTableGUI($this, "members", $this->exercise, $this->assignment->getId());
416  $exc_tab->resetOffset();
417  $exc_tab->resetFilter();
418 
419  $this->membersObject();
420  }
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 1511 of file class.ilExerciseManagementGUI.php.

References $assignment, and array.

Referenced by handleIndividualDeadlineCallsObject().

1512  {
1513  if ($a_data) {
1514  $map = array();
1515  $ass_tmp = array();
1516  foreach ($a_data as $item) {
1517  $item = explode("_", $item);
1518  $ass_id = $item[0];
1519  $user_id = $item[1];
1520 
1521  if (!array_key_exists($ass_id, $ass_tmp)) {
1522  if ($this->assignment &&
1523  $ass_id == $this->assignment->getId()) {
1524  $ass_tmp[$ass_id] = $this->assignment;
1525  } else {
1526  $ass_tmp[$ass_id] = new ilExAssignment($ass_id);
1527  }
1528  }
1529 
1530  $map[$ass_id][] = $user_id;
1531  }
1532 
1533  return array($map, $ass_tmp);
1534  }
1535  }
Exercise assignment.
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ redirectFeedbackMailObject()

ilExerciseManagementGUI::redirectFeedbackMailObject ( )

set feedback status for member and redirect to mail screen

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

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

722  {
723  $members = array();
724 
725  if ($_GET["member_id"] != "") {
726  $submission = new ilExSubmission($this->assignment, $_GET["member_id"]);
727  $members = $submission->getUserIds();
728  } elseif ($members = $this->getMultiActionUserIds()) {
729  $members = array_keys($members);
730  }
731 
732  if ($members) {
733  $logins = array();
734  foreach ($members as $user_id) {
735  $member_status = $this->assignment->getMemberStatus($user_id);
736  $member_status->setFeedback(true);
737  $member_status->update();
738 
739  $logins[] = ilObjUser::_lookupLogin($user_id);
740  }
741  $logins = implode($logins, ",");
742 
743  // #16530 - see ilObjCourseGUI::createMailSignature
744  $sig = chr(13) . chr(10) . chr(13) . chr(10);
745  $sig .= $this->lng->txt('exc_mail_permanent_link');
746  $sig .= chr(13) . chr(10) . chr(13) . chr(10);
747  include_once './Services/Link/classes/class.ilLink.php';
748  $sig .= ilLink::_getLink($this->exercise->getRefId());
749  $sig = rawurlencode(base64_encode($sig));
750 
751  require_once 'Services/Mail/classes/class.ilMailFormCall.php';
753  $this,
754  $this->getViewBack(),
755  array(),
756  array(
757  'type' => 'new',
758  'rcp_to' => $logins,
760  )
761  ));
762  }
763  }
static _lookupLogin($a_user_id)
lookup login
$_GET["client_id"]
Create styles array
The data for the language used.
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.
static redirect($a_script)
+ Here is the call graph for this function:

◆ saveCommentForLearnersObject()

ilExerciseManagementGUI::saveCommentForLearnersObject ( )

Save comment for learner (asynch)

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

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

1058  {
1059  $res = array("result"=>false);
1060 
1061  if ($this->ctrl->isAsynch()) {
1062  $ass_id = (int) $_POST["ass_id"];
1063  $user_id = (int) $_POST["mem_id"];
1064  $comment = trim($_POST["comm"]);
1065 
1066  if ($ass_id && $user_id) {
1067  $submission = new ilExSubmission($this->assignment, $user_id);
1068  $user_ids = $submission->getUserIds();
1069 
1070  $all_members = new ilExerciseMembers($this->exercise);
1071  $all_members = $all_members->getMembers();
1072 
1073  $reci_ids = array();
1074  foreach ($user_ids as $user_id) {
1075  if (in_array($user_id, $all_members)) {
1076  $member_status = $this->assignment->getMemberStatus($user_id);
1077  $member_status->setComment(ilUtil::stripSlashes($comment));
1078  $member_status->setFeedback(true);
1079  $member_status->update();
1080 
1081  if (trim($comment)) {
1082  $reci_ids[] = $user_id;
1083  }
1084  }
1085  }
1086 
1087  if (sizeof($reci_ids)) {
1088  // send notification
1089  $this->exercise->sendFeedbackFileNotification(
1090  null,
1091  $reci_ids,
1092  $ass_id,
1093  true
1094  );
1095  }
1096 
1097  $res = array("result"=>true, "snippet"=>nl2br($comment));
1098  }
1099  }
1100 
1101  echo(json_encode($res));
1102  exit();
1103  }
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
Create styles array
The data for the language used.
Exercise submission.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveCommentsObject()

ilExerciseManagementGUI::saveCommentsObject ( )

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

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

917  {
918  if (!isset($_POST['comments_value'])) {
919  return;
920  }
921 
922  $this->exercise->members_obj->setNoticeForMember(
923  $_GET["member_id"],
924  ilUtil::stripSlashes($_POST["comments_value"])
925  );
926  ilUtil::sendSuccess($this->lng->txt("exc_members_comments_saved"));
927  $this->membersObject();
928  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_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:

◆ saveGradesObject()

ilExerciseManagementGUI::saveGradesObject ( )

Save grades.

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

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

426  {
428  $lng = $this->lng;
429 
430  include_once 'Services/Tracking/classes/class.ilLPMarks.php';
431 
432  if (is_array($_POST["lcomment"])) {
433  foreach ($_POST["lcomment"] as $k => $v) {
434  $marks_obj = new ilLPMarks($this->exercise->getId(), (int) $k);
435  $marks_obj->setComment(ilUtil::stripSlashes($v));
436  $marks_obj->setMark(ilUtil::stripSlashes($_POST["mark"][$k]));
437  $marks_obj->update();
438  }
439  }
440  ilUtil::sendSuccess($lng->txt("exc_msg_saved_grades"), true);
441  $ilCtrl->redirect($this, "showGradesOverview");
442  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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 1474 of file class.ilExerciseManagementGUI.php.

References $_POST, and ilUtil\sendSuccess().

1475  {
1476  $this->assignment->saveMultiFeedbackFiles($_POST["file"], $this->exercise);
1477 
1478  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1479  $this->ctrl->redirect($this, "members");
1480  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveStatus()

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

Save status of selecte members.

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

References $ctrl, $ilCtrl, $users, ilObjUser\_lookupName(), array, getViewBack(), and ilUtil\sendSuccess().

Referenced by saveStatusAllObject(), and saveStatusParticipantObject().

1008  {
1009  $ilCtrl = $this->ctrl;
1010 
1011  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
1012 
1013  $saved_for = array();
1014  foreach ($a_data as $ass_id => $users) {
1015  $ass = ($ass_id < 0)
1016  ? $this->assignment
1017  : new ilExAssignment($ass_id);
1018  foreach ($users as $user_id => $values) {
1019  // this will add team members if available
1020  $submission = new ilExSubmission($ass, $user_id);
1021  foreach ($submission->getUserIds() as $sub_user_id) {
1022  $uname = ilObjUser::_lookupName($sub_user_id);
1023  $saved_for[$sub_user_id] = $uname["lastname"] . ", " . $uname["firstname"];
1024 
1025  $member_status = $ass->getMemberStatus($sub_user_id);
1026 
1027  // see bug #22566
1028  $status = $values["status"];
1029  if ($status == "") {
1030  $status = "notgraded";
1031  }
1032  $member_status->setStatus($status);
1033  if (array_key_exists("mark", $values)) {
1034  $member_status->setMark($values["mark"]);
1035  }
1036  if (array_key_exists("notice", $values)) {
1037  $member_status->setNotice($values["notice"]);
1038  }
1039  $member_status->update();
1040  }
1041  }
1042  }
1043 
1044  if (count($saved_for) > 0) {
1045  $save_for_str = "(" . implode($saved_for, " - ") . ")";
1046  }
1047 
1048  if ($a_redirect) {
1049  ilUtil::sendSuccess($this->lng->txt("exc_status_saved") . " " . $save_for_str, true);
1050  $ilCtrl->redirect($this, $this->getViewBack());
1051  }
1052  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupName($a_user_id)
lookup user name
Exercise assignment.
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
$users
Definition: authpage.php:44
Exercise submission.
+ 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 962 of file class.ilExerciseManagementGUI.php.

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

Referenced by membersApplyObject(), and saveStatusSelectedObject().

963  {
964  $user_ids = (array) array_keys((array) $_POST['id']);
965  $filtered_user_ids = $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
966  'edit_submissions_grades',
967  'edit_submissions_grades',
968  $this->exercise->getRefId(),
969  $user_ids
970  );
971 
972  $data = array();
973  foreach ($filtered_user_ids as $user_id) {
974  if (is_array($a_selected) &&
975  !in_array($user_id, $a_selected)) {
976  continue;
977  }
978 
979  $data[-1][$user_id] = array(
980  "status" => ilUtil::stripSlashes($_POST["status"][$user_id])
981  );
982 
983  if (array_key_exists("mark", $_POST)) {
984  $data[-1][$user_id]["mark"] = ilUtil::stripSlashes($_POST["mark"][$user_id]);
985  }
986  if (array_key_exists("notice", $_POST)) {
987  $data[-1][$user_id]["notice"] = ilUtil::stripSlashes($_POST["notice"][$user_id]);
988  }
989  }
990  $this->saveStatus($data, $a_redirect);
991  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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
Create styles array
The data for the language used.
$_POST["username"]
+ 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 933 of file class.ilExerciseManagementGUI.php.

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

Referenced by saveStatusSelectedObject().

934  {
936 
937  $member_id = (int) $_GET["part_id"];
938  $data = array();
939  foreach (array_keys($_POST["id"]) as $ass_id) {
940  if (is_array($a_selected) &&
941  !in_array($ass_id, $a_selected)) {
942  continue;
943  }
944 
945  $data[$ass_id][$member_id] = array(
946  "status" => ilUtil::stripSlashes($_POST["status"][$ass_id])
947  );
948 
949  if (array_key_exists("mark", $_POST)) {
950  $data[$ass_id][$member_id]["mark"] = ilUtil::stripSlashes($_POST["mark"][$ass_id]);
951  }
952  if (array_key_exists("notice", $_POST)) {
953  $data[$ass_id][$member_id]["notice"] = ilUtil::stripSlashes($_POST["notice"][$ass_id]);
954  }
955  }
956 
957  $ilCtrl->setParameter($this, "part_id", $member_id); // #17629
958  $this->saveStatus($data);
959  }
$_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
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveStatusSelectedObject()

ilExerciseManagementGUI::saveStatusSelectedObject ( )

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

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

994  {
995  $members = $this->getMultiActionUserIds();
996 
997  if ($this->assignment) {
998  $this->saveStatusAllObject(array_keys($members));
999  } else {
1000  $this->saveStatusParticipantObject(array_keys($members));
1001  }
1002  }
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 552 of file class.ilExerciseManagementGUI.php.

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

553  {
554  $_GET["ass_id"] = ilUtil::stripSlashes($_POST["ass_id"]);
555  $this->membersObject();
556  }
$_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 671 of file class.ilExerciseManagementGUI.php.

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

672  {
673  $_GET["part_id"] = ilUtil::stripSlashes($_POST["part_id"]);
674  $this->showParticipantObject();
675  }
$_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 852 of file class.ilExerciseManagementGUI.php.

References $_GET, $users, getMultiActionUserIds(), and ilUtil\sendSuccess().

853  {
854  $members = $this->getMultiActionUserIds();
855 
856  ilUtil::sendSuccess($this->lng->txt("exc_sent"), true);
857  if ($this->assignment) {
858  $this->exercise->sendAssignment($this->assignment, array_keys($members));
859  $this->ctrl->redirect($this, "members");
860  } else {
861  foreach ($members as $ass_id => $users) {
862  $this->exercise->sendAssignment(new ilExAssignment($ass_id), $users);
863  }
864  $this->ctrl->setParameter($this, "part_id", $_GET["part_id"]); // #17629
865  $this->ctrl->redirect($this, "showParticipant");
866  }
867  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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 1675 of file class.ilExerciseManagementGUI.php.

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

1676  {
1677  // this will only get called if no selection
1678  ilUtil::sendFailure($this->lng->txt("select_one"));
1679 
1680  if ($this->assignment) {
1681  $this->membersObject();
1682  } else {
1683  $this->showParticipantObject();
1684  }
1685  }
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 680 of file class.ilExerciseManagementGUI.php.

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

681  {
682  $tpl = $this->tpl;
683  $ilToolbar = $this->toolbar;
685  $lng = $this->lng;
686 
687  $this->addSubTabs("grades");
688 
689  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
690  $mem_obj = new ilExerciseMembers($this->exercise);
691  $mems = $mem_obj->getMembers();
692 
693  $mems = $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
694  'edit_submissions_grades',
695  'edit_submissions_grades',
696  $this->exercise->getRefId(),
697  $mems
698  );
699  if (count($mems) > 0) {
700  $ilToolbar->addButton(
701  $lng->txt("exc_export_excel"),
702  $ilCtrl->getLinkTarget($this, "exportExcel")
703  );
704  }
705 
706  $this->ctrl->setParameter($this, "vw", self::VIEW_GRADES);
707 
708  include_once("./Modules/Exercise/classes/class.ilExGradesTableGUI.php");
709  $grades_tab = new ilExGradesTableGUI(
710  $this,
711  "showGradesOverview",
712  $this->exercise,
713  $mem_obj
714  );
715  $tpl->setContent($grades_tab->getHTML());
716  }
Class ilExerciseMembers.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilCtrl
Definition: ilias.php:18
addSubTabs($a_activate)
adds tabs to tab gui object
Exercise participant table.
+ Here is the call graph for this function:

◆ showMultiFeedbackConfirmationTableObject()

ilExerciseManagementGUI::showMultiFeedbackConfirmationTableObject ( )

Show multi feedback confirmation table.

Parameters

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

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

1452  {
1453  $tpl = $this->tpl;
1454 
1455  $this->addSubTabs("assignment");
1456 
1457  include_once("./Modules/Exercise/classes/class.ilFeedbackConfirmationTable2GUI.php");
1458  $tab = new ilFeedbackConfirmationTable2GUI($this, "showMultiFeedbackConfirmationTable", $this->assignment);
1459  $tpl->setContent($tab->getHTML());
1460  }
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 1391 of file class.ilExerciseManagementGUI.php.

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

Referenced by uploadMultiFeedbackObject().

1392  {
1393  $ilToolbar = $this->toolbar;
1394  $lng = $this->lng;
1395  $tpl = $this->tpl;
1396 
1397  ilUtil::sendInfo($lng->txt("exc_multi_feedb_info"));
1398 
1399  $this->addSubTabs("assignment");
1400 
1401  // #13719
1402  include_once("./Services/UIComponent/Button/classes/class.ilLinkButton.php");
1403  $button = ilLinkButton::getInstance();
1404  $button->setCaption("exc_download_zip_structure");
1405  $button->setUrl($this->ctrl->getLinkTarget($this, "downloadMultiFeedbackZip"));
1406  $button->setOmitPreventDoubleSubmission(true);
1407  $ilToolbar->addButtonInstance($button);
1408 
1409  if (!$a_form) {
1410  $a_form = $this->initMultiFeedbackForm($this->assignment->getId());
1411  }
1412 
1413  $tpl->setContent($a_form->getHTML());
1414  }
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 648 of file class.ilExerciseManagementGUI.php.

References $_GET, and showParticipantObject().

649  {
650  include_once("./Modules/Exercise/classes/class.ilExParticipantTableGUI.php");
651  $exc_tab = new ilExParticipantTableGUI($this, "showParticipant", $this->exercise, $_GET["part_id"]);
652  $exc_tab->resetOffset();
653  $exc_tab->writeFilterToSession();
654 
655  $this->showParticipantObject();
656  }
$_GET["client_id"]
Exercise participant table.
+ Here is the call graph for this function:

◆ showParticipantObject()

ilExerciseManagementGUI::showParticipantObject ( )

Show Participant.

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

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

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

562  {
563  $tpl = $this->tpl;
564  $ilToolbar = $this->toolbar;
566  $lng = $this->lng;
567 
568  $this->addSubTabs("participant");
569  $this->ctrl->setParameter($this, "ass_id", "");
570 
571  // participant selection
572  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
573  $ass = ilExAssignment::getAssignmentDataOfExercise($this->exercise->getId());
574  $members = $this->exercise->members_obj->getMembers();
575 
576  $members = $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
577  'edit_submissions_grades',
578  'edit_submissions_grades',
579  $this->exercise->getRefId(),
580  $members
581  );
582 
583 
584  if (count($members) == 0) {
585  ilUtil::sendInfo($lng->txt("exc_no_participants"));
586  return;
587  }
588 
589  $mems = array();
590  foreach ($members as $mem_id) {
591  if (ilObject::_lookupType($mem_id) == "usr") {
592  include_once("./Services/User/classes/class.ilObjUser.php");
593  $name = ilObjUser::_lookupName($mem_id);
594  if (trim($name["login"]) != "") { // #20073
595  $mems[$mem_id] = $name;
596  }
597  }
598  }
599 
600  $mems = ilUtil::sortArray($mems, "lastname", "asc", false, true);
601 
602  if ($_GET["part_id"] == "" && count($mems) > 0) {
603  $_GET["part_id"] = key($mems);
604  }
605 
606  $current_participant = $_GET["part_id"];
607 
608  reset($mems);
609  if (count($mems) > 1) {
610  $options = array();
611  foreach ($mems as $k => $m) {
612  $options[$k] =
613  $m["lastname"] . ", " . $m["firstname"] . " [" . $m["login"] . "]";
614  }
615  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
616  $si = new ilSelectInputGUI($this->lng->txt(""), "part_id");
617  $si->setOptions($options);
618  $si->setValue($current_participant);
619  $ilToolbar->addStickyItem($si);
620 
621  include_once("./Services/UIComponent/Button/classes/class.ilSubmitButton.php");
622  $button = ilSubmitButton::getInstance();
623  $button->setCaption("exc_select_part");
624  $button->setCommand("selectParticipant");
625  $ilToolbar->addStickyItem($button);
626 
627  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
628  }
629 
630  if (count($mems) > 0) {
631  $this->ctrl->setParameter($this, "vw", self::VIEW_PARTICIPANT);
632  $this->ctrl->setParameter($this, "part_id", $current_participant);
633 
634  include_once("./Modules/Exercise/classes/class.ilExParticipantTableGUI.php");
635  $part_tab = new ilExParticipantTableGUI(
636  $this,
637  "showParticipant",
638  $this->exercise,
639  $current_participant
640  );
641  $tpl->setContent($part_tab->getHTML() .
642  $this->initIndividualDeadlineModal());
643  } else {
644  ilUtil::sendInfo($this->lng->txt("exc_no_assignments_available"));
645  }
646  }
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.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if($format !==null) $name
Definition: metadata.php:146
addSubTabs($a_activate)
adds tabs to tab gui object
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showParticipantResetObject()

ilExerciseManagementGUI::showParticipantResetObject ( )

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

References $_GET, and showParticipantObject().

659  {
660  include_once("./Modules/Exercise/classes/class.ilExParticipantTableGUI.php");
661  $exc_tab = new ilExParticipantTableGUI($this, "showParticipant", $this->exercise, $_GET["part_id"]);
662  $exc_tab->resetOffset();
663  $exc_tab->resetFilter();
664 
665  $this->showParticipantObject();
666  }
$_GET["client_id"]
Exercise participant table.
+ Here is the call graph for this function:

◆ uploadMultiFeedbackObject()

ilExerciseManagementGUI::uploadMultiFeedbackObject ( )

Upload multi feedback file.

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

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

1428  {
1429  // #11983
1430  $form = $this->initMultiFeedbackForm($this->assignment->getId());
1431  if ($form->checkInput()) {
1432  try {
1433  $this->assignment->uploadMultiFeedbackFile(ilUtil::stripSlashesArray($_FILES["mfzip"]));
1434  $this->ctrl->redirect($this, "showMultiFeedbackConfirmationTable");
1435  } catch (ilExerciseException $e) {
1436  ilUtil::sendFailure($e->getMessage(), true);
1437  $this->ctrl->redirect($this, "showMultiFeedback");
1438  }
1439  }
1440 
1441  $form->setValuesByPost();
1443  }
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 265 of file class.ilExerciseManagementGUI.php.

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

266  {
267  $lng = $this->lng;
269 
270  $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "member_id", (int) $_GET["member_id"]);
271  $url = $ilCtrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilExerciseHandlerGUI", "ilObjExerciseGUI", "ilExerciseManagementGUI", "ilExSubmissionFileGUI"), "downloadNewReturned");
272  $js_url = $ilCtrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilExerciseHandlerGUI", "ilObjExerciseGUI", "ilExerciseManagementGUI", "ilExSubmissionFileGUI"), "downloadNewReturned", "", "", false);
273  ilUtil::sendInfo($lng->txt("exc_wait_for_files") . "<a href='$url'> " . $lng->txt('exc_download_files') . "</a><script>window.location.href ='" . $js_url . "';</script>");
274  $this->membersObject();
275  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
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 46 of file class.ilExerciseManagementGUI.php.

Referenced by parseIndividualDeadlineData().

◆ $ctrl

◆ $exercise

ilExerciseManagementGUI::$exercise
protected

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

◆ $lng

◆ $tabs_gui

ilExerciseManagementGUI::$tabs_gui
protected

◆ $toolbar

ilExerciseManagementGUI::$toolbar
protected

◆ $tpl

◆ VIEW_ASSIGNMENT

const ilExerciseManagementGUI::VIEW_ASSIGNMENT = 1

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

◆ VIEW_GRADES

const ilExerciseManagementGUI::VIEW_GRADES = 3

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

◆ VIEW_PARTICIPANT

const ilExerciseManagementGUI::VIEW_PARTICIPANT = 2

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


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