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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilExAssignmentTeam:

Public Member Functions

 __construct (?int $a_id=null)
 
 getId ()
 
 createTeam (int $a_assignment_id, int $a_user_id)
 
 getMembers ()
 
 getMembersOfAllTeams ()
 Get members for all teams of assignment. More...
 
 addTeamMember (int $a_user_id, ?int $a_exc_ref_id=null)
 
 removeTeamMember (int $a_user_id, ?int $a_exc_ref_id=null)
 
 writeLog (int $a_action, ?string $a_details=null)
 
 getLog ()
 
 sendNotification (int $a_exc_ref_id, int $a_user_id, string $a_action)
 Send notification about team status. More...
 
 createRandomTeams (int $a_exercise_id, int $a_assignment_id, int $a_number_teams, int $a_min_participants)
 Create random teams for assignment type "team upload" following specific rules. More...
 

Static Public Member Functions

static getInstanceByUserId (int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
 
static getInstancesFromMap (int $a_assignment_id)
 
static getTeamId (int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
 
static getAssignmentTeamMap (int $a_ass_id)
 
static writeTeamLog (int $a_team_id, int $a_action, ?string $a_details=null)
 Add entry to team log. More...
 
static getAdoptableTeamAssignments (int $a_exercise_id, ?int $a_exclude_ass_id=null, ?int $a_user_id=null)
 
static adoptTeams (int $a_source_ass_id, int $a_target_ass_id, ?int $a_user_id=null, ?int $a_exc_ref_id=null)
 
static getAdoptableGroups (int $a_exc_ref_id)
 
static getGroupMembersMap (int $a_exc_ref_id)
 

Data Fields

const TEAM_LOG_CREATE_TEAM = 1
 
const TEAM_LOG_ADD_MEMBER = 2
 
const TEAM_LOG_REMOVE_MEMBER = 3
 
const TEAM_LOG_ADD_FILE = 4
 
const TEAM_LOG_REMOVE_FILE = 5
 

Protected Member Functions

 read (int $a_id)
 
 cleanLog ()
 Remove obsolete log entries. More...
 

Protected Attributes

ILIAS Exercise Team TeamManager $team_manager
 
ILIAS Exercise Team TeamDBRepository $repo
 
ilDBInterface $db
 
ilObjUser $user
 
int $id = null
 
int $assignment_id
 
array $members = array()
 

Private Member Functions

 setId (?int $a_id)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Exercise assignment team

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.ilExAssignmentTeam.php.

Constructor & Destructor Documentation

◆ __construct()

ilExAssignmentTeam::__construct ( ?int  $a_id = null)

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

42 {
43 global $DIC;
44 $this->db = $DIC->database();
45 $this->user = $DIC->user();
46 $this->repo = $DIC->exercise()->internal()->repo()->team();
47 $this->team_manager = $DIC->exercise()->internal()->domain()->team();
48 if ($a_id) {
49 $this->read($a_id);
50 }
51 }
global $DIC
Definition: shib_login.php:26

References $DIC, read(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addTeamMember()

ilExAssignmentTeam::addTeamMember ( int  $a_user_id,
?int  $a_exc_ref_id = null 
)
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 187 of file class.ilExAssignmentTeam.php.

190 : bool {
192
193 if (!$this->id) {
194 return false;
195 }
196
197 // must not be in any team already
198 if (!in_array($a_user_id, $this->getMembersOfAllTeams())) {
199
200 // get team status...
201 $status = $this->team_manager->getStatusForTeam($this->id);
202
203 $this->repo->addUser(
204 $this->id,
205 $this->assignment_id,
206 $a_user_id
207 );
208
209 // ...set status for new team member
210 $mem_stat = new ilExAssignmentMemberStatus(
211 $this->assignment_id,
212 $a_user_id
213 );
214 $mem_stat->setStatus($status);
215 $mem_stat->update();
216
217
218 if ($a_exc_ref_id) {
219 $this->sendNotification($a_exc_ref_id, $a_user_id, "add");
220 }
221
222 $this->writeLog(
223 self::TEAM_LOG_ADD_MEMBER,
225 );
226
227 $this->read($this->id);
228
229 return true;
230 }
231
232 return false;
233 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getMembersOfAllTeams()
Get members for all teams of assignment.
sendNotification(int $a_exc_ref_id, int $a_user_id, string $a_action)
Send notification about team status.
writeLog(int $a_action, ?string $a_details=null)
static _lookupFullname(int $a_user_id)

◆ adoptTeams()

static ilExAssignmentTeam::adoptTeams ( int  $a_source_ass_id,
int  $a_target_ass_id,
?int  $a_user_id = null,
?int  $a_exc_ref_id = null 
)
static
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 439 of file class.ilExAssignmentTeam.php.

444 : void {
445 $teams = array();
446
447 $old_team = null;
448 foreach (self::getAssignmentTeamMap($a_source_ass_id) as $user_id => $team_id) {
449 $teams[$team_id][] = $user_id;
450
451 if ($a_user_id && $user_id == $a_user_id) {
452 $old_team = $team_id;
453 }
454 }
455
456 if ($a_user_id) {
457 // no existing team (in source) or user already in team (in current)
458 if (!$old_team ||
459 self::getInstanceByUserId($a_target_ass_id, $a_user_id)->getId()) {
460 return;
461 }
462 }
463
464 $current_map = self::getAssignmentTeamMap($a_target_ass_id);
465
466 foreach ($teams as $team_id => $user_ids) {
467 if (!$old_team || $team_id == $old_team) {
468 // only not assigned users
469 $missing = array();
470 foreach ($user_ids as $user_id) {
471 if (!array_key_exists($user_id, $current_map)) {
472 $missing[] = $user_id;
473 }
474 }
475
476 if ($missing !== []) {
477 // create new team
478 $first = array_shift($missing);
479 $new_team = self::getInstanceByUserId($a_target_ass_id, $first, true);
480
481 // give new team starting time of original user
482 if ($a_user_id > 0 && $old_team > 0) {
483 $idl = ilExcIndividualDeadline::getInstance($a_target_ass_id, $a_user_id);
484 if ($idl->getStartingTimestamp()) {
485 $idl_team = ilExcIndividualDeadline::getInstance($a_target_ass_id, $new_team->getId(), true);
486 $idl_team->setStartingTimestamp($idl->getStartingTimestamp());
487 $idl_team->save();
488 }
489 }
490
491 if ($a_exc_ref_id) {
492 // getTeamId() does NOT send notification
493 $new_team->sendNotification($a_exc_ref_id, $first, "add");
494 }
495
496 foreach ($missing as $user_id) {
497 $new_team->addTeamMember($user_id, $a_exc_ref_id);
498 }
499 }
500 }
501 }
502 }
static getAssignmentTeamMap(int $a_ass_id)
static getInstanceByUserId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
static getInstance(int $a_ass_id, int $a_participant_id, bool $a_is_team=false)

References $user_id.

Referenced by ilExSubmissionTeamGUI\createAdoptedTeamObject(), and ilExAssignmentEditorGUI\generateTeams().

+ Here is the caller graph for this function:

◆ cleanLog()

ilExAssignmentTeam::cleanLog ( )
protected

Remove obsolete log entries.

As there is no proper team deletion event, we are doing it this way

Definition at line 334 of file class.ilExAssignmentTeam.php.

334 : void
335 {
337
338 // #18179
339
340 // see also #31565
341 $obsolete_teams = [];
342 $set = $ilDB->query("SELECT DISTINCT l.team_id as id FROM il_exc_team_log as l LEFT JOIN il_exc_team as t ON (l.team_id = t.id) WHERE t.id IS NULL;");
343 while ($row = $ilDB->fetchAssoc($set)) {
344 $obsolete_teams[] = $row["id"];
345 }
346
347 if (count($obsolete_teams) > 0) {
348 $q = "DELETE FROM il_exc_team_log" .
349 " WHERE " . $ilDB->in("team_id", $obsolete_teams, false, "integer");
350 $ilDB->manipulate($q);
351 }
352 }
$q
Definition: shib_logout.php:25

References $ilDB, and $q.

◆ createRandomTeams()

ilExAssignmentTeam::createRandomTeams ( int  $a_exercise_id,
int  $a_assignment_id,
int  $a_number_teams,
int  $a_min_participants 
)

Create random teams for assignment type "team upload" following specific rules.

example:

  • total exercise members : 9 members
  • total number of teams to create (defined via form): 4 groups
  • number of users per team --> 9 / 4 = 2 users
  • users to spread over groups --> 9 % 4 = 1 user
  • final teams: 3 teams of 2 users and 1 team of 3 users.
    Exceptions
    ilExcUnknownAssignmentTypeException
    Exception

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

562 : void {
563 //just in case...
564 if (count(self::getAssignmentTeamMap($a_assignment_id))) {
565 return;
566 }
567 $exercise = new ilObjExercise($a_exercise_id, false);
568 $obj_exc_members = new ilExerciseMembers($exercise);
569 $members = $obj_exc_members->getMembers();
570 $total_exc_members = count($members);
571 $number_of_teams = $a_number_teams;
572 if (!$number_of_teams) {
573 if ($a_min_participants) {
574 $number_of_teams = round($total_exc_members / $a_min_participants);
575 } else {
576 $number_of_teams = random_int(1, $total_exc_members);
577 }
578 }
579 $members_per_team = round($total_exc_members / $number_of_teams);
580 shuffle($members);
581 for ($i = 0;$i < $number_of_teams;$i++) {
582 $members_counter = 0;
583 while (!empty($members) && $members_counter < $members_per_team) {
584 $member_id = array_pop($members);
585 if ($members_counter == 0) {
586 $team_id = $this->createTeam($a_assignment_id, $member_id);
587 $this->setId($team_id);
588 $this->assignment_id = $a_assignment_id;
589 } else {
590 $this->addTeamMember($member_id);
591 }
592 $members_counter++;
593 }
594 }
595 //get the new teams, remove duplicates.
596 $teams = array_unique(array_values(self::getAssignmentTeamMap($a_assignment_id)));
597 shuffle($teams);
598 while (!empty($members)) {
599 $member_id = array_pop($members);
600 $team_id = array_pop($teams);
601 $this->setId($team_id);
602 $this->addTeamMember($member_id);
603 }
604 }
addTeamMember(int $a_user_id, ?int $a_exc_ref_id=null)
createTeam(int $a_assignment_id, int $a_user_id)
Class ilExerciseMembers.
Class ilObjExercise.
ilObjExercise $exercise

◆ createTeam()

ilExAssignmentTeam::createTeam ( int  $a_assignment_id,
int  $a_user_id 
)

Definition at line 146 of file class.ilExAssignmentTeam.php.

149 : int {
150
151 $id = $this->team_manager->create(
152 $a_assignment_id,
153 $a_user_id
154 );
155
156 self::writeTeamLog($id, self::TEAM_LOG_CREATE_TEAM);
158 $id,
159 self::TEAM_LOG_ADD_MEMBER,
161 );
162 return $id;
163 }
static writeTeamLog(int $a_team_id, int $a_action, ?string $a_details=null)
Add entry to team log.

◆ getAdoptableGroups()

static ilExAssignmentTeam::getAdoptableGroups ( int  $a_exc_ref_id)
static
Parameters
int$a_exc_ref_id
Returns
int[] group obj ids

Definition at line 512 of file class.ilExAssignmentTeam.php.

512 : array
513 {
514 global $DIC;
515
516 $tree = $DIC->repositoryTree();
517
518 $res = array();
519
520 $parent_ref_id = $tree->getParentId($a_exc_ref_id);
521 if ($parent_ref_id) {
522 foreach ($tree->getChildsByType($parent_ref_id, "grp") as $group) {
523 $res[] = $group["obj_id"];
524 }
525 }
526
527 return $res;
528 }
$res
Definition: ltiservices.php:69

References $DIC, and $res.

Referenced by ilExerciseManagementGUI\membersObject().

+ Here is the caller graph for this function:

◆ getAdoptableTeamAssignments()

static ilExAssignmentTeam::getAdoptableTeamAssignments ( int  $a_exercise_id,
?int  $a_exclude_ass_id = null,
?int  $a_user_id = null 
)
static

Definition at line 385 of file class.ilExAssignmentTeam.php.

389 : array {
390 $res = array();
391
393 foreach ($data as $row) {
394 if ($a_exclude_ass_id && $row["id"] == $a_exclude_ass_id) {
395 continue;
396 }
397
398 if ($row["type"] == ilExAssignment::TYPE_UPLOAD_TEAM) {
399 $map = self::getAssignmentTeamMap($row["id"]);
400
401 if ($a_user_id && !array_key_exists($a_user_id, $map)) {
402 continue;
403 }
404
405 if ($map !== []) {
406 $user_team = null;
407 if ($a_user_id) {
408 $user_team_id = $map[$a_user_id];
409 $user_team = array();
410 foreach ($map as $user_id => $team_id) {
411 if ($user_id != $a_user_id &&
412 $user_team_id == $team_id) {
413 $user_team[] = $user_id;
414 }
415 }
416 }
417
418 if (!$a_user_id ||
419 count($user_team)) {
420 $res[$row["id"]] = array(
421 "title" => $row["title"],
422 "teams" => count(array_flip($map)),
423 );
424
425 if ($a_user_id) {
426 $res[$row["id"]]["user_team"] = $user_team;
427 }
428 }
429 }
430 }
431 }
432
433 return ilArrayUtil::sortArray($res, "title", "asc", false, true);
434 }
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static getAssignmentDataOfExercise(int $a_exc_id)

Referenced by ilExSubmissionTeamGUI\createTeamObject(), and ilExSubmissionTeamGUI\getAdoptForm().

+ Here is the caller graph for this function:

◆ getAssignmentTeamMap()

static ilExAssignmentTeam::getAssignmentTeamMap ( int  $a_ass_id)
static

Definition at line 267 of file class.ilExAssignmentTeam.php.

267 : array
268 {
269 global $DIC;
270
271 $repo = $DIC->exercise()->internal()->repo()->team();
272 return $repo->getUserTeamMap($a_ass_id);
273 }
ILIAS Exercise Team TeamDBRepository $repo

References $DIC.

Referenced by ilExerciseManagementGUI\createTeamsFromGroupsObject(), ilExAssignmentEditorGUI\generateTeams(), ilExSubmissionTeamGUI\getAdoptForm(), ilAssignmentsPerParticipantTableGUI\parseData(), and ilParticipantsPerAssignmentTableGUI\parseData().

+ Here is the caller graph for this function:

◆ getGroupMembersMap()

static ilExAssignmentTeam::getGroupMembersMap ( int  $a_exc_ref_id)
static

Definition at line 530 of file class.ilExAssignmentTeam.php.

530 : array
531 {
532 $res = array();
533
534 foreach (self::getAdoptableGroups($a_exc_ref_id) as $grp_obj_id) {
535 $members_obj = new ilGroupParticipants($grp_obj_id);
536
537 $res[$grp_obj_id] = array(
538 "title" => ilObject::_lookupTitle($grp_obj_id)
539 ,"members" => $members_obj->getMembers()
540 );
541 }
542
543 return ilArrayUtil::sortArray($res, "title", "asc", false, true);
544 }
static _lookupTitle(int $obj_id)

References $res, ilObject\_lookupTitle(), and ilArrayUtil\sortArray().

Referenced by ilExerciseManagementGUI\createTeamsFromGroupsObject(), and ilExerciseManagementGUI\initGroupForm().

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

◆ getId()

ilExAssignmentTeam::getId ( )

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

81 : ?int
82 {
83 return $this->id;
84 }

References $id.

◆ getInstanceByUserId()

static ilExAssignmentTeam::getInstanceByUserId ( int  $a_assignment_id,
int  $a_user_id,
bool  $a_create_on_demand = false 
)
static

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

57 : self {
58 $id = self::getTeamId($a_assignment_id, $a_user_id, $a_create_on_demand);
59 return new self($id);
60 }
static getTeamId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)

Referenced by ilExSubmission\__construct(), ilExerciseManagementGUI\createTeamsFromGroupsObject(), ilExerciseManagementGUI\createTeamsObject(), ilExerciseManagementGUI\dissolveTeamsObject(), and ilExcRepoObjAssignmentInfo\getInfo().

+ Here is the caller graph for this function:

◆ getInstancesFromMap()

static ilExAssignmentTeam::getInstancesFromMap ( int  $a_assignment_id)
static

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

62 : array
63 {
64 $teams = array();
65 foreach (self::getAssignmentTeamMap($a_assignment_id) as $user_id => $team_id) {
66 $teams[$team_id][] = $user_id;
67 }
68
69 $res = array();
70 foreach ($teams as $team_id => $members) {
71 $team = new self();
72 $team->id = $team_id;
73 $team->assignment_id = $a_assignment_id;
74 $team->members = $members;
75 $res[$team_id] = $team;
76 }
77
78 return $res;
79 }

References $res, and $user_id.

Referenced by ilExerciseManagementGUI\initIndividualDeadlineForm(), and ilParticipantsPerAssignmentTableGUI\parseData().

+ Here is the caller graph for this function:

◆ getLog()

ilExAssignmentTeam::getLog ( )

Definition at line 311 of file class.ilExAssignmentTeam.php.

311 : array
312 {
314
315 $this->cleanLog();
316
317 $res = array();
318
319 $sql = "SELECT * FROM il_exc_team_log" .
320 " WHERE team_id = " . $ilDB->quote($this->id, "integer") .
321 " ORDER BY tstamp DESC";
322 $set = $ilDB->query($sql);
323 while ($row = $ilDB->fetchAssoc($set)) {
324 $res[] = $row;
325 }
326 return $res;
327 }
cleanLog()
Remove obsolete log entries.

References $ilDB, and $res.

◆ getMembers()

ilExAssignmentTeam::getMembers ( )

Definition at line 166 of file class.ilExAssignmentTeam.php.

166 : array
167 {
168 return $this->members;
169 }

◆ getMembersOfAllTeams()

ilExAssignmentTeam::getMembersOfAllTeams ( )

Get members for all teams of assignment.

Returns
int[] user ids

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

175 : array
176 {
177 return iterator_to_array(
178 $this->repo->getAllMemberIdsOfAssignment($this->assignment_id)
179 );
180 }

◆ getTeamId()

static ilExAssignmentTeam::getTeamId ( int  $a_assignment_id,
int  $a_user_id,
bool  $a_create_on_demand = false 
)
static

Definition at line 105 of file class.ilExAssignmentTeam.php.

109 : ?int {
110 global $DIC;
111
112 $ilDB = $DIC->database();
113 $repo = $DIC->exercise()->internal()->repo()->team();
114 $manager = $DIC->exercise()->internal()->domain()->team();
115
116 $id = $repo->getTeamForMember($a_assignment_id, $a_user_id);
117
118 if (!$id && $a_create_on_demand) {
119
120 $id = $manager->create(
121 $a_assignment_id,
122 $a_user_id
123 );
124
125 // get starting timestamp (relative deadlines) from individual deadline
126 $idl = ilExcIndividualDeadline::getInstance($a_assignment_id, $a_user_id);
127
128 // set starting timestamp for created team
129 if ($idl->getStartingTimestamp() > 0) {
130 $idl_team = ilExcIndividualDeadline::getInstance($a_assignment_id, $id, true);
131 $idl_team->setStartingTimestamp($idl->getStartingTimestamp());
132 $idl_team->save();
133 }
134
135 self::writeTeamLog($id, self::TEAM_LOG_CREATE_TEAM);
137 $id,
138 self::TEAM_LOG_ADD_MEMBER,
140 );
141 }
142
143 return $id;
144 }

References $id, ilObjUser\_lookupFullname(), and ilExcIndividualDeadline\getInstance().

Referenced by ilExAssignment\canParticipantReceiveFeedback(), ilExSubmissionTeamGUI\createAdoptedTeamObject(), ilExSubmissionTeamGUI\createSingleMemberTeamObject(), ilExSubmissionTeamGUI\createTeamObject(), and ilExAssignment\getPersonalDeadline().

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

◆ read()

ilExAssignmentTeam::read ( int  $a_id)
protected

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

91 : void
92 {
94
95 // #18094
96 $this->members = [];
97 $this->setId($a_id);
98 foreach ($this->repo->getMembers($a_id) as $member) {
99 $this->assignment_id = $member->getAssignmentId();
100 $this->members[] = $member->getUserId();
101 }
102 }

References $ilDB.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ removeTeamMember()

ilExAssignmentTeam::removeTeamMember ( int  $a_user_id,
?int  $a_exc_ref_id = null 
)
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 238 of file class.ilExAssignmentTeam.php.

241 : void {
243
244 if (!$this->id) {
245 return;
246 }
247
248 $this->repo->removeUser(
249 $this->id,
250 $this->assignment_id,
251 $a_user_id
252 );
253
254 if ($a_exc_ref_id) {
255 $this->sendNotification($a_exc_ref_id, $a_user_id, "rmv");
256 }
257
258 $this->writeLog(
259 self::TEAM_LOG_REMOVE_MEMBER,
261 );
262
263 $this->read($this->id);
264 }

Referenced by ilExSubmission\deleteUser().

+ Here is the caller graph for this function:

◆ sendNotification()

ilExAssignmentTeam::sendNotification ( int  $a_exc_ref_id,
int  $a_user_id,
string  $a_action 
)

Send notification about team status.

Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 358 of file class.ilExAssignmentTeam.php.

362 : void {
363 $ilUser = $this->user;
364
365 // no need to notify current user
366 if (!$a_exc_ref_id ||
367 $ilUser->getId() == $a_user_id) {
368 return;
369 }
370 $ass = new ilExAssignment($this->assignment_id);
371
372 $ntf = new ilSystemNotification();
373 $ntf->setLangModules(array("exc"));
374 $ntf->setRefId($a_exc_ref_id);
375 $ntf->setChangedByUserId($ilUser->getId());
376 $ntf->setSubjectLangId('exc_team_notification_subject_' . $a_action);
377 $ntf->setIntroductionLangId('exc_team_notification_body_' . $a_action);
378 $ntf->addAdditionalInfo("exc_assignment", $ass->getTitle());
379 $ntf->setGotoLangId('exc_team_notification_link');
380 $ntf->setReasonLangId('exc_team_notification_reason');
381 $ntf->sendMailAndReturnRecipients(array($a_user_id));
382 }
Exercise assignment.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ setId()

ilExAssignmentTeam::setId ( ?int  $a_id)
private

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

86 : void
87 {
88 $this->id = $a_id;
89 }

◆ writeLog()

ilExAssignmentTeam::writeLog ( int  $a_action,
?string  $a_details = null 
)

Definition at line 275 of file class.ilExAssignmentTeam.php.

278 : void {
279 if ($this->id) {
280 self::writeTeamLog($this->id, $a_action, $a_details);
281 }
282 }

◆ writeTeamLog()

static ilExAssignmentTeam::writeTeamLog ( int  $a_team_id,
int  $a_action,
?string  $a_details = null 
)
static

Add entry to team log.

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

291 : void {
292 global $DIC;
293
294 $ilDB = $DIC->database();
295 $ilUser = $DIC->user();
296 $id = $ilDB->nextId('il_exc_team_log');
297
298 $fields = array(
299 "log_id" => array("integer", $id),
300 "team_id" => array("integer", $a_team_id),
301 "user_id" => array("integer", $ilUser->getId()),
302 "action" => array("integer", $a_action),
303 "details" => array("text", $a_details),
304 "tstamp" => array("integer", time())
305 );
306
307 $ilDB->insert("il_exc_team_log", $fields);
308 }

Field Documentation

◆ $assignment_id

int ilExAssignmentTeam::$assignment_id
protected

Definition at line 38 of file class.ilExAssignmentTeam.php.

◆ $db

ilDBInterface ilExAssignmentTeam::$db
protected

Definition at line 35 of file class.ilExAssignmentTeam.php.

◆ $id

int ilExAssignmentTeam::$id = null
protected

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

◆ $members

array ilExAssignmentTeam::$members = array()
protected

Definition at line 39 of file class.ilExAssignmentTeam.php.

◆ $repo

ILIAS Exercise Team TeamDBRepository ilExAssignmentTeam::$repo
protected

Definition at line 33 of file class.ilExAssignmentTeam.php.

◆ $team_manager

ILIAS Exercise Team TeamManager ilExAssignmentTeam::$team_manager
protected

Definition at line 32 of file class.ilExAssignmentTeam.php.

◆ $user

ilObjUser ilExAssignmentTeam::$user
protected

Definition at line 36 of file class.ilExAssignmentTeam.php.

◆ TEAM_LOG_ADD_FILE

const ilExAssignmentTeam::TEAM_LOG_ADD_FILE = 4

Definition at line 30 of file class.ilExAssignmentTeam.php.

Referenced by ilExAssignmentTeamLogTableGUI\getItems().

◆ TEAM_LOG_ADD_MEMBER

const ilExAssignmentTeam::TEAM_LOG_ADD_MEMBER = 2

Definition at line 28 of file class.ilExAssignmentTeam.php.

Referenced by ilExAssignmentTeamLogTableGUI\getItems().

◆ TEAM_LOG_CREATE_TEAM

const ilExAssignmentTeam::TEAM_LOG_CREATE_TEAM = 1

Definition at line 27 of file class.ilExAssignmentTeam.php.

Referenced by ilExAssignmentTeamLogTableGUI\getItems().

◆ TEAM_LOG_REMOVE_FILE

const ilExAssignmentTeam::TEAM_LOG_REMOVE_FILE = 5

◆ TEAM_LOG_REMOVE_MEMBER

const ilExAssignmentTeam::TEAM_LOG_REMOVE_MEMBER = 3

Definition at line 29 of file class.ilExAssignmentTeam.php.

Referenced by ilExAssignmentTeamLogTableGUI\getItems().


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