ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilTestPassManualScoringOverviewTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
5include_once('./Services/Table/classes/class.ilTable2GUI.php');
6
15{
22 public function __construct($parentObj, $parentCmd)
23 {
24 parent::__construct($parentObj, $parentCmd);
25
26 global $DIC;
27 $ilCtrl = $DIC['ilCtrl'];
28
29 $this->setPrefix('manScorePassesTable');
30
31 $this->setFormName('manScorePassesTable');
32 $this->setStyle('table', 'fullwidth');
33
34 $this->enable('header');
35
36 $this->setFormAction($ilCtrl->getFormAction($parentObj, $parentCmd));
37
38 $this->setRowTemplate("tpl.il_as_tst_pass_overview_tblrow.html", "Modules/Test");
39
40 $this->initColumns();
41 $this->initOrdering();
42 }
43
44 private function initColumns()
45 {
46 global $DIC;
47 $lng = $DIC['lng'];
48
49 $this->addColumn($lng->txt("scored_pass"), '', '150');
50 $this->addColumn($lng->txt("pass"), 'pass', '');
51 $this->addColumn($lng->txt("date"), 'finishdate', '');
52 $this->addColumn($lng->txt("tst_answered_questions"), 'answered_questions', '');
53 $this->addColumn($lng->txt("tst_reached_points"), 'reached_points', '');
54 $this->addColumn($lng->txt("tst_percent_solved"), 'percentage', '');
55 $this->addColumn('', '', '1%');
56 }
57
58 private function initOrdering()
59 {
60 $this->disable('sort');
61
62 $this->setDefaultOrderField("pass");
63 $this->setDefaultOrderDirection("asc");
64 }
65
71 public function fillRow($row)
72 {
73 //vd($row);
74
75 global $DIC;
76 $ilCtrl = $DIC['ilCtrl'];
77 $lng = $DIC['lng'];
78
79 $ilCtrl->setParameter($this->parent_obj, 'active_id', $row['active_id']);
80 $ilCtrl->setParameter($this->parent_obj, 'pass', $row['pass']);
81
82 if ($row['is_scored_pass']) {
83 $this->tpl->setCurrentBlock('selected_pass');
84 $this->tpl->touchBlock('selected_pass');
85 $this->tpl->parseCurrentBlock();
86 $this->tpl->setVariable('CSS_ROW', 'tblrowmarked');
87 }
88
89 $this->tpl->setVariable("PASS_NR", $row['pass'] + 1);
90 $this->tpl->setVariable("PASS_DATE", ilDatePresentation::formatDate(new ilDate($row['finishdate'], IL_CAL_UNIX)));
91 $this->tpl->setVariable("PASS_ANSWERED_QUESTIONS", $row['answered_questions'] . " " . strtolower($this->lng->txt("of")) . " " . $row['total_questions']);
92 $this->tpl->setVariable("PASS_REACHED_POINTS", $row['reached_points'] . " " . strtolower($this->lng->txt("of")) . " " . $row['max_points']);
93 $this->tpl->setVariable("PASS_REACHED_PERCENTAGE", sprintf("%.2f%%", $row['percentage']));
94
95 $this->tpl->setVariable("TXT_SHOW_PASS", $lng->txt('tst_edit_scoring'));
96 $this->tpl->setVariable("HREF_SHOW_PASS", $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
97 }
98}
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
Class for single dates.
Class ilTable2GUI.
setPrefix($a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setFormName($a_formname="")
Set Form name.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
disable($a_module_name)
diesables particular modules of table
setStyle($a_element, $a_style)
enable($a_module_name)
enables particular modules of table
fillRow($row)
@global ilCtrl $ilCtrl @global ilLanguage $lng
__construct($parentObj, $parentCmd)
@global ilCtrl $ilCtrl @global ilLanguage $lng
global $ilCtrl
Definition: ilias.php:18
$row
global $DIC
Definition: saml.php:7