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 14 of file class.ilTestToplistGUI.php.
◆ __construct()
ilTestToplistGUI::__construct |
( |
|
$a_object | ) |
|
◆ formatTime()
ilTestToplistGUI::formatTime |
( |
|
$seconds | ) |
|
|
private |
- Parameters
-
- Returns
- string
Definition at line 181 of file class.ilTestToplistGUI.php.
References $data, $result, $row, and getResultTableRow().
Referenced by getResultTableRow().
184 $hours = intval(intval($seconds) / 3600);
185 $retval .= str_pad($hours, 2,
"0", STR_PAD_LEFT).
":";
186 $minutes = intval(($seconds / 60) % 60);
187 $retval .= str_pad($minutes, 2,
"0", STR_PAD_LEFT).
":";
188 $seconds = intval($seconds % 60);
189 $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 273 of file class.ilTestToplistGUI.php.
References $data, $result, $row, formatTime(), and IL_CAL_UNIX.
Referenced by formatTime().
276 $item[
'Rank'] = $i .
'. ';
278 if ($this->object->isHighscoreAnon() &&
$row[
'usr_id'] != $a_user_id)
280 $item[
'Participant'] =
"-, -";
284 $item[
'Participant'] =
$row[
'lastname'] .
', ' .
$row[
'firstname'];
287 if ($this->object->getHighscoreAchievedTS())
293 if ($this->object->getHighscoreScore())
295 $item[
'Score'] =
$row[
'reached_points'] .
' / ' .
$row[
'max_points'];
298 if ($this->object->getHighscorePercentage())
300 $item[
'Percentage'] =
$row[
'percentage'] .
'%';
303 if ($this->object->getHighscoreHints())
305 $item[
'Hints'] =
$row[
'hint_count'];
308 if ($this->object->getHighscoreWTime())
313 $item[
'Highlight'] = (
$row[
'usr_id'] == $a_user_id) ?
'tblrowmarked' :
'';
◆ prepareTable()
ilTestToplistGUI::prepareTable |
( |
ilTable2GUI |
$table_gui | ) |
|
|
private |
- Parameters
-
Definition at line 142 of file class.ilTestToplistGUI.php.
References $lng, ilTable2GUI\addColumn(), ilTable2GUI\setEnableNumInfo(), and ilTableGUI\setLimit().
Referenced by showResultsToplistByScore(), and showResultsToplistByTime().
146 $table_gui->
addColumn($lng->txt(
'toplist_col_rank'));
147 $table_gui->
addColumn($lng->txt(
'toplist_col_participant'));
148 if ($this->object->getHighscoreAchievedTS())
150 $table_gui->
addColumn($lng->txt(
'toplist_col_achieved'));
153 if ($this->object->getHighscoreScore())
155 $table_gui->
addColumn($lng->txt(
'toplist_col_score'));
158 if ($this->object->getHighscorePercentage())
160 $table_gui->
addColumn($lng->txt(
'toplist_col_percentage'));
163 if ($this->object->getHighscoreHints())
165 $table_gui->
addColumn($lng->txt(
'toplist_col_hints'));
168 if ($this->object->getHighscoreWTime())
170 $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 |
( |
| ) |
|
PhpUndefinedVariableInspection
PhpUndefinedVariableInspection
Definition at line 62 of file class.ilTestToplistGUI.php.
References $_GET, $data, $ilUser, $lng, $tpl, and prepareTable().
Referenced by __construct().
65 require_once
'./Services/Table/classes/class.ilTable2GUI.php';
66 if ($this->object->getHighscoreTopTable())
71 $data = $this->getGeneralToplistByPercentage(
$_GET[
'ref_id'], $ilUser->getId());
73 $table_gui->setRowTemplate(
'tpl.toplist_tbl_rows.html',
'Modules/Test');
74 $table_gui->setData(
$data);
75 $html =
'<h3>'. sprintf($lng->txt(
'toplist_top_n_results'), $this->
object->getHighscoreTopNum()) .
'</h3>';
77 $html .= $table_gui->getHTML();
80 if ($this->object->getHighscoreOwnTable())
86 $data2 = $this->getUserToplistByPercentage(
$_GET[
'ref_id'], $ilUser->getID());
88 $table_gui2->setRowTemplate(
'tpl.toplist_tbl_rows.html',
'Modules/Test');
89 $table_gui2->setData($data2);
92 $html .=
'<h3>' . $lng->txt(
'toplist_your_result') .
'</h3>';
93 $html .= $table_gui2->getHTML();
97 $tpl->setVariable(
"ADM_CONTENT", $html);
prepareTable(ilTable2GUI $table_gui)
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
◆ showResultsToplistByTime()
ilTestToplistGUI::showResultsToplistByTime |
( |
| ) |
|
PhpUndefinedVariableInspection
PhpUndefinedVariableInspection
Definition at line 100 of file class.ilTestToplistGUI.php.
References $_GET, $data, $ilUser, $lng, $tpl, and prepareTable().
Referenced by __construct().
103 require_once
'./Services/Table/classes/class.ilTable2GUI.php';
105 if ($this->object->getHighscoreTopTable())
110 $data = $this->getGeneralToplistByWorkingtime(
$_GET[
'ref_id'], $ilUser->getId());
112 $table_gui->setRowTemplate(
'tpl.toplist_tbl_rows.html',
'Modules/Test');
113 $table_gui->setData(
$data);
114 $html =
'<h3>'. sprintf($lng->txt(
'toplist_top_n_results'), $this->
object->getHighscoreTopNum()) .
'</h3>';
116 $html .= $table_gui->getHTML();
119 if ($this->object->getHighscoreOwnTable())
125 $data2 = $this->getUserToplistByWorkingtime(
$_GET[
'ref_id'], $ilUser->getID());
127 $table_gui2->setRowTemplate(
'tpl.toplist_tbl_rows.html',
'Modules/Test');
128 $table_gui2->setData($data2);
131 $html .=
'<h3>' . $lng->txt(
'toplist_your_result') .
'</h3>';
132 $html .= $table_gui2->getHTML();
135 $tpl->setVariable(
"ADM_CONTENT", $html);
prepareTable(ilTable2GUI $table_gui)
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
◆ $object
ilTestToplistGUI::$object |
|
protected |
The documentation for this class was generated from the following file: