ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilCourseLearningHistoryProvider.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 
12 {
13 
17  public function isActive()
18  {
19  return true;
20  }
21 
25  public function getEntries($ts_start, $ts_end)
26  {
27  $lng = $this->getLanguage();
28  $lng->loadLanguageModule("crs");
29  $completions = ilLOUserResults::getCompletionsOfUser($this->getUserId(), $ts_start, $ts_end);
30 
31  $entries = [];
32  foreach ($completions as $c) {
33  $text = str_replace("$3$", $this->getEmphasizedTitle($c["title"]), $lng->txt("crs_lhist_objective_completed"));
34  $entries[] = $this->getFactory()->entry(
35  $text,
36  $text,
37  ilUtil::getImagePath("icon_obj.svg"),
38  $c["tstamp"],
39  $c["course_id"]
40  );
41  }
42  return $entries;
43  }
44 
48  public function getName() : string
49  {
50  $lng = $this->getLanguage();
51  $lng->loadLanguageModule("crs");
52 
53  return $lng->txt("crs_objectives");
54  }
55 }
Learning history provider: Course learning objectives.
getEntries($ts_start, $ts_end)
Get entries.ilLearningHistoryEntry[]
static getCompletionsOfUser($a_user_id, $a_from_ts, $a_to_ts)
Get completed learning objectives for user and time frame.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$text
Definition: errorreport.php:18
getName()
Get name of provider (in user language)string