ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
4require_once './Services/Table/classes/class.ilTable2GUI.php';
5
17{
18 public function __construct($a_parent_obj, $a_parent_cmd = "")
19 {
20 global $ilCtrl, $lng;
21
22 parent::__construct($a_parent_obj, $a_parent_cmd);
23
24 $this->addColumn($lng->txt("question_id"), "qid", "");
25 $this->addColumn($lng->txt("question_title"), "question_title", "35%");
26 $this->addColumn($lng->txt("number_of_answers"), "number_of_answers", "15%");
27 $this->addColumn($lng->txt("output"), "", "20%");
28 $this->addColumn($lng->txt("file_uploads"), "", "20%");
29
30 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
31 $this->setRowTemplate("tpl.table_results_by_question_row.html", "Modules/Test");
32 $this->setDefaultOrderField("question_title");
33 $this->setDefaultOrderDirection("asc");
34 }
35
36 protected function fillRow($a_set)
37 {
38 if ($a_set['number_of_answers'] > 0) {
39 $this->tpl->setVariable("PDF_EXPORT", $a_set['output']);
40 }
41
42 $this->tpl->setVariable("QUESTION_ID", $a_set['qid']);
43 $this->tpl->setVariable("QUESTION_TITLE", $a_set['question_title']);
44 $this->tpl->setVariable("NUMBER_OF_ANSWERS", $a_set['number_of_answers']);
45 $this->tpl->setVariable("FILE_UPLOADS", $a_set['file_uploads']);
46 }
47
52 public function numericOrdering($a_field)
53 {
54 switch ($a_field) {
55 case 'qid':
56 case 'number_of_answers':
57 return true;
58
59 default:
60 return false;
61 }
62 }
63}
An exception for terminatinating execution or to throw for unit testing.
TableGUI class for results by question.
fillRow($a_set)
Standard Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd="")
Constructor.
Class ilTable2GUI.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
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.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
global $ilCtrl
Definition: ilias.php:18