ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilResultsByQuestionTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
32{
34 {
36
37 $this->addColumn($this->lng->txt("question_id"), "qid", "");
38 $this->addColumn($this->lng->txt("question_title"), "question_title", "35%");
39 $this->addColumn($this->lng->txt("number_of_answers"), "number_of_answers", "15%");
40 $this->addColumn($this->lng->txt("output"), "", "20%");
41 $this->addColumn($this->lng->txt("file_uploads"), "", "20%");
42
43 $this->setFormAction($this->ctrl->getFormAction($parent_obj));
44 $this->setRowTemplate("tpl.table_results_by_question_row.html", "components/ILIAS/Test");
45 $this->setDefaultOrderField("question_title");
46 $this->setDefaultOrderDirection("asc");
47 }
48
49 protected function fillRow(array $a_set): void
50 {
51 if ($a_set['number_of_answers'] > 0) {
52 $this->tpl->setVariable("PRINT_ANSWERS", $a_set['output']);
53 }
54
55 $this->tpl->setVariable("QUESTION_ID", $a_set['qid']);
56 $this->tpl->setVariable("QUESTION_TITLE", $a_set['question_title']);
57 $this->tpl->setVariable("NUMBER_OF_ANSWERS", $a_set['number_of_answers']);
58 $this->tpl->setVariable("FILE_UPLOADS", $a_set['file_uploads']);
59 }
60
61 public function numericOrdering(string $a_field): bool
62 {
63 switch ($a_field) {
64 case 'qid':
65 case 'number_of_answers':
66 return true;
67
68 default:
69 return false;
70 }
71 }
72}
TableGUI class for results by question.
numericOrdering(string $a_field)
Should this field be sorted numeric?
__construct(ilTestEvaluationGUI $parent_obj, string $parent_cmd="")
fillRow(array $a_set)
Standard Version of Fill Row.
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)
Output class for assessment test evaluation.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc