ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilKprimChoiceAnswerFreqStatTableGUI.php
Go to the documentation of this file.
1<?php
2
28{
29 private function getTrueOptionLabel(): string
30 {
31 return $this->question->getTrueOptionLabelTranslation(
32 $this->language,
33 $this->question->getOptionLabel()
34 );
35 }
36
37 private function getFalseOptionLabel(): string
38 {
39 return $this->question->getFalseOptionLabelTranslation(
40 $this->language,
41 $this->question->getOptionLabel()
42 );
43 }
44
45 public function initColumns(): void
46 {
47 $this->addColumn($this->language->txt('tst_corr_answ_stat_tbl_header_answer'), '');
48 $this->addColumn($this->language->txt('tst_corr_answ_stat_tbl_header_frequency') . ': ' . $this->getTrueOptionLabel(), '');
49 $this->addColumn($this->language->txt('tst_corr_answ_stat_tbl_header_frequency') . ': ' . $this->getFalseOptionLabel(), '');
50
51 foreach ($this->getData() as $row) {
52 if (isset($row['addable'])) {
53 $this->setActionsColumnEnabled(true);
54 break;
55 }
56 }
57 }
58
59 public function fillRow(array $a_set): void
60 {
61 $this->tpl->setCurrentBlock('answer');
62 $this->tpl->setVariable('ANSWER', ilLegacyFormElementsUtil::prepareFormOutput($a_set['answer']));
63 $this->tpl->parseCurrentBlock();
64
65 $this->tpl->setCurrentBlock('frequency');
66 $this->tpl->setVariable('FREQUENCY', $a_set['frequency_true']);
67 $this->tpl->parseCurrentBlock();
68
69 $this->tpl->setCurrentBlock('frequency');
70 $this->tpl->setVariable('FREQUENCY', $a_set['frequency_false']);
71 $this->tpl->parseCurrentBlock();
72 }
73}
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.
static prepareFormOutput($a_str, bool $a_strip=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)