ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
41  public function __construct(ilCtrl $ctrl, ilLanguage $lng, $a_parent_obj, $a_parent_cmd, $tableId)
42  {
43  $this->setId($tableId);
44  $this->setPrefix($tableId);
45 
46  parent::__construct($a_parent_obj, $a_parent_cmd);
47 
48  global $lng, $ilCtrl;
49 
50  $this->ctrl = $ilCtrl;
51  $this->lng = $lng;
52 
53  $this->setFormName('filteredquestions');
54  $this->setStyle('table', 'fullwidth');
55 
56  $this->setRowTemplate("tpl.il_as_tst_dynamic_question_set_selection_row.html", "Modules/Test");
57 
58  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
59 
60  $this->enable('header');
61  $this->disable('sort');
62  $this->disable('select_all');
63  $this->disable('numinfo');
64 
65  $this->setDisableFilterHiding(true);
66  }
67 
68  public function initTitle($titleLangVar)
69  {
70  $this->setTitle($this->lng->txt($titleLangVar));
71  }
72 
73  public function initColumns($totalQuestionsColumnHeaderLangVar)
74  {
75  $this->addColumn($this->lng->txt($totalQuestionsColumnHeaderLangVar), 'num_total_questions', '250');
76 
77  $this->addColumn($this->lng->txt("tst_num_correct_answered_questions"),'num_correct_answered_questions', '');
78  $this->addColumn($this->lng->txt("tst_num_wrong_answered_questions"),'num_wrong_answered_questions', '');
79  $this->addColumn($this->lng->txt("tst_num_non_answered_questions"),'num_non_answered_questions', '');
80 
82  {
83  $this->addColumn($this->lng->txt("tst_num_postponed_questions"),'num_postponed_questions', '');
84  }
85 
86  if( $this->isShowNumMarkedQuestionsEnabled() )
87  {
88  $this->addColumn($this->lng->txt("tst_num_marked_questions"),'num_marked_questions', '');
89  }
90  }
91 
95  public function initFilter()
96  {
97  require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
98  require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
99  require_once 'Services/Form/classes/class.ilRadioOption.php';
100 
101  foreach($this->taxIds as $taxId)
102  {
103  $postvar = "tax_$taxId";
104 
105  $inp = new ilTaxSelectInputGUI($taxId, $postvar, true);
106  $this->addFilterItem($inp);
107  $inp->readFromSession();
108  $this->filter[$postvar] = $inp->getValue();
109  }
110 
111  $inp = new ilSelectInputGUI($this->lng->txt('tst_question_answer_status'), 'question_answer_status');
112  $inp->setOptions(array(
113  ilAssQuestionList::ANSWER_STATUS_FILTER_ALL_NON_CORRECT => $this->lng->txt('tst_question_answer_status_all_non_correct'),
114  ilAssQuestionList::ANSWER_STATUS_FILTER_NON_ANSWERED_ONLY => $this->lng->txt('tst_question_answer_status_non_answered'),
115  ilAssQuestionList::ANSWER_STATUS_FILTER_WRONG_ANSWERED_ONLY => $this->lng->txt('tst_question_answer_status_wrong_answered')
116  ));
117  $this->addFilterItem($inp);
118  $inp->readFromSession();
119  $this->filter['question_answer_status'] = $inp->getValue();
120  }
121 
129  public function fillRow($data)
130  {
131  $this->tpl->setVariable('NUM_ALL_QUESTIONS', $data['total_all']);
132  $this->tpl->setVariable('NUM_CORRECT_ANSWERED_QUESTIONS', $data['correct_answered']);
133  $this->tpl->setVariable('NUM_WRONG_ANSWERED_QUESTIONS', $data['wrong_answered']);
134  $this->tpl->setVariable('NUM_NON_ANSWERED_QUESTIONS', $data['non_answered']);
135 
137  {
138  $this->tpl->setCurrentBlock('num_postponed');
139  $this->tpl->setVariable("NUM_POSTPONED_QUESTIONS", $data['postponed']);
140  $this->tpl->parseCurrentBlock();
141  }
142 
143  if( $this->isShowNumMarkedQuestionsEnabled() )
144  {
145  $this->tpl->setCurrentBlock('num_marked');
146  $this->tpl->setVariable("NUM_MARKED_QUESTIONS", $data['marked']);
147  $this->tpl->parseCurrentBlock();
148  }
149  }
150 
154  public function setTaxIds($taxIds)
155  {
156  $this->taxIds = $taxIds;
157  }
158 
162  public function getTaxIds()
163  {
164  return $this->taxIds;
165  }
166 
171  {
172  $this->showNumMarkedQuestionsEnabled = $showNumMarkedQuestionsEnabled;
173  }
174 
179  {
181  }
182 
187  {
188  $this->showNumPostponedQuestionsEnabled = $showNumPostponedQuestionsEnabled;
189  }
190 
195  {
197  }
198 }
199 ?>