ILIAS  release_8 Revision v8.24
class.ilTestHistoryTableGUI.php
Go to the documentation of this file.
1<?php
2
28{
29 protected ?object $tstObject;
30
31 public function __construct($a_parent_obj, $a_parent_cmd)
32 {
33 parent::__construct($a_parent_obj, $a_parent_cmd);
34
35 global $DIC;
36 $lng = $DIC['lng'];
37 $ilCtrl = $DIC['ilCtrl'];
38
39 $this->lng = $lng;
40 $this->ctrl = $ilCtrl;
41
42 $this->setFormName('questionbrowser');
43 $this->setFormAction($ilCtrl->getFormAction($this->parent_obj, "history"));
44 $this->setStyle('table', 'fullwidth');
45 $this->addColumn($this->lng->txt("assessment_log_datetime"), 'datetime', '25%');
46 $this->addColumn($this->lng->txt("user"), 'user', '25%');
47 $this->addColumn($this->lng->txt("assessment_log_text"), 'log', '50%');
48
49 $this->setRowTemplate("tpl.il_as_tst_history_row.html", "Modules/Test");
50
51 $this->setDefaultOrderField("datetime");
52 $this->setDefaultOrderDirection("asc");
53
54 $this->enable('header');
55 }
56
57 public function setTestObject($obj): void
58 {
59 $this->tstObject = $obj;
60 }
61
62 public function fillRow(array $a_set): void
63 {
64 global $DIC;
65 $ilUser = $DIC['ilUser'];
66 $ilAccess = $DIC['ilAccess'];
67
68 $username = $this->tstObject->userLookupFullName($a_set["user_fi"], true);
69 $this->tpl->setVariable("DATETIME", ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"], IL_CAL_UNIX)));
70 $this->tpl->setVariable("USER", $username);
71 $this->tpl->setVariable("LOG", trim(ilLegacyFormElementsUtil::prepareFormOutput($a_set["logtext"])));
72 }
73}
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
static prepareFormOutput($a_str, bool $a_strip=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFormName(string $a_name="")
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)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
ilLanguage $lng
enable(string $a_module_name)
setStyle(string $a_element, string $a_style)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
fillRow(array $a_set)
Standard Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd)
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc