ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilResultsByQuestionTableGUI.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 require_once './Services/Table/classes/class.ilTable2GUI.php';
5 
17 {
18 
19  public function __construct($a_parent_obj, $a_parent_cmd = "")
20  {
21  global $ilCtrl, $lng;
22 
23  parent::__construct($a_parent_obj, $a_parent_cmd);
24 
25  $this->addColumn($lng->txt("question_id"), "qid", "");
26  $this->addColumn($lng->txt("question_title"), "question_title", "35%");
27  $this->addColumn($lng->txt("number_of_answers"), "number_of_answers", "15%");
28  $this->addColumn($lng->txt("output"), "", "20%");
29  $this->addColumn($lng->txt("file_uploads"), "", "20%");
30 
31  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
32  $this->setRowTemplate("tpl.table_results_by_question_row.html", "Modules/Test");
33  $this->setDefaultOrderField("question_title");
34  $this->setDefaultOrderDirection("asc");
35  }
36 
37  protected function fillRow($a_set)
38  {
39  if ($a_set['number_of_answers'] > 0)
40  {
41  $this->tpl->setVariable("PDF_EXPORT", $a_set['output']);
42  }
43 
44  $this->tpl->setVariable("QUESTION_ID", $a_set['qid']);
45  $this->tpl->setVariable("QUESTION_TITLE", $a_set['question_title']);
46  $this->tpl->setVariable("NUMBER_OF_ANSWERS", $a_set['number_of_answers']);
47  $this->tpl->setVariable("FILE_UPLOADS", $a_set['file_uploads']);
48  }
49 
54  public function numericOrdering($a_field)
55  {
56  switch($a_field)
57  {
58  case 'qid':
59  case 'number_of_answers':
60  return true;
61 
62  default:
63  return false;
64  }
65  }
66 }