ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSCORMTrackingItemsPerUserTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
27{
28 private int $obj_id;
29 private int $user_id = 0;
30
31 public function __construct(int $a_obj_id, ?object $a_parent_obj, string $a_parent_cmd)
32 {
33 $this->obj_id = $a_obj_id;
34
35 $this->setId('sco_trs_usr_' . $this->obj_id);
36 parent::__construct($a_parent_obj, $a_parent_cmd);
37 }
38
39 public function getObjId(): int
40 {
41 return $this->obj_id;
42 }
43
47 public function setUserId(int $a_usr_id): void
48 {
49 $this->user_id = $a_usr_id;
50 }
51
52 public function getUserId(): int
53 {
54 return $this->user_id;
55 }
56
60 public function parse(): void
61 {
62 $this->initTable();
63
64 $user_data = $this->getParentObject()->object->getTrackingDataAgg($this->getUserId());
65 $data = array();
66 foreach ($user_data as $row) {
67 $data[] = $row;
68 }
69 $this->setData($data);
70 }
71
72
76 protected function fillRow(array $a_set): void
77 {
78 global $DIC;
79 $ilCtrl = $DIC->ctrl();
80
81 $this->tpl->setVariable('VAL_TITLE', $a_set['title']);
82
83 $ilCtrl->setParameter($this->getParentObject(), 'user_id', $this->getUserId());
84 $ilCtrl->setParameter($this->getParentObject(), 'obj_id', $a_set['sco_id']);
85 $this->tpl->setVariable('LINK_SCO', $ilCtrl->getLinkTarget($this->getParentObject(), 'showTrackingItemPerUser'));
86
87 $this->tpl->setVariable('VAL_STATUS', $a_set['status']);
88 $this->tpl->setVariable('VAL_TIME', $a_set['time']);
89 $this->tpl->setVariable('VAL_SCORE', $a_set['score']);
90 }
91
92 protected function initTable(): void
93 {
94 global $DIC;
95 $ilCtrl = $DIC->ctrl();
96
97
98 $this->setFormAction($ilCtrl->getFormAction($this->getParentObject()));
99 $this->setRowTemplate('tpl.scorm_track_item.html', 'components/ILIAS/ScormAicc');
101
102 $this->addColumn($this->lng->txt('title'), 'title', '35%');
103 $this->addColumn($this->lng->txt('cont_status'), 'status', '25%');
104 $this->addColumn($this->lng->txt('cont_time'), 'time', '20%');
105 $this->addColumn($this->lng->txt('cont_score'), 'score', '20%');
106 }
107}
static _lookupFullname(int $a_user_id)
__construct(int $a_obj_id, ?object $a_parent_obj, string $a_parent_cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setData(array $a_data)
Set table data.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26