ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilTrackingLearningHistoryProvider.php
Go to the documentation of this file.
1<?php
2
25{
29 public function isActive(): bool
30 {
33 return true;
34 }
35 return false;
36 }
37
41 public function getEntries(int $ts_start, int $ts_end): array
42 {
43 $lng = $this->getLanguage();
44 $this->lng->loadLanguageModule("trac");
45 $from = new ilDateTime($ts_start, IL_CAL_UNIX);
46 $to = new ilDateTime($ts_end, IL_CAL_UNIX);
48 $this->getUserId(),
49 $from->get(IL_CAL_DATETIME),
50 $to->get(IL_CAL_DATETIME)
51 );
52 $entries = [];
53 foreach ($completions as $c) {
54 $ts = new ilDateTime($c["status_changed"], IL_CAL_DATETIME);
55 $in_txt = ilObject::_lookupType((int) $c["obj_id"]) === "crs"
56 ? $this->lng->txt("trac_lhist_obj_completed")
57 : $this->lng->txt("trac_lhist_obj_completed_in");
58 $entries[] = $this->getFactory()->entry(
59 $this->lng->txt("trac_lhist_obj_completed"),
60 $in_txt,
61 ilObject::_getIcon((int) $c["obj_id"]),
62 $ts->get(IL_CAL_UNIX),
63 $c["obj_id"]
64 );
65 }
66 return $entries;
67 }
68
72 public function getName(): string
73 {
74 $lng = $this->getLanguage();
75 $this->lng->loadLanguageModule("lp");
76
77 return $this->lng->txt("learning_progress");
78 }
79}
const IL_CAL_UNIX
const IL_CAL_DATETIME
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
@classDescription Date and time handling
static getCompletionsOfUser(int $user_id, string $from, string $to)
static _lookupType(int $id, bool $reference=false)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$c
Definition: deliver.php:25
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...