ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilResultsByQuestionTableGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
32 {
34  {
35  parent::__construct($parent_obj, $parent_cmd);
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 }
setFormAction(string $a_form_action, bool $a_multipart=false)
TableGUI class for results by question.
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
Output class for assessment test evaluation.
setDefaultOrderDirection(string $a_defaultorderdirection)
__construct(ilTestEvaluationGUI $parent_obj, string $parent_cmd="")
__construct(Container $dic, ilPlugin $plugin)
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)