ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
TestScoringByParticipantPassesOverviewTableGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
31 {
33  {
34  $this->setPrefix('manScorePassesTable');
35 
36  parent::__construct($parent_obj, $parent_cmd);
37 
38  $this->setFormName('manScorePassesTable');
39  $this->setStyle('table', 'fullwidth');
40 
41  $this->enable('header');
42 
43  $this->setFormAction($this->ctrl->getFormAction($parent_obj, $parent_cmd));
44 
45  $this->setRowTemplate("tpl.il_as_tst_pass_overview_tblrow.html", "components/ILIAS/Test");
46 
47  $this->initColumns();
48  $this->initOrdering();
49  }
50 
51  private function initColumns(): void
52  {
53  $this->addColumn($this->lng->txt("scored_pass"), '', '150');
54  $this->addColumn($this->lng->txt("pass"), 'pass', '');
55  $this->addColumn($this->lng->txt("date"), 'finishdate', '');
56  $this->addColumn($this->lng->txt("tst_answered_questions"), 'answered_questions', '');
57  $this->addColumn($this->lng->txt("tst_reached_points"), 'reached_points', '');
58  $this->addColumn($this->lng->txt("tst_percent_solved"), 'percentage', '');
59  $this->addColumn('', '', '1%');
60  }
61 
62  private function initOrdering(): void
63  {
64  $this->disable('sort');
65 
66  $this->setDefaultOrderField("pass");
67  $this->setDefaultOrderDirection("asc");
68  }
69 
70  public function fillRow(array $a_set): void
71  {
72  $this->ctrl->setParameter($this->parent_obj, 'active_id', $a_set['active_id']);
73  $this->ctrl->setParameter($this->parent_obj, 'pass', $a_set['pass']);
74 
75  if ($a_set['is_scored_pass']) {
76  $this->tpl->setCurrentBlock('selected_pass');
77  $this->tpl->touchBlock('selected_pass');
78  $this->tpl->parseCurrentBlock();
79  $this->tpl->setVariable('CSS_ROW', 'tblrowmarked');
80  }
81 
82  $this->tpl->setVariable("PASS_NR", $a_set['pass'] + 1);
83  $this->tpl->setVariable("PASS_DATE", \ilDatePresentation::formatDate(new \ilDate($a_set['finishdate'], IL_CAL_UNIX)));
84  $this->tpl->setVariable("PASS_ANSWERED_QUESTIONS", $a_set['answered_questions'] . " " . strtolower($this->lng->txt("of")) . " " . $a_set['total_questions']);
85  $this->tpl->setVariable("PASS_REACHED_POINTS", $a_set['reached_points'] . " " . strtolower($this->lng->txt("of")) . " " . $a_set['max_points']);
86  $this->tpl->setVariable("PASS_REACHED_PERCENTAGE", sprintf("%.2f%%", $a_set['percentage']));
87 
88  $this->tpl->setVariable("TXT_SHOW_PASS", $this->lng->txt('tst_edit_scoring'));
89  $this->tpl->setVariable("HREF_SHOW_PASS", $this->ctrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
90  }
91 }
enable(string $a_module_name)
setFormAction(string $a_form_action, bool $a_multipart=false)
const IL_CAL_UNIX
setFormName(string $a_name="")
setStyle(string $a_element, string $a_style)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
__construct(Container $dic, ilPlugin $plugin)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
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)