ILIAS  release_8 Revision v8.24
class.ilKprimChoiceAnswerFreqStatTableGUI.php
Go to the documentation of this file.
1<?php
2
28{
29 protected function getTrueOptionLabel()
30 {
31 global $DIC; /* @var ILIAS\DI\Container $DIC */
32
33 return $this->question->getTrueOptionLabelTranslation(
34 $DIC->language(),
35 $this->question->getOptionLabel()
36 );
37 }
38
39 protected function getFalseOptionLabel()
40 {
41 global $DIC; /* @var ILIAS\DI\Container $DIC */
42
43 return $this->question->getFalseOptionLabelTranslation(
44 $DIC->language(),
45 $this->question->getOptionLabel()
46 );
47 }
48
49
50 public function initColumns(): void
51 {
52 $lng = $this->DIC->language();
53 $this->addColumn($lng->txt('tst_corr_answ_stat_tbl_header_answer'), '');
54 $this->addColumn($lng->txt('tst_corr_answ_stat_tbl_header_frequency') . ': ' . $this->getTrueOptionLabel(), '');
55 $this->addColumn($lng->txt('tst_corr_answ_stat_tbl_header_frequency') . ': ' . $this->getFalseOptionLabel(), '');
56
57 foreach ($this->getData() as $row) {
58 if (isset($row['addable'])) {
59 $this->setActionsColumnEnabled(true);
60 $this->addColumn('', '', '1%');
61 break;
62 }
63 }
64 }
65
66 public function fillRow(array $a_set): void
67 {
68 $this->tpl->setCurrentBlock('answer');
69 $this->tpl->setVariable('ANSWER', ilLegacyFormElementsUtil::prepareFormOutput($a_set['answer']));
70 $this->tpl->parseCurrentBlock();
71
72 $this->tpl->setCurrentBlock('frequency');
73 $this->tpl->setVariable('FREQUENCY', $a_set['frequency_true']);
74 $this->tpl->parseCurrentBlock();
75
76 $this->tpl->setCurrentBlock('frequency');
77 $this->tpl->setVariable('FREQUENCY', $a_set['frequency_false']);
78 $this->tpl->parseCurrentBlock();
79 }
80}
fillRow(array $a_set)
Standard Version of Fill Row.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
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)
ilLanguage $lng
global $DIC
Definition: feed.php:28