ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilTestHistoryTableGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
30 {
31  protected ?object $tstObject;
32 
34  {
35  parent::__construct($parent_obj, $parent_cmd);
36 
37  $this->setFormName('questionbrowser');
38  $this->setFormAction($this->ctrl->getFormAction($this->parent_obj, "history"));
39  $this->setStyle('table', 'fullwidth');
40  $this->addColumn($this->lng->txt("assessment_log_datetime"), 'datetime', '25%');
41  $this->addColumn($this->lng->txt("user"), 'user', '25%');
42  $this->addColumn($this->lng->txt("assessment_log_text"), 'log', '50%');
43 
44  $this->setRowTemplate("tpl.il_as_tst_history_row.html", "Modules/Test");
45 
46  $this->setDefaultOrderField("datetime");
47  $this->setDefaultOrderDirection("asc");
48 
49  $this->enable('header');
50  }
51 
52  public function setTestObject($obj): void
53  {
54  $this->tstObject = $obj;
55  }
56 
57  public function fillRow(array $a_set): void
58  {
59  $username = $this->tstObject->userLookupFullName($a_set["user_fi"], true);
60  $this->tpl->setVariable("DATETIME", ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"], IL_CAL_UNIX)));
61  $this->tpl->setVariable("USER", $username);
62  $this->tpl->setVariable("LOG", trim(ilLegacyFormElementsUtil::prepareFormOutput($a_set["logtext"])));
63  }
64 }
enable(string $a_module_name)
Class ilObjTestGUI.
setFormAction(string $a_form_action, bool $a_multipart=false)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static prepareFormOutput($a_str, bool $a_strip=false)
const IL_CAL_UNIX
setFormName(string $a_name="")
setStyle(string $a_element, string $a_style)
__construct(VocabulariesInterface $vocabularies)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
__construct(ilObjTestGUI $parent_obj, string $parent_cmd)
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)