ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilSkillAppEventListener Class Reference

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

+ Inheritance diagram for ilSkillAppEventListener:
+ Collaboration diagram for ilSkillAppEventListener:

Static Public Member Functions

static handleEvent (string $a_component, string $a_event, array $a_parameter)
 

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 Update skill from Services/Tracking events

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

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

Member Function Documentation

◆ handleEvent()

static ilSkillAppEventListener::handleEvent ( string  $a_component,
string  $a_event,
array  $a_parameter 
)
static

Implements ilAppEventListener.

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

References $DIC, $handler, $ref_id, ilObject\_getAllReferences(), ILIAS\Survey\Mode\getId(), ilLPStatus\LP_STATUS_COMPLETED_NUM, and ilBasicSkill\writeUserSkillLevelStatus().

32  : void
33  {
34  global $DIC;
35 
36  $profile_completion_manager = $DIC->skills()->internal()->manager()->getProfileCompletionManager();
37  $personal_manager = $DIC->skills()->internal()->manager()->getPersonalSkillManager();
38  $resource_manager = $DIC->skills()->internal()->manager()->getResourceManager();
39 
40  switch ($a_component) {
41  case 'Services/Tracking':
42  switch ($a_event) {
43  case 'updateStatus':
44  if ($a_parameter["status"] == ilLPStatus::LP_STATUS_COMPLETED_NUM) {
45  $obj_id = $a_parameter["obj_id"];
46  $usr_id = $a_parameter["usr_id"];
47  foreach (ilObject::_getAllReferences($obj_id) as $ref_id) {
48  foreach ($resource_manager->getTriggerLevelsForRefId($ref_id) as $sk) {
50  $sk->getLevelId(),
51  $usr_id,
52  $ref_id,
53  $sk->getTrefId()
54  );
55 
56  if ($sk->getTrefId() > 0) {
57  $personal_manager->addPersonalSkill($usr_id, $sk->getTrefId());
58  } else {
59  $personal_manager->addPersonalSkill($usr_id, $sk->getBaseSkillId());
60  }
61  }
62  }
63  //write profile completion entries if fulfilment status has changed
64  $profile_completion_manager->writeCompletionEntryForAllProfilesOfUser($usr_id);
65  }
66  break;
67  }
68  break;
69 
70  case "Services/Object":
71  switch ($a_event) {
72  case "beforeDeletion":
73  $handler = new ilSkillObjDeletionHandler($a_parameter["object"]->getId(), $a_parameter["object"]->getType());
74  $handler->processDeletion();
75  break;
76  }
77  break;
78  }
79  }
const LP_STATUS_COMPLETED_NUM
Handles deletion of (user) objects.
static _getAllReferences(int $id)
get all reference ids for object ID
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
static writeUserSkillLevelStatus(int $a_level_id, int $a_user_id, int $a_trigger_ref_id, int $a_tref_id=0, int $a_status=ilBasicSkill::ACHIEVED, bool $a_force=false, bool $a_self_eval=false, string $a_unique_identifier="", float $a_next_level_fulfilment=0.0, string $trigger_user_id="")
$handler
Definition: index.php:18
+ Here is the call graph for this function:

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