ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.ilTestDynamicQuestionSetStatisticTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 
5 require_once 'Services/Table/classes/class.ilTable2GUI.php';
6 
17 {
18  const COMPLETE_TABLE_ID = 'tstDynQuestCompleteStat';
19  const FILTERED_TABLE_ID = 'tstDynQuestFilteredStat';
20 
24  protected $taxIds = array();
25 
30 
35 
36  private $taxonomyFilterEnabled = false;
37 
38  private $answerStatusFilterEnabled = false;
39 
43  protected $filterSelection = null;
44 
50  public function __construct(ilCtrl $ctrl, ilLanguage $lng, $a_parent_obj, $a_parent_cmd, $tableId)
51  {
52  $this->setId($tableId);
53  $this->setPrefix($tableId);
54 
55  parent::__construct($a_parent_obj, $a_parent_cmd);
56 
57  global $lng, $ilCtrl;
58 
59  $this->ctrl = $ilCtrl;
60  $this->lng = $lng;
61 
62  $this->setFormName('filteredquestions');
63  $this->setStyle('table', 'fullwidth');
64 
65  $this->setRowTemplate("tpl.il_as_tst_dynamic_question_set_selection_row.html", "Modules/Test");
66 
67  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
68 
69  $this->enable('header');
70  $this->disable('sort');
71  $this->disable('select_all');
72  $this->disable('numinfo');
73 
74  $this->setDisableFilterHiding(true);
75  }
76 
80  public function getFilterSelection()
81  {
83  }
84 
89  {
90  $this->filterSelection = $filterSelection;
91  }
92 
93  public function initTitle($titleLangVar)
94  {
95  $this->setTitle($this->lng->txt($titleLangVar));
96  }
97 
98  public function initColumns($totalQuestionsColumnHeaderLangVar)
99  {
100  $this->addColumn($this->lng->txt($totalQuestionsColumnHeaderLangVar), 'num_total_questions', '250');
101 
102  $this->addColumn($this->lng->txt("tst_num_correct_answered_questions"),'num_correct_answered_questions', '');
103  $this->addColumn($this->lng->txt("tst_num_wrong_answered_questions"),'num_wrong_answered_questions', '');
104  $this->addColumn($this->lng->txt("tst_num_non_answered_questions"),'num_non_answered_questions', '');
105 
107  {
108  $this->addColumn($this->lng->txt("tst_num_postponed_questions"),'num_postponed_questions', '');
109  }
110 
111  if( $this->isShowNumMarkedQuestionsEnabled() )
112  {
113  $this->addColumn($this->lng->txt("tst_num_marked_questions"),'num_marked_questions', '');
114  }
115  }
116 
120  public function initFilter()
121  {
122  if( $this->isTaxonomyFilterEnabled() )
123  {
124  require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
125 
126  foreach($this->taxIds as $taxId)
127  {
128  $postvar = "tax_$taxId";
129 
130  $inp = new ilTaxSelectInputGUI($taxId, $postvar, true);
131  $this->addFilterItem($inp);
132  $inp->readFromSession();
133 
134  if( $this->getFilterSelection()->hasSelectedTaxonomy($taxId) )
135  {
136  $inp->setValue($this->getFilterSelection()->getSelectedTaxonomy($taxId));
137  }
138 
139  $this->filter[$postvar] = $inp->getValue();
140  }
141  }
142 
143  if( $this->isAnswerStatusFilterEnabled() )
144  {
145  require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
146  require_once 'Services/Form/classes/class.ilRadioOption.php';
147 
148  $inp = new ilSelectInputGUI($this->lng->txt('tst_question_answer_status'), 'question_answer_status');
149  $inp->setOptions(array(
150  ilAssQuestionList::ANSWER_STATUS_FILTER_ALL_NON_CORRECT => $this->lng->txt('tst_question_answer_status_all_non_correct'),
151  ilAssQuestionList::ANSWER_STATUS_FILTER_NON_ANSWERED_ONLY => $this->lng->txt('tst_question_answer_status_non_answered'),
152  ilAssQuestionList::ANSWER_STATUS_FILTER_WRONG_ANSWERED_ONLY => $this->lng->txt('tst_question_answer_status_wrong_answered')
153  ));
154  $this->addFilterItem($inp);
155  $inp->readFromSession();
156 
157  if( $this->getFilterSelection()->hasAnswerStatusSelection() )
158  {
159  $inp->setValue($this->getFilterSelection()->getAnswerStatusSelection());
160  }
161 
162  $this->filter['question_answer_status'] = $inp->getValue();
163  }
164  }
165 
173  public function fillRow($data)
174  {
175  $this->tpl->setVariable('NUM_ALL_QUESTIONS', $data['total_all']);
176  $this->tpl->setVariable('NUM_CORRECT_ANSWERED_QUESTIONS', $data['correct_answered']);
177  $this->tpl->setVariable('NUM_WRONG_ANSWERED_QUESTIONS', $data['wrong_answered']);
178  $this->tpl->setVariable('NUM_NON_ANSWERED_QUESTIONS', $data['non_answered']);
179 
181  {
182  $this->tpl->setCurrentBlock('num_postponed');
183  $this->tpl->setVariable("NUM_POSTPONED_QUESTIONS", $data['postponed']);
184  $this->tpl->parseCurrentBlock();
185  }
186 
187  if( $this->isShowNumMarkedQuestionsEnabled() )
188  {
189  $this->tpl->setCurrentBlock('num_marked');
190  $this->tpl->setVariable("NUM_MARKED_QUESTIONS", $data['marked']);
191  $this->tpl->parseCurrentBlock();
192  }
193  }
194 
198  public function setTaxIds($taxIds)
199  {
200  $this->taxIds = $taxIds;
201  }
202 
206  public function getTaxIds()
207  {
208  return $this->taxIds;
209  }
210 
215  {
216  $this->showNumMarkedQuestionsEnabled = $showNumMarkedQuestionsEnabled;
217  }
218 
223  {
225  }
226 
231  {
232  $this->showNumPostponedQuestionsEnabled = $showNumPostponedQuestionsEnabled;
233  }
234 
239  {
241  }
242 
246  public function isAnswerStatusFilterEnabled()
247  {
249  }
250 
255  {
256  $this->answerStatusFilterEnabled = $answerStatusFilterEnabled;
257  }
258 
262  public function isTaxonomyFilterEnabled()
263  {
265  }
266 
271  {
272  $this->taxonomyFilterEnabled = $taxonomyFilterEnabled;
273  }
274 }
275 ?>
setFormName($a_formname)
Set Form name.
This class provides processing control methods.
Select taxonomy nodes input GUI.
This class represents a selection list property in a property form.
setStyle($a_element, $a_style)
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
enable($a_module_name)
enables particular modules of table
setPrefix($a_prefix)
setOptions($a_options)
Set Options.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
const ANSWER_STATUS_FILTER_ALL_NON_CORRECT
answer status filter value domain
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
global $lng
Definition: privfeed.php:40
__construct(ilCtrl $ctrl, ilLanguage $lng, $a_parent_obj, $a_parent_cmd, $tableId)
Constructor.
language handling