ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAchievements Class Reference
+ Collaboration diagram for ilAchievements:

Public Member Functions

 __construct ()
 
 isActive (int $service)
 
 isAnyActive ()
 
 getActiveServices ()
 

Data Fields

const SERV_LEARNING_HISTORY = 1
 
const SERV_COMPETENCES = 2
 
const SERV_LEARNING_PROGRESS = 3
 
const SERV_BADGES = 4
 
const SERV_CERTIFICATES = 5
 

Protected Attributes

ilLearningHistoryService $learing_history
 
array $services
 
ilSetting $setting
 
ilSetting $skmg_setting
 

Private Attributes

ilCertificateActiveValidator $validator
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilAchievements::__construct ( )

Definition at line 45 of file class.ilAchievements.php.

46 {
47 global $DIC;
48
49 $this->setting = $DIC->settings();
50 $this->learing_history = $DIC->learningHistory();
51 $this->skmg_setting = new ilSetting('skmg');
52 $this->validator = new ilCertificateActiveValidator();
53 }
ILIAS Setting Class.
global $DIC
Definition: shib_login.php:26

References $DIC.

Member Function Documentation

◆ getActiveServices()

ilAchievements::getActiveServices ( )
Returns
int[]

Definition at line 91 of file class.ilAchievements.php.

91 : array
92 {
93 return array_filter($this->services, function ($s) {
94 return $this->isActive($s);
95 });
96 }
isActive(int $service)

References isActive().

+ Here is the call graph for this function:

◆ isActive()

ilAchievements::isActive ( int  $service)

Definition at line 55 of file class.ilAchievements.php.

55 : bool
56 {
57 switch ($service) {
59 return $this->learing_history->isActive();
60
62 return (bool) $this->skmg_setting->get('enable_skmg');
63
68
70 return ilBadgeHandler::getInstance()->isActive();
71
73 return $this->validator->validate();
74 }
75 return false;
76 }
$service
Definition: ltiresult.php:36

References $service, ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_hasLearningProgressLearner(), ilObjUserTracking\_hasLearningProgressOtherUsers(), ilBadgeHandler\getInstance(), SERV_BADGES, SERV_CERTIFICATES, SERV_COMPETENCES, SERV_LEARNING_HISTORY, and SERV_LEARNING_PROGRESS.

Referenced by getActiveServices(), and isAnyActive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAnyActive()

ilAchievements::isAnyActive ( )

Definition at line 78 of file class.ilAchievements.php.

78 : bool
79 {
80 foreach ($this->services as $s) {
81 if ($this->isActive($s)) {
82 return true;
83 }
84 }
85 return false;
86 }

References isActive().

+ Here is the call graph for this function:

Field Documentation

◆ $learing_history

ilLearningHistoryService ilAchievements::$learing_history
protected

Definition at line 26 of file class.ilAchievements.php.

◆ $services

array ilAchievements::$services
protected

◆ $setting

ilSetting ilAchievements::$setting
protected

Definition at line 42 of file class.ilAchievements.php.

◆ $skmg_setting

ilSetting ilAchievements::$skmg_setting
protected

Definition at line 43 of file class.ilAchievements.php.

◆ $validator

ilCertificateActiveValidator ilAchievements::$validator
private

Definition at line 25 of file class.ilAchievements.php.

◆ SERV_BADGES

const ilAchievements::SERV_BADGES = 4

◆ SERV_CERTIFICATES

const ilAchievements::SERV_CERTIFICATES = 5

◆ SERV_COMPETENCES

const ilAchievements::SERV_COMPETENCES = 2

◆ SERV_LEARNING_HISTORY

const ilAchievements::SERV_LEARNING_HISTORY = 1

◆ SERV_LEARNING_PROGRESS

const ilAchievements::SERV_LEARNING_PROGRESS = 3

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