ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
26  private $taxonomyFilterEnabled = false;
27 
28  private $answerStatusFilterEnabled = false;
29 
33  protected $filterSelection = null;
34 
40  public function __construct(ilCtrl $ctrl, ilLanguage $lng, $a_parent_obj, $a_parent_cmd, $tableId)
41  {
42  $this->setId($tableId);
43  $this->setPrefix($tableId);
44 
45  parent::__construct($a_parent_obj, $a_parent_cmd);
46 
47  global $lng, $ilCtrl;
48 
49  $this->ctrl = $ilCtrl;
50  $this->lng = $lng;
51 
52  $this->setFormName('filteredquestions');
53  $this->setStyle('table', 'fullwidth');
54 
55  $this->setRowTemplate("tpl.il_as_tst_dynamic_question_set_selection_row.html", "Modules/Test");
56 
57  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
58 
59  $this->enable('header');
60  $this->disable('sort');
61  $this->disable('select_all');
62  $this->disable('numinfo');
63 
64  $this->setDisableFilterHiding(true);
65  }
66 
70  public function getFilterSelection()
71  {
73  }
74 
79  {
80  $this->filterSelection = $filterSelection;
81  }
82 
83  public function initTitle($titleLangVar)
84  {
85  $this->setTitle($this->lng->txt($titleLangVar));
86  }
87 
88  public function initColumns($totalQuestionsColumnHeaderLangVar)
89  {
90  $this->addColumn($this->lng->txt($totalQuestionsColumnHeaderLangVar), 'num_total_questions', '250');
91 
92  $this->addColumn($this->lng->txt("tst_num_correct_answered_questions"),'num_correct_answered_questions', '');
93  $this->addColumn($this->lng->txt("tst_num_wrong_answered_questions"),'num_wrong_answered_questions', '');
94  $this->addColumn($this->lng->txt("tst_num_non_answered_questions_skipped"),'num_non_answered_questions_skipped', '');
95  $this->addColumn($this->lng->txt("tst_num_non_answered_questions_notseen"),'num_non_answered_questions_notseen', '');
96  }
97 
101  public function initFilter()
102  {
103  if( $this->isTaxonomyFilterEnabled() )
104  {
105  require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
106 
107  foreach($this->taxIds as $taxId)
108  {
109  $postvar = "tax_$taxId";
110 
111  $inp = new ilTaxSelectInputGUI($taxId, $postvar, true);
112  $this->addFilterItem($inp);
113  #$inp->readFromSession();
114 
115  if( $this->getFilterSelection()->hasSelectedTaxonomy($taxId) )
116  {
117  $inp->setValue($this->getFilterSelection()->getSelectedTaxonomy($taxId));
118  }
119 
120  $this->filter[$postvar] = $inp->getValue();
121  }
122  }
123 
124  if( $this->isAnswerStatusFilterEnabled() )
125  {
126  require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
127  require_once 'Services/Form/classes/class.ilRadioOption.php';
128 
129  $inp = new ilSelectInputGUI($this->lng->txt('tst_question_answer_status'), 'question_answer_status');
130  $inp->setOptions(array(
131  ilAssQuestionList::ANSWER_STATUS_FILTER_ALL_NON_CORRECT => $this->lng->txt('tst_question_answer_status_all_non_correct'),
132  ilAssQuestionList::ANSWER_STATUS_FILTER_NON_ANSWERED_ONLY => $this->lng->txt('tst_question_answer_status_non_answered'),
133  ilAssQuestionList::ANSWER_STATUS_FILTER_WRONG_ANSWERED_ONLY => $this->lng->txt('tst_question_answer_status_wrong_answered')
134  ));
135  $this->addFilterItem($inp);
136  $inp->readFromSession();
137 
138  if( $this->getFilterSelection()->hasAnswerStatusSelection() )
139  {
140  $inp->setValue($this->getFilterSelection()->getAnswerStatusSelection());
141  }
142 
143  $this->filter['question_answer_status'] = $inp->getValue();
144  }
145  }
146 
154  public function fillRow($data)
155  {
156  $this->tpl->setVariable('NUM_ALL_QUESTIONS', $data['total_all']);
157  $this->tpl->setVariable('NUM_CORRECT_ANSWERED_QUESTIONS', $data['correct_answered']);
158  $this->tpl->setVariable('NUM_WRONG_ANSWERED_QUESTIONS', $data['wrong_answered']);
159  $this->tpl->setVariable('NUM_NON_ANSWERED_QUESTIONS_SKIPPED', $data['non_answered_skipped']);
160  $this->tpl->setVariable('NUM_NON_ANSWERED_QUESTIONS_NOTSEEN', $data['non_answered_notseen']);
161  }
162 
166  public function setTaxIds($taxIds)
167  {
168  $this->taxIds = $taxIds;
169  }
170 
174  public function getTaxIds()
175  {
176  return $this->taxIds;
177  }
178 
182  public function isAnswerStatusFilterEnabled()
183  {
185  }
186 
191  {
192  $this->answerStatusFilterEnabled = $answerStatusFilterEnabled;
193  }
194 
198  public function isTaxonomyFilterEnabled()
199  {
201  }
202 
207  {
208  $this->taxonomyFilterEnabled = $taxonomyFilterEnabled;
209  }
210 }
211 ?>
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.
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.
Create styles array
The data for the language used.
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
setFormName($a_formname="")
Set Form name.
global $lng
Definition: privfeed.php:17
__construct(ilCtrl $ctrl, ilLanguage $lng, $a_parent_obj, $a_parent_cmd, $tableId)
Constructor.
language handling
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.