ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  public function __construct($a_parent_obj, $a_parent_cmd = "")
19  {
20  global $DIC;
21  $ilCtrl = $DIC['ilCtrl'];
22  $lng = $DIC['lng'];
23 
24  parent::__construct($a_parent_obj, $a_parent_cmd);
25 
26  $this->addColumn($lng->txt("question_id"), "qid", "");
27  $this->addColumn($lng->txt("question_title"), "question_title", "35%");
28  $this->addColumn($lng->txt("number_of_answers"), "number_of_answers", "15%");
29  $this->addColumn($lng->txt("output"), "", "20%");
30  $this->addColumn($lng->txt("file_uploads"), "", "20%");
31 
32  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
33  $this->setRowTemplate("tpl.table_results_by_question_row.html", "Modules/Test");
34  $this->setDefaultOrderField("question_title");
35  $this->setDefaultOrderDirection("asc");
36  }
37 
38  protected function fillRow($a_set)
39  {
40  if ($a_set['number_of_answers'] > 0) {
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  case 'qid':
58  case 'number_of_answers':
59  return true;
60 
61  default:
62  return false;
63  }
64  }
65 }
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
global $DIC
Definition: saml.php:7
TableGUI class for results by question.
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
__construct($a_parent_obj, $a_parent_cmd="")
Class ilTable2GUI.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.