ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilTrackingLearningHistoryProvider.php
Go to the documentation of this file.
1
<?
php
2
3
/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
4
11
class
ilTrackingLearningHistoryProvider
extends
ilAbstractLearningHistoryProvider
implements
ilLearningHistoryProviderInterface
12
{
13
17
public
function
isActive
()
18
{
19
include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php"
);
20
if
(
ilObjUserTracking::_enabledLearningProgress
() &&
21
ilObjUserTracking::_hasLearningProgressLearner
()) {
22
return
true
;
23
}
24
return
false
;
25
}
26
30
public
function
getEntries
($ts_start, $ts_end)
31
{
32
$lng
= $this->
getLanguage
();
33
$lng
->loadLanguageModule(
"trac"
);
34
$from
=
new
ilDateTime
($ts_start,
IL_CAL_UNIX
);
35
$to =
new
ilDateTime
($ts_end,
IL_CAL_UNIX
);
36
$completions =
ilLPMarks::getCompletionsOfUser
($this->
getUserId
(),
$from
->get(
IL_CAL_DATETIME
), $to->get(
IL_CAL_DATETIME
));
37
$entries = [];
38
foreach
($completions as
$c
) {
39
$ts =
new
ilDateTime
($c[
"status_changed"
],
IL_CAL_DATETIME
);
40
$entries[] = $this->
getFactory
()->entry(
41
$lng
->txt(
"trac_lhist_obj_completed"
),
42
$lng
->txt(
"trac_lhist_obj_completed_in"
),
43
ilObject::_getIcon($c[
"obj_id"
]),
44
$ts->get(
IL_CAL_UNIX
),
45
$c[
"obj_id"
]
46
);
47
}
48
return
$entries;
49
}
50
54
public
function
getName
() : string
55
{
56
$lng
= $this->
getLanguage
();
57
$lng
->loadLanguageModule(
"lp"
);
58
59
return
$lng
->txt(
"learning_progress"
);
60
}
61
}
ilAbstractLearningHistoryProvider\getFactory
getFactory()
Get factory.
Definition:
class.ilAbstractLearningHistoryProvider.php:79
IL_CAL_DATETIME
const IL_CAL_DATETIME
Definition:
class.ilDateTime.php:9
ilObjUserTracking\_hasLearningProgressLearner
static _hasLearningProgressLearner()
Definition:
class.ilObjUserTracking.php:328
ilTrackingLearningHistoryProvider\isActive
isActive()
Is active?bool
Definition:
class.ilTrackingLearningHistoryProvider.php:17
$from
$from
Definition:
logout-iframe.php:5
ilAbstractLearningHistoryProvider\$lng
$lng
Definition:
class.ilAbstractLearningHistoryProvider.php:28
IL_CAL_UNIX
const IL_CAL_UNIX
Definition:
class.ilDateTime.php:11
$c
$c
Definition:
inc.setup_header.php:183
ilTrackingLearningHistoryProvider\getEntries
getEntries($ts_start, $ts_end)
Get entries.ilLearningHistoryEntry[]
Definition:
class.ilTrackingLearningHistoryProvider.php:30
ilAbstractLearningHistoryProvider
Abstract learning history provider.
Definition:
class.ilAbstractLearningHistoryProvider.php:11
ilAbstractLearningHistoryProvider\getUserId
getUserId()
Get user id.
Definition:
class.ilAbstractLearningHistoryProvider.php:69
ilObjUserTracking\_enabledLearningProgress
static _enabledLearningProgress()
check wether learing progress is enabled or not
Definition:
class.ilObjUserTracking.php:69
ilLearningHistoryProviderInterface
Learning history provider interface.
Definition:
interface.ilLearningHistoryProvider.php:13
ilTrackingLearningHistoryProvider\getName
getName()
Get name of provider (in user language)string
Definition:
class.ilTrackingLearningHistoryProvider.php:54
ilAbstractLearningHistoryProvider\getLanguage
getLanguage()
Get language object.
Definition:
class.ilAbstractLearningHistoryProvider.php:89
ilDateTime
Date and time handling
Definition:
class.ilDateTime.php:33
ilLPMarks\getCompletionsOfUser
static getCompletionsOfUser($user_id, $from, $to)
Get completions of user.
Definition:
class.ilLPMarks.php:169
ilTrackingLearningHistoryProvider
Learning history provider: completed lp objects.
Definition:
class.ilTrackingLearningHistoryProvider.php:11
php
Services
Tracking
classes
learning_history
class.ilTrackingLearningHistoryProvider.php
Generated on Thu Jan 16 2025 19:02:32 for ILIAS by
1.8.13 (using
Doxyfile
)