ILIAS  release_8 Revision v8.24
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{
15 public function isActive(): bool
16 {
19 return true;
20 }
21 return false;
22 }
23
27 public function getEntries(int $ts_start, int $ts_end): array
28 {
29 $lng = $this->getLanguage();
30 $this->lng->loadLanguageModule("trac");
31 $from = new ilDateTime($ts_start, IL_CAL_UNIX);
32 $to = new ilDateTime($ts_end, IL_CAL_UNIX);
34 $this->getUserId(),
35 $from->get(IL_CAL_DATETIME),
36 $to->get(IL_CAL_DATETIME)
37 );
38 $entries = [];
39 foreach ($completions as $c) {
40 $ts = new ilDateTime($c["status_changed"], IL_CAL_DATETIME);
41 $in_txt = ilObject::_lookupType((int) $c["obj_id"]) === "crs"
42 ? $this->lng->txt("trac_lhist_obj_completed")
43 : $this->lng->txt("trac_lhist_obj_completed_in");
44 $entries[] = $this->getFactory()->entry(
45 $this->lng->txt("trac_lhist_obj_completed"),
46 $in_txt,
47 ilObject::_getIcon((int) $c["obj_id"]),
48 $ts->get(IL_CAL_UNIX),
49 $c["obj_id"]
50 );
51 }
52 return $entries;
53 }
54
58 public function getName(): string
59 {
60 $lng = $this->getLanguage();
61 $this->lng->loadLanguageModule("lp");
62
63 return $this->lng->txt("learning_progress");
64 }
65}
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.
Learning history provider: completed lp objects.
$c
Definition: cli.php:38
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...