ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTrackingLearningHistoryProvider Class Reference

Learning history provider: completed lp objects. More...

+ Inheritance diagram for ilTrackingLearningHistoryProvider:
+ Collaboration diagram for ilTrackingLearningHistoryProvider:

Public Member Functions

 isActive ()
 Is active?
Returns
bool
More...
 
 getEntries ($ts_start, $ts_end)
 Get entries.
Parameters
int$ts_start
int$ts_end
Returns
ilLearningHistoryEntry[]
More...
 
 getName ()
 Get name of provider (in user language)
Returns
string
More...
 
- Public Member Functions inherited from ilAbstractLearningHistoryProvider
 __construct ( $user_id, ilLearningHistoryFactory $factory, ilLanguage $lng, ilTemplate $template=null)
 Constructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ilAbstractLearningHistoryProvider
 getUserId ()
 Get user id. More...
 
 getFactory ()
 Get factory. More...
 
 getLanguage ()
 Get language object. More...
 
 getEmphasizedTitle ($title)
 Get emphasized title. More...
 
- Protected Attributes inherited from ilAbstractLearningHistoryProvider
 $user_id
 
 $factory
 
 $lng
 

Detailed Description

Learning history provider: completed lp objects.

Author
killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 11 of file class.ilTrackingLearningHistoryProvider.php.

Member Function Documentation

◆ getEntries()

ilTrackingLearningHistoryProvider::getEntries (   $ts_start,
  $ts_end 
)

Get entries.

Parameters
int$ts_start
int$ts_end
Returns
ilLearningHistoryEntry[]

Implements ilLearningHistoryProviderInterface.

Definition at line 30 of file class.ilTrackingLearningHistoryProvider.php.

References $c, $from, ilAbstractLearningHistoryProvider\$lng, ilLPMarks\getCompletionsOfUser(), ilAbstractLearningHistoryProvider\getFactory(), ilAbstractLearningHistoryProvider\getLanguage(), ilAbstractLearningHistoryProvider\getUserId(), IL_CAL_DATETIME, and IL_CAL_UNIX.

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  }
const IL_CAL_DATETIME
$from
const IL_CAL_UNIX
Date and time handling
static getCompletionsOfUser($user_id, $from, $to)
Get completions of user.
+ Here is the call graph for this function:

◆ getName()

ilTrackingLearningHistoryProvider::getName ( )

Get name of provider (in user language)

Returns
string

Implements ilLearningHistoryProviderInterface.

Definition at line 54 of file class.ilTrackingLearningHistoryProvider.php.

References ilAbstractLearningHistoryProvider\$lng, and ilAbstractLearningHistoryProvider\getLanguage().

54  : string
55  {
56  $lng = $this->getLanguage();
57  $lng->loadLanguageModule("lp");
58 
59  return $lng->txt("learning_progress");
60  }
+ Here is the call graph for this function:

◆ isActive()

ilTrackingLearningHistoryProvider::isActive ( )

Is active?

Returns
bool

Implements ilLearningHistoryProviderInterface.

Definition at line 17 of file class.ilTrackingLearningHistoryProvider.php.

References ilObjUserTracking\_enabledLearningProgress(), and ilObjUserTracking\_hasLearningProgressLearner().

18  {
19  include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
22  return true;
23  }
24  return false;
25  }
static _enabledLearningProgress()
check wether learing progress is enabled or not
+ Here is the call graph for this function:

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