ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
5 include_once('./Services/Table/classes/class.ilTable2GUI.php');
6 
15 {
22  public function __construct($parentObj, $parentCmd)
23  {
24  parent::__construct($parentObj, $parentCmd);
25 
26  global $ilCtrl;
27 
28  $this->setPrefix('manScorePassesTable');
29 
30  $this->setFormName('manScorePassesTable');
31  $this->setStyle('table', 'fullwidth');
32 
33  $this->enable('header');
34 
35  $this->setFormAction($ilCtrl->getFormAction($parentObj, $parentCmd));
36 
37  $this->setRowTemplate("tpl.il_as_tst_pass_overview_tblrow.html", "Modules/Test");
38 
39  $this->initColumns();
40  $this->initOrdering();
41  }
42 
43  private function initColumns()
44  {
45  global $lng;
46 
47  $this->addColumn($lng->txt("scored_pass"),'', '150');
48  $this->addColumn($lng->txt("pass"),'pass', '');
49  $this->addColumn($lng->txt("date"),'finishdate', '');
50  $this->addColumn($lng->txt("tst_answered_questions"),'answered_questions', '');
51  $this->addColumn($lng->txt("tst_reached_points"),'reached_points', '');
52  $this->addColumn($lng->txt("tst_percent_solved"),'percentage', '');
53  $this->addColumn('','', '1%');
54  }
55 
56  private function initOrdering()
57  {
58  $this->disable('sort');
59 
60  $this->setDefaultOrderField("pass");
61  $this->setDefaultOrderDirection("asc");
62  }
63 
69  public function fillRow($row)
70  {
71  //vd($row);
72 
73  global $ilCtrl, $lng;
74 
75  $ilCtrl->setParameter($this->parent_obj, 'active_id', $row['active_id']);
76  $ilCtrl->setParameter($this->parent_obj, 'pass', $row['pass']);
77 
78  if( $row['is_scored_pass'] )
79  {
80  $this->tpl->setCurrentBlock('selected_pass');
81  $this->tpl->touchBlock('selected_pass');
82  $this->tpl->parseCurrentBlock();
83  $this->tpl->setVariable('CSS_ROW', 'tblrowmarked');
84  }
85 
86  $this->tpl->setVariable("PASS_NR", $row['pass'] + 1);
87  $this->tpl->setVariable("PASS_DATE", ilDatePresentation::formatDate(new ilDate($row['finishdate'],IL_CAL_UNIX)));
88  $this->tpl->setVariable("PASS_ANSWERED_QUESTIONS", $row['answered_questions']." ".strtolower($this->lng->txt("of"))." ".$row['total_questions']);
89  $this->tpl->setVariable("PASS_REACHED_POINTS", $row['reached_points']." ".strtolower($this->lng->txt("of"))." ".$row['max_points']);
90  $this->tpl->setVariable("PASS_REACHED_PERCENTAGE", sprintf("%.2f%%", $row['percentage']));
91 
92  $this->tpl->setVariable("TXT_SHOW_PASS", $lng->txt('tst_edit_scoring'));
93  $this->tpl->setVariable("HREF_SHOW_PASS", $ilCtrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
94  }
95 }
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setStyle($a_element, $a_style)
const IL_CAL_UNIX
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
Class ilTable2GUI.
Class for single dates.
enable($a_module_name)
enables particular modules of table
static formatDate(ilDateTime $date)
Format a date public.
setPrefix($a_prefix)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
setFormName($a_formname="")
Set Form name.
global $lng
Definition: privfeed.php:17
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.
__construct($parentObj, $parentCmd)
ilCtrl $ilCtrl ilLanguage $lng