ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilTestPassManualScoringOverviewTableGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
29 {
31  {
32  $this->setPrefix('manScorePassesTable');
33 
34  parent::__construct($parent_obj, $parent_cmd);
35 
36  $this->setFormName('manScorePassesTable');
37  $this->setStyle('table', 'fullwidth');
38 
39  $this->enable('header');
40 
41  $this->setFormAction($this->ctrl->getFormAction($parent_obj, $parent_cmd));
42 
43  $this->setRowTemplate("tpl.il_as_tst_pass_overview_tblrow.html", "Modules/Test");
44 
45  $this->initColumns();
46  $this->initOrdering();
47  }
48 
49  private function initColumns(): void
50  {
51  $this->addColumn($this->lng->txt("scored_pass"), '', '150');
52  $this->addColumn($this->lng->txt("pass"), 'pass', '');
53  $this->addColumn($this->lng->txt("date"), 'finishdate', '');
54  $this->addColumn($this->lng->txt("tst_answered_questions"), 'answered_questions', '');
55  $this->addColumn($this->lng->txt("tst_reached_points"), 'reached_points', '');
56  $this->addColumn($this->lng->txt("tst_percent_solved"), 'percentage', '');
57  $this->addColumn($this->lng->txt("actions"), '', '1%');
58  }
59 
60  private function initOrdering(): void
61  {
62  $this->disable('sort');
63 
64  $this->setDefaultOrderField("pass");
65  $this->setDefaultOrderDirection("asc");
66  }
67 
68  public function fillRow(array $a_set): void
69  {
70  $this->ctrl->setParameter($this->parent_obj, 'active_id', $a_set['active_id']);
71  $this->ctrl->setParameter($this->parent_obj, 'pass', $a_set['pass']);
72 
73  if ($a_set['is_scored_pass']) {
74  $this->tpl->setCurrentBlock('selected_pass');
75  $this->tpl->touchBlock('selected_pass');
76  $this->tpl->parseCurrentBlock();
77  $this->tpl->setVariable('CSS_ROW', 'tblrowmarked');
78  }
79 
80  $this->tpl->setVariable("PASS_NR", $a_set['pass'] + 1);
81  $this->tpl->setVariable("PASS_DATE", ilDatePresentation::formatDate(new ilDate($a_set['finishdate'], IL_CAL_UNIX)));
82  $this->tpl->setVariable("PASS_ANSWERED_QUESTIONS", $a_set['answered_questions'] . " " . strtolower($this->lng->txt("of")) . " " . $a_set['total_questions']);
83  $this->tpl->setVariable("PASS_REACHED_POINTS", $a_set['reached_points'] . " " . strtolower($this->lng->txt("of")) . " " . $a_set['max_points']);
84  $this->tpl->setVariable("PASS_REACHED_PERCENTAGE", sprintf("%.2f%%", $a_set['percentage']));
85 
86  $this->tpl->setVariable("TXT_SHOW_PASS", $this->lng->txt('tst_edit_scoring'));
87  $this->tpl->setVariable("HREF_SHOW_PASS", $this->ctrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
88  }
89 }
enable(string $a_module_name)
setFormAction(string $a_form_action, bool $a_multipart=false)
__construct(ilTestScoringGUI $parent_obj, string $parent_cmd)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
Scoring class for tests.
const IL_CAL_UNIX
setFormName(string $a_name="")
setStyle(string $a_element, string $a_style)
__construct(VocabulariesInterface $vocabularies)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
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)
disable(string $a_module_name)
setPrefix(string $a_prefix)