ILIAS  release_8 Revision v8.24
ilAchievements Class Reference

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

+ Collaboration diagram for ilAchievements:

Public Member Functions

 isActive (int $service)
 Is sub-service active? More...
 
 isAnyActive ()
 Is any sub-service active? More...
 
 getActiveServices ()
 Get active services. More...
 

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

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

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

Member Function Documentation

◆ getActiveServices()

ilAchievements::getActiveServices ( )

Get active services.

Returns
int[]

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

98 : array
99 {
100 return array_filter($this->services, function ($s) {
101 return $this->isActive($s);
102 });
103 }
isActive(int $service)
Is sub-service active?

References isActive().

+ Here is the call graph for this function:

◆ isActive()

ilAchievements::isActive ( int  $service)

Is sub-service active?

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

57 : bool
58 {
59 switch ($service) {
61 return $this->learing_history->isActive();
62
64 return (bool) $this->skmg_setting->get("enable_skmg");
65
70
72 return ilBadgeHandler::getInstance()->isActive();
73
75 return $this->validator->validate();
76
77 }
78 return false;
79 }
$service
Definition: ltiservices.php:43

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 ( )

Is any sub-service active?

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

84 : bool
85 {
86 foreach ($this->services as $s) {
87 if ($this->isActive($s)) {
88 return true;
89 }
90 }
91 return false;
92 }

References isActive().

+ Here is the call graph for this function:

Field Documentation

◆ $learing_history

ilLearningHistoryService ilAchievements::$learing_history
protected

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

◆ $services

array ilAchievements::$services
protected

◆ $setting

ilSetting ilAchievements::$setting
protected

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

◆ $skmg_setting

ilSetting ilAchievements::$skmg_setting
protected

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

◆ $validator

ilCertificateActiveValidator ilAchievements::$validator
private

Definition at line 21 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: