Scoring class for tests.
More...
Scoring class for tests.
- Author
- Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
- Version
- $Id$
Definition at line 13 of file class.ilTestToplistGUI.php.
◆ __construct()
ilTestToplistGUI::__construct |
( |
|
$a_object | ) |
|
◆ formatTime()
ilTestToplistGUI::formatTime |
( |
|
$seconds | ) |
|
|
private |
- Parameters
-
- Returns
- string
Definition at line 196 of file class.ilTestToplistGUI.php.
References $data, $ilDB, $result, $row, and getResultTableRow().
Referenced by getResultTableRow().
199 $hours = intval(intval($seconds) / 3600);
200 $retval .= str_pad($hours, 2,
"0", STR_PAD_LEFT) .
":";
201 $minutes = intval(($seconds / 60) % 60);
202 $retval .= str_pad($minutes, 2,
"0", STR_PAD_LEFT) .
":";
203 $seconds = intval($seconds % 60);
204 $retval .= str_pad($seconds, 2,
"0", STR_PAD_LEFT);
◆ getResultTableRow()
ilTestToplistGUI::getResultTableRow |
( |
|
$row, |
|
|
|
$i, |
|
|
|
$a_user_id |
|
) |
| |
|
private |
- Parameters
-
array | $row | |
int | $i | |
int | $a_user_id | |
- Returns
- array
Definition at line 285 of file class.ilTestToplistGUI.php.
References $data, $ilDB, $result, $row, formatTime(), and IL_CAL_UNIX.
Referenced by formatTime().
288 $item[
'Rank'] = $i .
'. ';
290 if($this->object->isHighscoreAnon() &&
$row[
'usr_id'] != $a_user_id)
292 $item[
'Participant'] =
"-, -";
296 $item[
'Participant'] =
$row[
'lastname'] .
', ' .
$row[
'firstname'];
299 if($this->object->getHighscoreAchievedTS())
305 if($this->object->getHighscoreScore())
307 $item[
'Score'] =
$row[
'reached_points'] .
' / ' .
$row[
'max_points'];
310 if($this->object->getHighscorePercentage())
312 $item[
'Percentage'] =
$row[
'percentage'] .
'%';
315 if($this->object->getHighscoreHints())
317 $item[
'Hints'] =
$row[
'hint_count'];
320 if($this->object->getHighscoreWTime())
325 $item[
'Highlight'] = (
$row[
'usr_id'] == $a_user_id) ?
'tblrowmarked' :
'';
◆ manageTabs()
Definition at line 59 of file class.ilTestToplistGUI.php.
References ilTabsGUI\addTab(), ilTabsGUI\clearTargets(), ilCtrl\getLinkTarget(), ilCtrl\getLinkTargetByClass(), ilTabsGUI\setBackTarget(), ilTabsGUI\setTabActive(), and ilLanguage\txt().
Referenced by __construct().
68 'toplist_by_score', $lng->
txt(
'toplist_by_score'), $ctrl->
getLinkTarget($this,
'showResultsToplistByScore')
72 'toplist_by_time', $lng->
txt(
'toplist_by_time'), $ctrl->
getLinkTarget($this,
'showResultsToplistByTime')
setTabActive($a_id)
DEPRECATED.
getLinkTarget(&$a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get link target for command using gui object.
getLinkTargetByClass($a_class, $a_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get link target for command using gui class name.
setBackTarget($a_title, $a_target, $a_frame="")
back target for upper context
clearTargets()
clear all targets
addTab($a_id, $a_text, $a_link, $a_frame="")
Add a Tab.
txt($a_topic, $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...
◆ prepareTable()
ilTestToplistGUI::prepareTable |
( |
ilTable2GUI |
$table_gui | ) |
|
|
private |
- Parameters
-
Definition at line 158 of file class.ilTestToplistGUI.php.
References $lng, ilTable2GUI\addColumn(), ilTable2GUI\setEnableNumInfo(), and ilTableGUI\setLimit().
Referenced by showResultsToplistByScore(), and showResultsToplistByTime().
162 $table_gui->
addColumn($lng->txt(
'toplist_col_rank'));
163 $table_gui->
addColumn($lng->txt(
'toplist_col_participant'));
164 if($this->object->getHighscoreAchievedTS())
166 $table_gui->
addColumn($lng->txt(
'toplist_col_achieved'));
169 if($this->object->getHighscoreScore())
171 $table_gui->
addColumn($lng->txt(
'toplist_col_score'));
174 if($this->object->getHighscorePercentage())
176 $table_gui->
addColumn($lng->txt(
'toplist_col_percentage'));
179 if($this->object->getHighscoreHints())
181 $table_gui->
addColumn($lng->txt(
'toplist_col_hints'));
184 if($this->object->getHighscoreWTime())
186 $table_gui->
addColumn($lng->txt(
'toplist_col_wtime'));
setEnableNumInfo($a_val)
Set enable num info.
setLimit($a_limit=0, $a_default_limit=0)
set max.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
◆ showResultsToplistByScore()
ilTestToplistGUI::showResultsToplistByScore |
( |
| ) |
|
Definition at line 78 of file class.ilTestToplistGUI.php.
References $_GET, $data, $ilUser, $lng, $tpl, ilObjTest\HIGHSCORE_SHOW_OWN_TABLE, ilObjTest\HIGHSCORE_SHOW_TOP_TABLE, and prepareTable().
Referenced by __construct().
89 $data = $this->getGeneralToplistByPercentage(
$_GET[
'ref_id'], $ilUser->getId());
91 $table_gui->setRowTemplate(
'tpl.toplist_tbl_rows.html',
'Modules/Test');
92 $table_gui->setData(
$data);
93 $table_gui->setTitle(sprintf($lng->txt(
'toplist_top_n_results'), $this->
object->getHighscoreTopNum()));
95 $html .= $table_gui->getHTML();
104 $data2 = $this->getUserToplistByPercentage(
$_GET[
'ref_id'], $ilUser->getID());
106 $table_gui2->setRowTemplate(
'tpl.toplist_tbl_rows.html',
'Modules/Test');
107 $table_gui2->setData($data2);
108 $table_gui2->setTitle($lng->txt(
'toplist_your_result'));
110 $html .= $table_gui2->getHTML();
113 $tpl->setVariable(
"ADM_CONTENT", $html);
prepareTable(ilTable2GUI $table_gui)
const HIGHSCORE_SHOW_TOP_TABLE
const HIGHSCORE_SHOW_OWN_TABLE
◆ showResultsToplistByTime()
ilTestToplistGUI::showResultsToplistByTime |
( |
| ) |
|
Definition at line 116 of file class.ilTestToplistGUI.php.
References $_GET, $data, $ilUser, $lng, $tpl, ilObjTest\HIGHSCORE_SHOW_OWN_TABLE, ilObjTest\HIGHSCORE_SHOW_TOP_TABLE, and prepareTable().
Referenced by __construct().
127 $data = $this->getGeneralToplistByWorkingtime(
$_GET[
'ref_id'], $ilUser->getId());
129 $table_gui->setRowTemplate(
'tpl.toplist_tbl_rows.html',
'Modules/Test');
130 $table_gui->setData(
$data);
131 $table_gui->setTitle(sprintf($lng->txt(
'toplist_top_n_results'), $this->
object->getHighscoreTopNum()));
133 $html .= $table_gui->getHTML();
142 $data2 = $this->getUserToplistByWorkingtime(
$_GET[
'ref_id'], $ilUser->getID());
144 $table_gui2->setRowTemplate(
'tpl.toplist_tbl_rows.html',
'Modules/Test');
145 $table_gui2->setData($data2);
146 $table_gui2->setTitle($lng->txt(
'toplist_your_result'));
148 $html .= $table_gui2->getHTML();
151 $tpl->setVariable(
"ADM_CONTENT", $html);
prepareTable(ilTable2GUI $table_gui)
const HIGHSCORE_SHOW_TOP_TABLE
const HIGHSCORE_SHOW_OWN_TABLE
◆ $object
ilTestToplistGUI::$object |
|
protected |
The documentation for this class was generated from the following file: