ILIAS  release_8 Revision v8.24
class.ilResultsByQuestionTableGUI.php
Go to the documentation of this file.
1<?php
2
30{
31 public function __construct($a_parent_obj, $a_parent_cmd = "")
32 {
33 global $DIC;
34 $ilCtrl = $DIC['ilCtrl'];
35 $lng = $DIC['lng'];
36
37 parent::__construct($a_parent_obj, $a_parent_cmd);
38
39 $this->addColumn($lng->txt("question_id"), "qid", "");
40 $this->addColumn($lng->txt("question_title"), "question_title", "35%");
41 $this->addColumn($lng->txt("number_of_answers"), "number_of_answers", "15%");
42 $this->addColumn($lng->txt("output"), "", "20%");
43 $this->addColumn($lng->txt("file_uploads"), "", "20%");
44
45 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
46 $this->setRowTemplate("tpl.table_results_by_question_row.html", "Modules/Test");
47 $this->setDefaultOrderField("question_title");
48 $this->setDefaultOrderDirection("asc");
49 }
50
51 protected function fillRow(array $a_set): void
52 {
53 if ($a_set['number_of_answers'] > 0) {
54 $this->tpl->setVariable("PDF_EXPORT", $a_set['output']);
55 }
56
57 $this->tpl->setVariable("QUESTION_ID", $a_set['qid']);
58 $this->tpl->setVariable("QUESTION_TITLE", $a_set['question_title']);
59 $this->tpl->setVariable("NUMBER_OF_ANSWERS", $a_set['number_of_answers']);
60 $this->tpl->setVariable("FILE_UPLOADS", $a_set['file_uploads']);
61 }
62
63 public function numericOrdering(string $a_field): bool
64 {
65 switch ($a_field) {
66 case 'qid':
67 case 'number_of_answers':
68 return true;
69
70 default:
71 return false;
72 }
73 }
74}
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
numericOrdering(string $a_field)
Should this field be sorted numeric?
fillRow(array $a_set)
Standard Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
ilLanguage $lng
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc