ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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 25 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 30 of file class.ilSkillAppEventListener.php.

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

30  : void
31  {
32  global $DIC;
33 
34  $profile_completion_manager = $DIC->skills()->internal()->manager()->getProfileCompletionManager();
35 
36  switch ($a_component) {
37  case 'Services/Tracking':
38  switch ($a_event) {
39  case 'updateStatus':
40  if ($a_parameter["status"] == ilLPStatus::LP_STATUS_COMPLETED_NUM) {
41  $obj_id = $a_parameter["obj_id"];
42  $usr_id = $a_parameter["usr_id"];
43  foreach (ilObject::_getAllReferences($obj_id) as $ref_id) {
44  foreach (ilSkillResources::getTriggerLevelsForRefId($ref_id) as $sk) {
46  $sk["level_id"],
47  $usr_id,
48  $ref_id,
49  $sk["tref_id"]
50  );
51 
52  if ($sk["tref_id"] > 0) {
53  ilPersonalSkill::addPersonalSkill($usr_id, $sk["tref_id"]);
54  } else {
55  ilPersonalSkill::addPersonalSkill($usr_id, $sk["base_skill_id"]);
56  }
57  }
58  }
59  //write profile completion entries if fulfilment status has changed
60  $profile_completion_manager->writeCompletionEntryForAllProfiles($usr_id);
61  }
62  break;
63  }
64  break;
65 
66  case "Services/Object":
67  switch ($a_event) {
68  case "beforeDeletion":
69  $handler = new ilSkillObjDeletionHandler($a_parameter["object"]->getId(), $a_parameter["object"]->getType());
70  $handler->processDeletion();
71  break;
72  }
73  break;
74 
75  }
76  }
const LP_STATUS_COMPLETED_NUM
Handles deletion of (user) objects.
static getTriggerLevelsForRefId(int $a_ref_id)
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="")
static addPersonalSkill(int $a_user_id, int $a_skill_node_id)
+ Here is the call graph for this function:

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