ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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

readonly ilCertificateActiveValidator $validator
 
readonly ilLearningHistoryService $learing_history
 
readonly ilSetting $setting
 

Private Attributes

const SERVICES
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilAchievements::__construct ( )

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

43 {
44 global $DIC;
45
46 $this->learing_history = $DIC->learningHistory();
47 $this->setting = new ilSetting('skmg');
48 $this->validator = new ilCertificateActiveValidator();
49 }
ILIAS Setting Class.
global $DIC
Definition: shib_login.php:26

References $DIC.

Member Function Documentation

◆ getActiveServices()

ilAchievements::getActiveServices ( )
Returns
int[]

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

87 : array
88 {
89 return array_filter(self::SERVICES, $this->isActive(...));
90 }
isActive(int $service)

References isActive(), and SERVICES.

+ Here is the call graph for this function:

◆ isActive()

ilAchievements::isActive ( int  $service)

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

51 : bool
52 {
53 switch ($service) {
55 return $this->learing_history->isActive();
56
58 return (bool) $this->setting->get('enable_skmg');
59
64
66 return ilBadgeHandler::getInstance()->isActive();
67
69 return $this->validator->validate();
70 }
71 return false;
72 }
$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 74 of file class.ilAchievements.php.

74 : bool
75 {
76 foreach (self::SERVICES as $s) {
77 if ($this->isActive($s)) {
78 return true;
79 }
80 }
81 return false;
82 }

References isActive(), and SERVICES.

+ Here is the call graph for this function:

Field Documentation

◆ $learing_history

readonly ilLearningHistoryService ilAchievements::$learing_history
protected

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

◆ $setting

readonly ilSetting ilAchievements::$setting
protected

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

◆ $validator

readonly ilCertificateActiveValidator ilAchievements::$validator
protected

Definition at line 38 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

◆ SERVICES

const ilAchievements::SERVICES
private

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