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