ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilTestToplistGUI Class Reference

Scoring class for tests. More...

+ Collaboration diagram for ilTestToplistGUI:

Public Member Functions

 __construct (ilObjTestGUI $a_object)
 
 showResultsToplistByScore ()
 
 showResultsToplistByTime ()
 

Protected Member Functions

 manageTabs (ilTabsGUI $tabsGUI, ilCtrl $ctrl, ilLanguage $lng, $activeTabId)
 

Protected Attributes

 $object
 
 $toplist
 

Private Member Functions

 prepareTable (ilTable2GUI $table_gui)
 

Detailed Description

Scoring class for tests.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 14 of file class.ilTestToplistGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestToplistGUI::__construct ( ilObjTestGUI  $a_object)
Parameters
ilObjTestGUI$a_object

Definition at line 27 of file class.ilTestToplistGUI.php.

28 {
29 $this->object = $a_object->object;
30 $this->toplist = new ilTestTopList($a_object->object);
31 }
Class ilTestTopList.

Member Function Documentation

◆ manageTabs()

ilTestToplistGUI::manageTabs ( ilTabsGUI  $tabsGUI,
ilCtrl  $ctrl,
ilLanguage  $lng,
  $activeTabId 
)
protected

Definition at line 66 of file class.ilTestToplistGUI.php.

67 {
68 $tabsGUI->clearTargets();
69
70 $tabsGUI->setBackTarget(
71 $lng->txt('tst_results_back_introduction'), $ctrl->getLinkTargetByClass('ilObjTestGUI', 'infoScreen')
72 );
73
74 $tabsGUI->addTab(
75 'toplist_by_score', $lng->txt('toplist_by_score'), $ctrl->getLinkTarget($this, 'showResultsToplistByScore')
76 );
77
78 $tabsGUI->addTab(
79 'toplist_by_time', $lng->txt('toplist_by_time'), $ctrl->getLinkTarget($this, 'showResultsToplistByTime')
80 );
81
82 $tabsGUI->setTabActive($activeTabId);
83 }
getLinkTargetByClass($a_class, $a_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get link target for command using gui class name.
getLinkTarget(&$a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get link target for command using gui object.
clearTargets()
clear all targets
setTabActive($a_id)
DEPRECATED.
setBackTarget($a_title, $a_target, $a_frame="")
back target for upper context
addTab($a_id, $a_text, $a_link, $a_frame="")
Add a Tab.
global $lng
Definition: privfeed.php:40

References $lng, ilTabsGUI\addTab(), ilTabsGUI\clearTargets(), ilCtrl\getLinkTarget(), ilCtrl\getLinkTargetByClass(), ilTabsGUI\setBackTarget(), and ilTabsGUI\setTabActive().

+ Here is the call graph for this function:

◆ prepareTable()

ilTestToplistGUI::prepareTable ( ilTable2GUI  $table_gui)
private
Parameters
ilTable2GUI$table_gui

Definition at line 165 of file class.ilTestToplistGUI.php.

166 {
167 global $lng;
168
169 $table_gui->addColumn($lng->txt('toplist_col_rank'));
170 $table_gui->addColumn($lng->txt('toplist_col_participant'));
171 if($this->object->getHighscoreAchievedTS())
172 {
173 $table_gui->addColumn($lng->txt('toplist_col_achieved'));
174 }
175
176 if($this->object->getHighscoreScore())
177 {
178 $table_gui->addColumn($lng->txt('toplist_col_score'));
179 }
180
181 if($this->object->getHighscorePercentage())
182 {
183 $table_gui->addColumn($lng->txt('toplist_col_percentage'));
184 }
185
186 if($this->object->getHighscoreHints())
187 {
188 $table_gui->addColumn($lng->txt('toplist_col_hints'));
189 }
190
191 if($this->object->getHighscoreWTime())
192 {
193 $table_gui->addColumn($lng->txt('toplist_col_wtime'));
194 }
195 $table_gui->setEnableNumInfo(false);
196 $table_gui->setLimit(10);
197 }
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.
setEnableNumInfo($a_val)
Set enable num info.
setLimit($a_limit=0, $a_default_limit=0)
set max.

References $lng, ilTable2GUI\addColumn(), ilTable2GUI\setEnableNumInfo(), and ilTable2GUI\setLimit().

Referenced by showResultsToplistByScore(), and showResultsToplistByTime().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showResultsToplistByScore()

ilTestToplistGUI::showResultsToplistByScore ( )

Definition at line 85 of file class.ilTestToplistGUI.php.

86 {
87 global $ilUser, $lng, $tpl;
88
89 $html = '';
90
91 if($this->object->getHighscoreMode() != ilObjTest::HIGHSCORE_SHOW_OWN_TABLE)
92 {
93 $table_gui = new ilTable2GUI($this);
94 $this->prepareTable($table_gui);
95
96 $data = $this->toplist->getGeneralToplistByPercentage($_GET['ref_id'], $ilUser->getId());
97
98 $table_gui->setRowTemplate('tpl.toplist_tbl_rows.html', 'Modules/Test');
99 $table_gui->setData($data);
100 $table_gui->setTitle(sprintf($lng->txt('toplist_top_n_results'), $this->object->getHighscoreTopNum()));
101
102 $html .= $table_gui->getHTML();
103 }
104
105 if($this->object->getHighscoreMode() != ilObjTest::HIGHSCORE_SHOW_TOP_TABLE)
106 {
107 $table_gui2 = new ilTable2GUI($this);
108
109 $this->prepareTable($table_gui2);
110
111 $data2 = $this->toplist->getUserToplistByPercentage($_GET['ref_id'], $ilUser->getID());
112
113 $table_gui2->setRowTemplate('tpl.toplist_tbl_rows.html', 'Modules/Test');
114 $table_gui2->setData($data2);
115 $table_gui2->setTitle($lng->txt('toplist_your_result'));
116
117 $html .= $table_gui2->getHTML();
118 }
119
120 $tpl->setVariable("ADM_CONTENT", $html);
121 }
global $tpl
Definition: ilias.php:8
$_GET["client_id"]
const HIGHSCORE_SHOW_OWN_TABLE
const HIGHSCORE_SHOW_TOP_TABLE
Class ilTable2GUI.
prepareTable(ilTable2GUI $table_gui)
$html
Definition: example_001.php:87
$data
global $ilUser
Definition: imgupload.php:15

References $_GET, $data, $html, $ilUser, $lng, $tpl, ilObjTest\HIGHSCORE_SHOW_OWN_TABLE, ilObjTest\HIGHSCORE_SHOW_TOP_TABLE, and prepareTable().

+ Here is the call graph for this function:

◆ showResultsToplistByTime()

ilTestToplistGUI::showResultsToplistByTime ( )

Definition at line 123 of file class.ilTestToplistGUI.php.

124 {
125 global $ilUser, $lng, $tpl;
126
127 $html = '';
128
129 if($this->object->getHighscoreMode() != ilObjTest::HIGHSCORE_SHOW_OWN_TABLE)
130 {
131 $table_gui = new ilTable2GUI($this);
132 $this->prepareTable($table_gui);
133
134 $data = $this->toplist->getGeneralToplistByWorkingtime($_GET['ref_id'], $ilUser->getId());
135
136 $table_gui->setRowTemplate('tpl.toplist_tbl_rows.html', 'Modules/Test');
137 $table_gui->setData($data);
138 $table_gui->setTitle(sprintf($lng->txt('toplist_top_n_results'), $this->object->getHighscoreTopNum()));
139
140 $html .= $table_gui->getHTML();
141 }
142
143 if($this->object->getHighscoreMode() != ilObjTest::HIGHSCORE_SHOW_TOP_TABLE)
144 {
145 $table_gui2 = new ilTable2GUI($this);
146
147 $this->prepareTable($table_gui2);
148
149 $data2 = $this->toplist->getUserToplistByWorkingtime($_GET['ref_id'], $ilUser->getID());
150
151 $table_gui2->setRowTemplate('tpl.toplist_tbl_rows.html', 'Modules/Test');
152 $table_gui2->setData($data2);
153 $table_gui2->setTitle($lng->txt('toplist_your_result'));
154
155 $html .= $table_gui2->getHTML();
156 }
157
158 $tpl->setVariable("ADM_CONTENT", $html);
159
160 }

References $_GET, $data, $html, $ilUser, $lng, $tpl, ilObjTest\HIGHSCORE_SHOW_OWN_TABLE, ilObjTest\HIGHSCORE_SHOW_TOP_TABLE, and prepareTable().

+ Here is the call graph for this function:

Field Documentation

◆ $object

ilTestToplistGUI::$object
protected

Definition at line 17 of file class.ilTestToplistGUI.php.

◆ $toplist

ilTestToplistGUI::$toplist
protected

Definition at line 22 of file class.ilTestToplistGUI.php.


The documentation for this class was generated from the following file: