ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestTopList Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilTestTopList:

Public Member Functions

 __construct (ilObjTest $a_object)
 
 getUserToplistByWorkingtime (int $a_test_ref_id, int $a_user_id)
 
 getGeneralToplistByPercentage (int $a_test_ref_id, int $a_user_id)
 
 getGeneralToplistByWorkingtime (int $a_test_ref_id, int $a_user_id)
 
 getUserToplistByPercentage (int $a_test_ref_id, int $a_user_id)
 

Private Member Functions

 getResultTableRow (array $row, int $i, int $usrId)
 
 formatTime (int $seconds)
 
 buildEmptyItem ()
 

Private Attributes

 $object
 
 $db
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilTestTopList

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

Constructor & Destructor Documentation

◆ __construct()

ilTestTopList::__construct ( ilObjTest  $a_object)
Parameters
ilObjTest$a_object

Definition at line 32 of file class.ilTestTopList.php.

References $DIC.

33  {
34  global $DIC;
35 
36  $this->object = $a_object;
37  $this->db = $DIC->database();
38  }
global $DIC
Definition: feed.php:28

Member Function Documentation

◆ buildEmptyItem()

ilTestTopList::buildEmptyItem ( )
private

Definition at line 467 of file class.ilTestTopList.php.

Referenced by getUserToplistByPercentage(), and getUserToplistByWorkingtime().

467  : array
468  {
469  return [
470  'rank' => '...' ,
471  'is_actor' => false,
472  'participant' => '',
473  'achieved' => '',
474  'score' => '',
475  'percentage' => '',
476  'hints' => '',
477  'time' => ''
478  ];
479  }
+ Here is the caller graph for this function:

◆ formatTime()

ilTestTopList::formatTime ( int  $seconds)
private
Parameters
int$seconds
Returns
string

Definition at line 454 of file class.ilTestTopList.php.

Referenced by getResultTableRow().

454  : string
455  {
456  $retval = '';
457  $hours = intval($seconds / 3600);
458  $retval .= str_pad($hours, 2, "0", STR_PAD_LEFT) . ":";
459  $minutes = ($seconds / 60) % 60;
460  $retval .= str_pad($minutes, 2, "0", STR_PAD_LEFT) . ":";
461  $seconds = $seconds % 60;
462  $retval .= str_pad($seconds, 2, "0", STR_PAD_LEFT);
463 
464  return $retval;
465  }
+ Here is the caller graph for this function:

◆ getGeneralToplistByPercentage()

ilTestTopList::getGeneralToplistByPercentage ( int  $a_test_ref_id,
int  $a_user_id 
)
Parameters
int$a_test_ref_id
int$a_user_id
Returns
array

Definition at line 194 of file class.ilTestTopList.php.

References $data, $i, getResultTableRow(), and ILIAS\Repository\object().

194  : array
195  {
196  $this->db->setLimit($this->object->getHighscoreTopNum(), 0);
197  $result = $this->db->query(
198  '
199  SELECT tst_result_cache.*, round(points/maxpoints*100,2) as percentage, tst_pass_result.workingtime, usr_data.usr_id, usr_data.firstname, usr_data.lastname
200  FROM object_reference
201  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
202  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
203  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
204  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi AND tst_pass_result.pass = tst_result_cache.pass
205  INNER JOIN usr_data ON usr_data.usr_id = tst_active.user_fi
206  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
207  ORDER BY percentage DESC'
208  );
209 
210  $i = 0;
211  $data = [];
212 
213  while ($row = $this->db->fetchAssoc($result)) {
214  $i++;
215  $item = $this->getResultTableRow($row, $i, $a_user_id);
216 
217  $data[] = $item;
218  }
219 
220  return $data;
221  }
getResultTableRow(array $row, int $i, int $usrId)
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ getGeneralToplistByWorkingtime()

ilTestTopList::getGeneralToplistByWorkingtime ( int  $a_test_ref_id,
int  $a_user_id 
)
Parameters
int$a_test_ref_id
int$a_user_id
Returns
array

Definition at line 228 of file class.ilTestTopList.php.

References $data, $i, getResultTableRow(), and ILIAS\Repository\object().

228  : array
229  {
230  $this->db->setLimit($this->object->getHighscoreTopNum(), 0);
231  $result = $this->db->query(
232  '
233  SELECT tst_result_cache.*, round(points/maxpoints*100,2) as percentage, tst_pass_result.workingtime, usr_data.usr_id, usr_data.firstname, usr_data.lastname
234  FROM object_reference
235  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
236  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
237  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
238  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi AND tst_pass_result.pass = tst_result_cache.pass
239  INNER JOIN usr_data ON usr_data.usr_id = tst_active.user_fi
240  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
241  ORDER BY workingtime ASC'
242  );
243 
244  $i = 0;
245  $data = [];
246 
247  while ($row = $this->db->fetchAssoc($result)) {
248  $i++;
249  $item = $this->getResultTableRow($row, $i, $a_user_id);
250  $data[] = $item;
251  }
252 
253  return $data;
254  }
getResultTableRow(array $row, int $i, int $usrId)
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ getResultTableRow()

ilTestTopList::getResultTableRow ( array  $row,
int  $i,
int  $usrId 
)
private
Parameters
array$row
int$i
int$usrId
Returns
array
Exceptions
ilDateTimeException

Definition at line 413 of file class.ilTestTopList.php.

References formatTime(), IL_CAL_UNIX, ILIAS\Repository\int(), and ILIAS\Repository\object().

Referenced by getGeneralToplistByPercentage(), getGeneralToplistByWorkingtime(), getUserToplistByPercentage(), and getUserToplistByWorkingtime().

413  : array
414  {
415  $item = [];
416 
417  $item['rank'] = $i . '. ';
418 
419  if ($this->object->isHighscoreAnon() && (int) $row['usr_id'] !== $usrId) {
420  $item['participant'] = '-, -';
421  } else {
422  $item['participant'] = $row['lastname'] . ', ' . $row['firstname'];
423  }
424 
425  if ($this->object->getHighscoreAchievedTS()) {
426  $item['achieved'] = new ilDateTime($row['tstamp'], IL_CAL_UNIX);
427  }
428 
429  if ($this->object->getHighscoreScore()) {
430  $item['score'] = $row['reached_points'] . ' / ' . $row['max_points'];
431  }
432 
433  if ($this->object->getHighscorePercentage()) {
434  $item['percentage'] = $row['percentage'] . '%';
435  }
436 
437  if ($this->object->getHighscoreHints()) {
438  $item['hints'] = $row['hint_count'];
439  }
440 
441  if ($this->object->getHighscoreWTime()) {
442  $item['time'] = $this->formatTime((int) $row['workingtime']);
443  }
444 
445  $item['is_actor'] = ((int) $row['usr_id'] === $usrId);
446 
447  return $item;
448  }
const IL_CAL_UNIX
formatTime(int $seconds)
$i
Definition: metadata.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUserToplistByPercentage()

ilTestTopList::getUserToplistByPercentage ( int  $a_test_ref_id,
int  $a_user_id 
)
Parameters
int$a_test_ref_id
int$a_user_id
Returns
array

Definition at line 261 of file class.ilTestTopList.php.

References $data, $i, buildEmptyItem(), getResultTableRow(), and ILIAS\Repository\object().

261  : array
262  {
263  $result = $this->db->query(
264  '
265  SELECT COUNT(tst_pass_result.workingtime) cnt
266  FROM object_reference
267  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
268  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
269  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
270  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
271  AND tst_pass_result.pass = tst_result_cache.pass
272  INNER JOIN usr_data ON usr_data.usr_id = tst_active.user_fi
273  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
274  AND tst_active.user_fi != ' . $this->db->quote($a_user_id, 'integer') . '
275  AND round(reached_points/max_points*100) >=
276  (
277  SELECT round(reached_points/max_points*100)
278  FROM object_reference
279  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
280  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
281  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
282  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
283  AND tst_pass_result.pass = tst_result_cache.pass
284  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
285  AND tst_active.user_fi = ' . $this->db->quote($a_user_id, 'integer') . '
286  )
287  '
288  );
289  $row = $this->db->fetchAssoc($result);
290  $better_participants = $row['cnt'];
291  $own_placement = $better_participants + 1;
292 
293  $result = $this->db->query(
294  '
295  SELECT COUNT(tst_pass_result.workingtime) cnt
296  FROM object_reference
297  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
298  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
299  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
300  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
301  AND tst_pass_result.pass = tst_result_cache.pass
302  INNER JOIN usr_data ON usr_data.usr_id = tst_active.user_fi
303  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer')
304  );
305  $row = $this->db->fetchAssoc($result);
306  $number_total = $row['cnt'];
307 
308  $result = $this->db->query(
309  '
310  SELECT tst_result_cache.*, round(reached_points/max_points*100) as percentage ,
311  tst_pass_result.workingtime, usr_id, usr_data.firstname, usr_data.lastname
312  FROM object_reference
313  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
314  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
315  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
316  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
317  AND tst_pass_result.pass = tst_result_cache.pass
318  INNER JOIN usr_data ON usr_data.usr_id = tst_active.user_fi
319 
320  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
321  AND tst_active.user_fi = ' . $this->db->quote($a_user_id, 'integer') . '
322 
323  UNION(
324  SELECT tst_result_cache.*, round(reached_points/max_points*100) as percentage,
325  tst_pass_result.workingtime, usr_id, usr_data.firstname, usr_data.lastname
326  FROM object_reference
327  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
328  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
329  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
330  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
331  AND tst_pass_result.pass = tst_result_cache.pass
332  INNER JOIN usr_data ON usr_data.usr_id = tst_active.user_fi
333  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
334  AND tst_active.user_fi != ' . $this->db->quote($a_user_id, 'integer') . '
335  AND round(reached_points/max_points*100) >=
336  (
337  SELECT round(reached_points/max_points*100)
338  FROM object_reference
339  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
340  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
341  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
342  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
343  AND tst_pass_result.pass = tst_result_cache.pass
344  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
345  AND tst_active.user_fi = ' . $this->db->quote($a_user_id, 'integer') . '
346  )
347  ORDER BY round(reached_points/max_points*100) ASC
348  LIMIT 0, ' . $this->db->quote($this->object->getHighscoreTopNum(), 'integer') . '
349  )
350  UNION(
351  SELECT tst_result_cache.*, round(reached_points/max_points*100) as percentage,
352  tst_pass_result.workingtime, usr_id, usr_data.firstname, usr_data.lastname
353  FROM object_reference
354  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
355  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
356  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
357  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
358  AND tst_pass_result.pass = tst_result_cache.pass
359  INNER JOIN usr_data ON usr_data.usr_id = tst_active.user_fi
360  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
361  AND tst_active.user_fi != ' . $this->db->quote($a_user_id, 'integer') . '
362  AND round(reached_points/max_points*100) <=
363  (
364  SELECT round(reached_points/max_points*100)
365  FROM object_reference
366  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
367  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
368  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
369  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
370  AND tst_pass_result.pass = tst_result_cache.pass
371  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
372  AND tst_active.user_fi = ' . $this->db->quote($a_user_id, 'integer') . '
373  )
374  ORDER BY round(reached_points/max_points*100) ASC
375  LIMIT 0, ' . $this->db->quote($this->object->getHighscoreTopNum(), 'integer') . '
376  )
377  ORDER BY round(reached_points/max_points*100) DESC, tstamp ASC
378  LIMIT 0, ' . $this->db->quote($this->object->getHighscoreTopNum(), 'integer') . '
379  '
380  );
381 
382  $i = $own_placement - ($better_participants >= $this->object->getHighscoreTopNum()
383  ? $this->object->getHighscoreTopNum() : $better_participants);
384 
385  $data = [];
386 
387  if ($i > 1) {
388  $item = $this->buildEmptyItem();
389  $data[] = $item;
390  }
391 
392  while ($row = $this->db->fetchAssoc($result)) {
393  $item = $this->getResultTableRow($row, $i, $a_user_id);
394  $i++;
395  $data[] = $item;
396  }
397 
398  if ($number_total > $i) {
399  $item = $this->buildEmptyItem();
400  $data[] = $item;
401  }
402 
403  return $data;
404  }
getResultTableRow(array $row, int $i, int $usrId)
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ getUserToplistByWorkingtime()

ilTestTopList::getUserToplistByWorkingtime ( int  $a_test_ref_id,
int  $a_user_id 
)
Parameters
int$a_test_ref_id
int$a_user_id
Returns
array

Definition at line 45 of file class.ilTestTopList.php.

References $data, $i, buildEmptyItem(), getResultTableRow(), and ILIAS\Repository\object().

45  : array
46  {
47  $result = $this->db->query(
48  '
49  SELECT COUNT(tst_pass_result.workingtime) cnt
50  FROM object_reference
51  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
52  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
53  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
54  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
55  AND tst_pass_result.pass = tst_result_cache.pass
56  INNER JOIN usr_data ON usr_data.usr_id = tst_active.user_fi
57  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
58  AND tst_active.user_fi != ' . $this->db->quote($a_user_id, 'integer') . '
59  AND workingtime <
60  (
61  SELECT workingtime
62  FROM object_reference
63  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
64  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
65  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
66  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
67  AND tst_pass_result.pass = tst_result_cache.pass
68  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
69  AND tst_active.user_fi = ' . $this->db->quote($a_user_id, 'integer') . '
70  )
71  '
72  );
73  $row = $this->db->fetchAssoc($result);
74  $better_participants = $row['cnt'];
75  $own_placement = $better_participants + 1;
76 
77  $result = $this->db->query(
78  '
79  SELECT COUNT(tst_pass_result.workingtime) cnt
80  FROM object_reference
81  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
82  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
83  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
84  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
85  AND tst_pass_result.pass = tst_result_cache.pass
86  INNER JOIN usr_data ON usr_data.usr_id = tst_active.user_fi
87  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer')
88  );
89  $row = $this->db->fetchAssoc($result);
90  $number_total = $row['cnt'];
91 
92  $result = $this->db->query(
93  '
94  SELECT tst_result_cache.*, round(reached_points/max_points*100) as percentage ,
95  tst_pass_result.workingtime, usr_id, usr_data.firstname, usr_data.lastname
96  FROM object_reference
97  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
98  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
99  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
100  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
101  AND tst_pass_result.pass = tst_result_cache.pass
102  INNER JOIN usr_data ON usr_data.usr_id = tst_active.user_fi
103 
104  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
105  AND tst_active.user_fi = ' . $this->db->quote($a_user_id, 'integer') . '
106 
107  UNION(
108  SELECT tst_result_cache.*, round(reached_points/max_points*100) as percentage,
109  tst_pass_result.workingtime, usr_id, usr_data.firstname, usr_data.lastname
110  FROM object_reference
111  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
112  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
113  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
114  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
115  AND tst_pass_result.pass = tst_result_cache.pass
116  INNER JOIN usr_data ON usr_data.usr_id = tst_active.user_fi
117  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
118  AND tst_active.user_fi != ' . $this->db->quote($a_user_id, 'integer') . '
119  AND workingtime >=
120  (
121  SELECT tst_pass_result.workingtime
122  FROM object_reference
123  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
124  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
125  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
126  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
127  AND tst_pass_result.pass = tst_result_cache.pass
128  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
129  AND tst_active.user_fi = ' . $this->db->quote($a_user_id, 'integer') . '
130  )
131  ORDER BY workingtime DESC
132  LIMIT 0, ' . $this->db->quote($this->object->getHighscoreTopNum(), 'integer') . '
133  )
134  UNION(
135  SELECT tst_result_cache.*, round(reached_points/max_points*100) as percentage,
136  tst_pass_result.workingtime, usr_id, usr_data.firstname, usr_data.lastname
137  FROM object_reference
138  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
139  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
140  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
141  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
142  AND tst_pass_result.pass = tst_result_cache.pass
143  INNER JOIN usr_data ON usr_data.usr_id = tst_active.user_fi
144  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
145  AND tst_active.user_fi != ' . $this->db->quote($a_user_id, 'integer') . '
146  AND workingtime <
147  (
148  SELECT tst_pass_result.workingtime
149  FROM object_reference
150  INNER JOIN tst_tests ON object_reference.obj_id = tst_tests.obj_fi
151  INNER JOIN tst_active ON tst_tests.test_id = tst_active.test_fi
152  INNER JOIN tst_result_cache ON tst_active.active_id = tst_result_cache.active_fi
153  INNER JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi
154  AND tst_pass_result.pass = tst_result_cache.pass
155  WHERE object_reference.ref_id = ' . $this->db->quote($a_test_ref_id, 'integer') . '
156  AND tst_active.user_fi = ' . $this->db->quote($a_user_id, 'integer') . '
157  )
158  ORDER BY workingtime DESC
159  LIMIT 0, ' . $this->db->quote($this->object->getHighscoreTopNum(), 'integer') . '
160  )
161  ORDER BY workingtime ASC
162  LIMIT 0, ' . $this->db->quote($this->object->getHighscoreTopNum(), 'integer') . '
163  '
164  );
165 
166  $i = $own_placement - (($better_participants >= 3) ? 3 : $better_participants);
167 
168  $data = [];
169 
170  if ($i > 1) {
171  $item = $this->buildEmptyItem();
172  $data[] = $item;
173  }
174 
175  while ($row = $this->db->fetchAssoc($result)) {
176  $item = $this->getResultTableRow($row, $i, $a_user_id);
177  $i++;
178  $data[] = $item;
179  }
180 
181  if ($number_total > $i) {
182  $item = $this->buildEmptyItem();
183  $data[] = $item;
184  }
185 
186  return $data;
187  }
getResultTableRow(array $row, int $i, int $usrId)
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilTestTopList::$db
private

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

◆ $object

ilTestTopList::$object
private

Definition at line 25 of file class.ilTestTopList.php.


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