ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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($this->language, $this->question->getOptionLabel());
32  }
33 
34  private function getFalseOptionLabel(): string
35  {
36  return $this->question->getFalseOptionLabelTranslation($this->language, $this->question->getOptionLabel());
37  }
38 
39  public function initColumns(): void
40  {
41  $this->addColumn($this->language->txt('tst_corr_answ_stat_tbl_header_answer'), '');
42  $this->addColumn($this->language->txt('tst_corr_answ_stat_tbl_header_frequency') . ': ' . $this->getTrueOptionLabel(), '');
43  $this->addColumn($this->language->txt('tst_corr_answ_stat_tbl_header_frequency') . ': ' . $this->getFalseOptionLabel(), '');
44 
45  foreach ($this->getData() as $row) {
46  if (isset($row['addable'])) {
47  $this->setActionsColumnEnabled(true);
48  $this->addColumn('', '', '1%');
49  break;
50  }
51  }
52  }
53 
54  public function fillRow(array $a_set): void
55  {
56  $this->tpl->setCurrentBlock('answer');
57  $this->tpl->setVariable('ANSWER', ilLegacyFormElementsUtil::prepareFormOutput($a_set['answer']));
58  $this->tpl->parseCurrentBlock();
59 
60  $this->tpl->setCurrentBlock('frequency');
61  $this->tpl->setVariable('FREQUENCY', $a_set['frequency_true']);
62  $this->tpl->parseCurrentBlock();
63 
64  $this->tpl->setCurrentBlock('frequency');
65  $this->tpl->setVariable('FREQUENCY', $a_set['frequency_false']);
66  $this->tpl->parseCurrentBlock();
67  }
68 }
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)