Class ilLTIAppEventListener.
More...
|
static | handleEvent ($a_component, $a_event, $a_parameter) |
| Handle an event in a listener.- Parameters
-
string | $a_component | component, e.g. "Modules/Forum" or "Services/User" |
string | $a_event | event e.g. "createUser", "updateUser", "deleteUser", ... |
array | $a_parameter | parameter array (assoc), array("name" => ..., "phone_office" => ...) |
More...
|
|
static | handleCronUpdate (ilDateTime $since) |
|
◆ __construct()
ilLTIAppEventListener::__construct |
( |
| ) |
|
|
protected |
◆ doCronUpdate()
ilLTIAppEventListener::doCronUpdate |
( |
ilDateTime |
$since | ) |
|
|
protected |
- Parameters
-
- Exceptions
-
Definition at line 81 of file class.ilLTIAppEventListener.php.
References $consumer, ilObjUser\_checkExternalAuthAccount(), ilObjUser\_lookupId(), ilObject\_lookupObjId(), ilLPStatus\_lookupPercentage(), ilLPStatus\_lookupStatus(), and tryOutcomeService().
83 $this->logger->debug(
'Starting cron update for lti outcome service');
85 $resources = $this->connector->lookupResourcesForAllUsersSinceDate($since);
86 foreach ($resources as $consumer_ext_account => $user_resources) {
87 list(
$consumer, $ext_account) = explode(
'__', $consumer_ext_account, 2);
91 $this->logger->info(
'No user found for lti_' .
$consumer .
' -> ' . $ext_account);
95 foreach ($user_resources as $resource_info) {
96 $this->logger->debug(
'Found resource: ' . $resource_info);
97 list($resource_id, $resource_ref_id) = explode(
'__', $resource_info);
static _lookupPercentage($a_obj_id, $a_user_id)
Lookup percentage.
static _lookupId($a_user_str)
Lookup id by login.
static _lookupObjId($a_id)
tryOutcomeService($resource, $ext_account, $a_status, $a_percentage)
try outcome service
static _checkExternalAuthAccount($a_auth, $a_account, $tryFallback=true)
check whether external account and authentication method matches with a user
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.
◆ getInstance()
static ilLTIAppEventListener::getInstance |
( |
| ) |
|
|
staticprotected |
◆ handleCronUpdate()
static ilLTIAppEventListener::handleCronUpdate |
( |
ilDateTime |
$since | ) |
|
|
static |
◆ handleEvent()
static ilLTIAppEventListener::handleEvent |
( |
|
$a_component, |
|
|
|
$a_event, |
|
|
|
$a_parameter |
|
) |
| |
|
static |
Handle an event in a listener.
- Parameters
-
string | $a_component | component, e.g. "Modules/Forum" or "Services/User" |
string | $a_event | event e.g. "createUser", "updateUser", "deleteUser", ... |
array | $a_parameter | parameter array (assoc), array("name" => ..., "phone_office" => ...) |
Implements ilAppEventListener.
Definition at line 161 of file class.ilLTIAppEventListener.php.
References $DIC, and $logger.
165 $logger = $DIC->logger()->lti()->debug(
'Handling event: ' . $a_event .
' from ' . $a_component);
167 switch ($a_component) {
168 case 'Services/Tracking':
169 if ($a_event ==
'updateStatus') {
170 $listener = self::getInstance();
171 $listener->handleUpdateStatus(
172 $a_parameter[
'obj_id'],
173 $a_parameter[
'usr_id'],
174 $a_parameter[
'status'],
175 $a_parameter[
'percentage']
◆ handleUpdateStatus()
ilLTIAppEventListener::handleUpdateStatus |
( |
|
$a_obj_id, |
|
|
|
$a_usr_id, |
|
|
|
$a_status, |
|
|
|
$a_percentage |
|
) |
| |
|
protected |
Handle update status.
Definition at line 51 of file class.ilLTIAppEventListener.php.
References $consumer, ilObject\_getAllReferences(), ilObjUser\_lookupAuthMode(), ilObjUser\_lookupExternalAccount(), array, isLTIAuthMode(), and tryOutcomeService().
53 $this->logger->debug(
'Handle update status');
56 $this->logger->debug(
'Ignoring update for non-LTI-user.');
60 list($lti,
$consumer) = explode(
'_', $auth_mode);
64 foreach ((
array) $refs as $ref_id) {
65 $resources = $this->connector->lookupResourcesForUserObjectRelation(
70 foreach ($resources as $resource) {
static _lookupExternalAccount($a_user_id)
lookup external account for login and authmethod
static _getAllReferences($a_id)
get all reference ids of object
isLTIAuthMode($auth_mode)
tryOutcomeService($resource, $ext_account, $a_status, $a_percentage)
try outcome service
Create styles array
The data for the language used.
static _lookupAuthMode($a_usr_id)
lookup auth mode
◆ isLTIAuthMode()
ilLTIAppEventListener::isLTIAuthMode |
( |
|
$auth_mode | ) |
|
|
protected |
◆ tryOutcomeService()
ilLTIAppEventListener::tryOutcomeService |
( |
|
$resource, |
|
|
|
$ext_account, |
|
|
|
$a_status, |
|
|
|
$a_percentage |
|
) |
| |
|
protected |
◆ $connector
ilLTIAppEventListener::$connector = null |
|
private |
◆ $instance
ilLTIAppEventListener::$instance = null |
|
staticprivate |
◆ $logger
ilLTIAppEventListener::$logger = null |
|
private |
The documentation for this class was generated from the following file: