ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilKprimChoiceAnswerFreqStatTableGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5require_once 'Modules/TestQuestionPool/classes/tables/class.ilAnswerFrequencyStatisticTableGUI.php';
6
16{
20 protected $question;
21
22 protected function getTrueOptionLabel()
23 {
24 global $DIC; /* @var ILIAS\DI\Container $DIC */
25
26 return $this->question->getTrueOptionLabelTranslation(
27 $DIC->language(),
28 $this->question->getOptionLabel()
29 );
30 }
31
32 protected function getFalseOptionLabel()
33 {
34 global $DIC; /* @var ILIAS\DI\Container $DIC */
35
36 return $this->question->getFalseOptionLabelTranslation(
37 $DIC->language(),
38 $this->question->getOptionLabel()
39 );
40 }
41
42
43 public function initColumns()
44 {
45 $lng = $this->DIC->language();
46 $this->addColumn($lng->txt('tst_corr_answ_stat_tbl_header_answer'), '');
47 $this->addColumn($lng->txt('tst_corr_answ_stat_tbl_header_frequency') . ': ' . $this->getTrueOptionLabel(), '');
48 $this->addColumn($lng->txt('tst_corr_answ_stat_tbl_header_frequency') . ': ' . $this->getFalseOptionLabel(), '');
49
50 foreach ($this->getData() as $row) {
51 if (isset($row['addable'])) {
52 $this->setActionsColumnEnabled(true);
53 $this->addColumn('', '', '1%');
54 break;
55 }
56 }
57 }
58
59 public function fillRow($data)
60 {
61 $this->tpl->setCurrentBlock('answer');
62 $this->tpl->setVariable('ANSWER', \ilUtil::prepareFormOutput($data['answer']));
63 $this->tpl->parseCurrentBlock();
64
65 $this->tpl->setCurrentBlock('frequency');
66 $this->tpl->setVariable('FREQUENCY', $data['frequency_true']);
67 $this->tpl->parseCurrentBlock();
68
69 $this->tpl->setCurrentBlock('frequency');
70 $this->tpl->setVariable('FREQUENCY', $data['frequency_false']);
71 $this->tpl->parseCurrentBlock();
72
73 }
74}
An exception for terminatinating execution or to throw for unit testing.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public