ILIAS  release_8 Revision v8.24
ilStudyProgrammeEvents Class Reference
+ Inheritance diagram for ilStudyProgrammeEvents:
+ Collaboration diagram for ilStudyProgrammeEvents:

Public Member Functions

 __construct (ilLogger $logger, ilAppEventHandler $app_event_handler, PRGEventHandler $prg_event_handler)
 
 raise (string $event, array $parameter)
 
 userAssigned (ilPRGAssignment $assignment)
 
 userDeassigned (ilPRGAssignment $a_assignment)
 
 userReAssigned (ilPRGAssignment $assignment)
 
 userSuccessful (ilPRGAssignment $assignment, int $pgs_node_id)
 
 informUserByMailToRestart (ilPRGAssignment $assignment)
 
 userRiskyToFail (ilPRGAssignment $assignment)
 
 validityChange (ilPRGAssignment $assignment, int $pgs_node_id)
 
 deadlineChange (ilPRGAssignment $assignment, int $pgs_node_id)
 
 scoreChange (ilPRGAssignment $assignment, int $pgs_node_id)
 
 userRevertSuccessful (ilPRGAssignment $assignment, int $pgs_node_id)
 
 userAssigned (ilPRGAssignment $assignment)
 
 userReAssigned (ilPRGAssignment $assignment)
 
 userDeassigned (ilPRGAssignment $a_assignment)
 
 userSuccessful (ilPRGAssignment $assignment, int $pgs_node_id)
 
 userRevertSuccessful (ilPRGAssignment $assignment, int $pgs_node_id)
 
 validityChange (ilPRGAssignment $assignment, int $pgs_node_id)
 
 deadlineChange (ilPRGAssignment $assignment, int $pgs_node_id)
 
 scoreChange (ilPRGAssignment $assignment, int $pgs_node_id)
 
 userRiskyToFail (ilPRGAssignment $assignment)
 
 informUserByMailToRestart (ilPRGAssignment $assignment)
 

Data Fields

const PUBLIC_EVENTS
 
- Data Fields inherited from StudyProgrammeEvents
const COMPONENT = "Modules/StudyProgramme"
 
const EVENT_USER_ASSIGNED = 'userAssigned'
 
const EVENT_USER_REASSIGNED = 'userReAssigned'
 
const EVENT_USER_DEASSIGNED = 'userDeassigned'
 
const EVENT_USER_SUCCESSFUL = 'userSuccessful'
 
const EVENT_USER_TO_RESTART = 'informUserToRestart'
 
const EVENT_USER_ABOUT_TO_FAIL = 'userRiskyToFail'
 
const EVENT_VALIDITY_CHANGE = 'vqChange'
 
const EVENT_DEADLINE_CHANGE = 'deadlineChange'
 
const EVENT_SCORE_CHANGE = 'currentPointsChange'
 
const EVENT_USER_NOT_SUCCESSFUL = 'userNotSuccessful'
 

Protected Attributes

ilAppEventHandler $app_event_handler
 

Detailed Description

Definition at line 21 of file class.ilStudyProgrammeEvents.php.

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeEvents::__construct ( ilLogger  $logger,
ilAppEventHandler  $app_event_handler,
PRGEventHandler  $prg_event_handler 
)

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

45 {
46 $this->logger = $logger;
47 $this->app_event_handler = $app_event_handler;
48 $this->prg_event_handler = $prg_event_handler;
49 }

References $app_event_handler, and ILIAS\Repository\logger().

+ Here is the call graph for this function:

Member Function Documentation

◆ deadlineChange()

ilStudyProgrammeEvents::deadlineChange ( ilPRGAssignment  $assignment,
int  $pgs_node_id 
)

Implements StudyProgrammeEvents.

Definition at line 198 of file class.ilStudyProgrammeEvents.php.

198 : void
199 {
200 $this->raise(self::EVENT_DEADLINE_CHANGE, [
201 "ass_id" => $assignment->getId(),
202 "root_prg_id" => $assignment->getRootId(),
203 "prg_id" => $pgs_node_id,
204 "usr_id" => $assignment->getUserId()
205 ]);
206 }

References StudyProgrammeEvents\EVENT_DEADLINE_CHANGE, ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ilPRGAssignment\getUserId().

+ Here is the call graph for this function:

◆ informUserByMailToRestart()

ilStudyProgrammeEvents::informUserByMailToRestart ( ilPRGAssignment  $assignment)

Implements StudyProgrammeEvents.

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

166 : void
167 {
168 $this->raise(
170 [
171 "ass_id" => (int) $assignment->getId(),
172 "root_prg_id" => (int) $assignment->getRootId()
173 ]
174 );
175 }

References StudyProgrammeEvents\EVENT_USER_TO_RESTART, ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ raise()

ilStudyProgrammeEvents::raise ( string  $event,
array  $parameter 
)

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

51 : void
52 {
53 $parameter_formatter = static function ($value) use (&$parameter_formatter) {
54 if (is_object($value)) {
55 return get_class($value);
56 }
57
58 if (is_array($value)) {
59 return array_map(
60 $parameter_formatter,
61 $value
62 );
63 }
64
65 return $value;
66 };
67
68 $this->logger->debug("PRG raised: " . $event . ' (' . var_export(array_map(
69 $parameter_formatter,
70 $parameter
71 ), true) . ')');
72
73 if (in_array($event, [
74 self::EVENT_USER_ASSIGNED,
75 self::EVENT_USER_DEASSIGNED,
76 self::EVENT_USER_SUCCESSFUL,
77 self::EVENT_USER_NOT_SUCCESSFUL,
78 self::EVENT_VALIDITY_CHANGE
79 ])) {
80 $this->prg_event_handler->updateLPStatus($parameter['prg_id'], $parameter['usr_id']);
81 }
82
83 if (in_array($event, [
84 self::EVENT_USER_SUCCESSFUL,
85 self::EVENT_USER_NOT_SUCCESSFUL,
86 self::EVENT_VALIDITY_CHANGE,
87 self::EVENT_SCORE_CHANGE
88 ])
89 && $parameter["root_prg_id"] === $parameter["prg_id"]
90 ) {
91 $cert = fn () => $this->app_event_handler->raise(self::COMPONENT, self::EVENT_USER_SUCCESSFUL, $parameter);
92 $this->prg_event_handler->triggerCertificateOnce($cert, $parameter["root_prg_id"], $parameter["usr_id"]);
93 }
94
95 if ($event === self::EVENT_USER_ABOUT_TO_FAIL) {
96 $this->prg_event_handler->sendRiskyToFailMail($parameter['ass_id'], $parameter['root_prg_id']);
97 }
98 if ($event === self::EVENT_USER_TO_RESTART) {
99 $this->prg_event_handler->sendInformToReAssignMail($parameter['ass_id'], $parameter['root_prg_id']);
100 }
101 if ($event === self::EVENT_USER_REASSIGNED) {
102 $this->prg_event_handler->sendReAssignedMail($parameter['ass_id'], $parameter['root_prg_id']);
103 }
104 if ($event === self::EVENT_VALIDITY_CHANGE) {
105 $this->prg_event_handler->resetMailFlagValidity($parameter['ass_id'], $parameter['root_prg_id']);
106 }
107 if ($event === self::EVENT_DEADLINE_CHANGE) {
108 $this->prg_event_handler->resetMailFlagDeadline($parameter['ass_id'], $parameter['root_prg_id']);
109 }
110
111 if (in_array($event, self::PUBLIC_EVENTS)) {
112 $this->app_event_handler->raise(self::COMPONENT, $event, $parameter);
113 }
114 }

References ILIAS\Repository\logger().

+ Here is the call graph for this function:

◆ scoreChange()

ilStudyProgrammeEvents::scoreChange ( ilPRGAssignment  $assignment,
int  $pgs_node_id 
)

Implements StudyProgrammeEvents.

Definition at line 208 of file class.ilStudyProgrammeEvents.php.

208 : void
209 {
210 $this->raise(self::EVENT_SCORE_CHANGE, [
211 "ass_id" => $assignment->getId(),
212 "root_prg_id" => $assignment->getRootId(),
213 "prg_id" => $pgs_node_id,
214 "usr_id" => $assignment->getUserId()
215 ]);
216 }

References StudyProgrammeEvents\EVENT_SCORE_CHANGE, ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ilPRGAssignment\getUserId().

+ Here is the call graph for this function:

◆ userAssigned()

ilStudyProgrammeEvents::userAssigned ( ilPRGAssignment  $assignment)

Implements StudyProgrammeEvents.

Definition at line 116 of file class.ilStudyProgrammeEvents.php.

116 : void
117 {
118 $this->raise(
120 [
121 "root_prg_id" => $assignment->getRootId(),
122 "prg_id" => $assignment->getRootId(),
123 "usr_id" => $assignment->getUserId(),
124 "ass_id" => $assignment->getId()
125 ]
126 );
127 }

References StudyProgrammeEvents\EVENT_USER_ASSIGNED, ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ilPRGAssignment\getUserId().

+ Here is the call graph for this function:

◆ userDeassigned()

ilStudyProgrammeEvents::userDeassigned ( ilPRGAssignment  $a_assignment)

Implements StudyProgrammeEvents.

Definition at line 129 of file class.ilStudyProgrammeEvents.php.

129 : void
130 {
131 $this->raise(
133 [
134 "root_prg_id" => $a_assignment->getRootId(),
135 "prg_id" => $a_assignment->getRootId(),
136 "usr_id" => $a_assignment->getUserId(),
137 "ass_id" => $a_assignment->getId()
138 ]
139 );
140 }

References StudyProgrammeEvents\EVENT_USER_DEASSIGNED, ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ilPRGAssignment\getUserId().

+ Here is the call graph for this function:

◆ userReAssigned()

ilStudyProgrammeEvents::userReAssigned ( ilPRGAssignment  $assignment)

Implements StudyProgrammeEvents.

Definition at line 142 of file class.ilStudyProgrammeEvents.php.

142 : void
143 {
144 $this->raise(
146 [
147 "ass_id" => $assignment->getId(),
148 "root_prg_id" => (int) $assignment->getRootId()
149 ]
150 );
151 }

References StudyProgrammeEvents\EVENT_USER_REASSIGNED, ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ userRevertSuccessful()

ilStudyProgrammeEvents::userRevertSuccessful ( ilPRGAssignment  $assignment,
int  $pgs_node_id 
)

Implements StudyProgrammeEvents.

Definition at line 218 of file class.ilStudyProgrammeEvents.php.

218 : void
219 {
220 $this->raise(self::EVENT_USER_NOT_SUCCESSFUL, [
221 "ass_id" => $assignment->getId(),
222 "root_prg_id" => $assignment->getRootId(),
223 "prg_id" => $pgs_node_id,
224 "usr_id" => $assignment->getUserId()
225 ]);
226 }

References StudyProgrammeEvents\EVENT_USER_NOT_SUCCESSFUL, ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ilPRGAssignment\getUserId().

+ Here is the call graph for this function:

◆ userRiskyToFail()

ilStudyProgrammeEvents::userRiskyToFail ( ilPRGAssignment  $assignment)

Implements StudyProgrammeEvents.

Definition at line 177 of file class.ilStudyProgrammeEvents.php.

177 : void
178 {
179 $this->raise(
181 [
182 "ass_id" => (int) $assignment->getId(),
183 "root_prg_id" => (int) $assignment->getRootId()
184 ]
185 );
186 }

References StudyProgrammeEvents\EVENT_USER_ABOUT_TO_FAIL, ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ userSuccessful()

ilStudyProgrammeEvents::userSuccessful ( ilPRGAssignment  $assignment,
int  $pgs_node_id 
)

Implements StudyProgrammeEvents.

Definition at line 153 of file class.ilStudyProgrammeEvents.php.

153 : void
154 {
155 $this->raise(
157 [
158 "root_prg_id" => $assignment->getRootId(),
159 "prg_id" => $pgs_node_id,
160 "usr_id" => $assignment->getUserId(),
161 "ass_id" => $assignment->getId()
162 ]
163 );
164 }

References StudyProgrammeEvents\EVENT_USER_SUCCESSFUL, ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ilPRGAssignment\getUserId().

+ Here is the call graph for this function:

◆ validityChange()

ilStudyProgrammeEvents::validityChange ( ilPRGAssignment  $assignment,
int  $pgs_node_id 
)

Implements StudyProgrammeEvents.

Definition at line 188 of file class.ilStudyProgrammeEvents.php.

188 : void
189 {
190 $this->raise(self::EVENT_VALIDITY_CHANGE, [
191 "ass_id" => $assignment->getId(),
192 "root_prg_id" => $assignment->getRootId(),
193 "prg_id" => $pgs_node_id,
194 "usr_id" => $assignment->getUserId()
195 ]);
196 }

References StudyProgrammeEvents\EVENT_VALIDITY_CHANGE, ilPRGAssignment\getId(), ilPRGAssignment\getRootId(), and ilPRGAssignment\getUserId().

+ Here is the call graph for this function:

Field Documentation

◆ $app_event_handler

ilAppEventHandler ilStudyProgrammeEvents::$app_event_handler
protected

Definition at line 23 of file class.ilStudyProgrammeEvents.php.

Referenced by __construct().

◆ PUBLIC_EVENTS

const ilStudyProgrammeEvents::PUBLIC_EVENTS

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