ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilSkillAppEventListener Class Reference

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

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 26 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 31 of file class.ilSkillAppEventListener.php.

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

31  : void
32  {
33  global $DIC;
34 
35  $profile_completion_manager = $DIC->skills()->internal()->manager()->getProfileCompletionManager();
36  $personal_manager = $DIC->skills()->internal()->manager()->getPersonalSkillManager();
37  $resource_manager = $DIC->skills()->internal()->manager()->getResourceManager();
38 
39  switch ($a_component) {
40  case 'components/ILIAS/Tracking':
41  switch ($a_event) {
42  case 'updateStatus':
43  if ($a_parameter["status"] == ilLPStatus::LP_STATUS_COMPLETED_NUM) {
44  $obj_id = $a_parameter["obj_id"];
45  $usr_id = $a_parameter["usr_id"];
46  foreach (ilObject::_getAllReferences($obj_id) as $ref_id) {
47  foreach ($resource_manager->getTriggerLevelsForRefId($ref_id) as $sk) {
49  $sk->getLevelId(),
50  $usr_id,
51  $ref_id,
52  $sk->getTrefId()
53  );
54 
55  if ($sk->getTrefId() > 0) {
56  $personal_manager->addPersonalSkill($usr_id, $sk->getTrefId());
57  } else {
58  $personal_manager->addPersonalSkill($usr_id, $sk->getBaseSkillId());
59  }
60  }
61  }
62  //write profile completion entries if fulfilment status has changed
63  $profile_completion_manager->writeCompletionEntryForAllProfilesOfUser($usr_id);
64  }
65  break;
66  }
67  break;
68 
69  case "components/ILIAS/ILIASObject":
70  switch ($a_event) {
71  case "beforeDeletion":
72  $handler = new ilSkillObjDeletionHandler($a_parameter["object"]->getId(), $a_parameter["object"]->getType());
73  $handler->processDeletion();
74  break;
75  }
76  break;
77  }
78  }
const LP_STATUS_COMPLETED_NUM
Handles deletion of (user) objects.
static _getAllReferences(int $id)
get all reference ids for object ID
$ref_id
Definition: ltiauth.php:65
global $DIC
Definition: shib_login.php:22
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: oai.php:30
+ Here is the call graph for this function:

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