ILIAS  release_8 Revision v8.23
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.

References isActive().

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?
+ 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.

References ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_hasLearningProgressLearner(), ilObjUserTracking\_hasLearningProgressOtherUsers(), and ilBadgeHandler\getInstance().

Referenced by getActiveServices(), and isAnyActive().

57  : bool
58  {
59  switch ($service) {
60  case self::SERV_LEARNING_HISTORY:
61  return $this->learing_history->isActive();
62 
63  case self::SERV_COMPETENCES:
64  return (bool) $this->skmg_setting->get("enable_skmg");
65 
66  case self::SERV_LEARNING_PROGRESS:
70 
71  case self::SERV_BADGES:
72  return ilBadgeHandler::getInstance()->isActive();
73 
74  case self::SERV_CERTIFICATES:
75  return $this->validator->validate();
76 
77  }
78  return false;
79  }
$service
Definition: ltiservices.php:43
+ 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.

References isActive().

84  : bool
85  {
86  foreach ($this->services as $s) {
87  if ($this->isActive($s)) {
88  return true;
89  }
90  }
91  return false;
92  }
isActive(int $service)
Is sub-service active?
+ 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
Initial value:
= [
self::SERV_LEARNING_HISTORY,
self::SERV_COMPETENCES,
self::SERV_LEARNING_PROGRESS,
self::SERV_BADGES,
self::SERV_CERTIFICATES
]

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

◆ $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: