19declare(strict_types=1);
32 public function collect(
string $event, array $parameter): void
34 $this->events[] = [$event, $parameter];
40 foreach (array_filter($this->events) as $entry) {
41 list($event, $parameter) = $entry;
42 $k = $event . print_r($parameter,
true);
43 if (!array_key_exists($k, $accounted_for)) {
44 $accounted_for[$k] =
true;
45 $this->prg_events->raise($event, $parameter);
53 $this->
collect(self::EVENT_USER_ASSIGNED, [
54 "root_prg_id" => $assignment->
getRootId(),
56 "ass_id" => $assignment->
getId()
62 $this->
collect(self::EVENT_USER_REASSIGNED, [
63 "ass_id" => $assignment->
getId(),
64 "root_prg_id" => (
int) $assignment->
getRootId()
70 $this->
collect(self::EVENT_USER_DEASSIGNED, [
71 "root_prg_id" => $a_assignment->
getRootId(),
73 "ass_id" => $a_assignment->
getId()
80 $this->
collect(self::EVENT_USER_TO_RESTART, [
81 "ass_id" => (
int) $assignment->
getId(),
82 "root_prg_id" => (
int) $assignment->
getRootId()
88 $this->
collect(self::EVENT_USER_ABOUT_TO_FAIL, [
89 "ass_id" => (
int) $assignment->
getId(),
90 "root_prg_id" => (
int) $assignment->
getRootId()
96 $this->
collect(self::EVENT_USER_SUCCESSFUL, [
97 "root_prg_id" => $assignment->
getRootId(),
98 "prg_id" => $pgs_node_id,
100 "ass_id" => $assignment->
getId()
106 $this->
collect(self::EVENT_VALIDITY_CHANGE, [
107 "ass_id" => $assignment->
getId(),
108 "root_prg_id" => $assignment->
getRootId(),
109 "prg_id" => $pgs_node_id,
116 $this->
collect(self::EVENT_DEADLINE_CHANGE, [
117 "ass_id" => $assignment->
getId(),
118 "root_prg_id" => $assignment->
getRootId(),
119 "prg_id" => $pgs_node_id,
126 $this->
collect(self::EVENT_SCORE_CHANGE, [
127 "ass_id" => $assignment->
getId(),
128 "root_prg_id" => $assignment->
getRootId(),
129 "prg_id" => $pgs_node_id,
136 $this->
collect(self::EVENT_USER_NOT_SUCCESSFUL, [
137 "ass_id" => $assignment->
getId(),
138 "root_prg_id" => $assignment->
getRootId(),
139 "prg_id" => $pgs_node_id,
collect(string $event, array $parameter)
__construct(ilStudyProgrammeEvents $prg_events)
scoreChange(ilPRGAssignment $assignment, int $pgs_node_id)
userReAssigned(ilPRGAssignment $assignment)
userDeassigned(ilPRGAssignment $a_assignment)
informUserByMailToRestart(ilPRGAssignment $assignment)
userSuccessful(ilPRGAssignment $assignment, int $pgs_node_id)
validityChange(ilPRGAssignment $assignment, int $pgs_node_id)
userAssigned(ilPRGAssignment $assignment)
userRevertSuccessful(ilPRGAssignment $assignment, int $pgs_node_id)
userRiskyToFail(ilPRGAssignment $assignment)
deadlineChange(ilPRGAssignment $assignment, int $pgs_node_id)
ilStudyProgrammeEvents $prg_events
Assignments are relations of users to a PRG; They hold progress-information for (sub-)nodes of the PR...