ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilTestTopList Class Reference

Class ilTestTopList. More...

+ Collaboration diagram for ilTestTopList:

Public Member Functions

 __construct (ilObjTest $a_object)
 

Protected Attributes

 $object
 

Private Member Functions

 getResultTableRow ($row, $i, $a_user_id)
 
 formatTime ($seconds)
 

Detailed Description

Class ilTestTopList.

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $data, $i, $ilDB, $result, $row, array, getResultTableRow(), and object.

16  {
17  $this->object = $a_object;
18  }
+ Here is the call graph for this function:

Member Function Documentation

◆ formatTime()

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

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

Referenced by getResultTableRow().

445  {
446  $retval = '';
447  $hours = intval(intval($seconds) / 3600);
448  $retval .= str_pad($hours, 2, "0", STR_PAD_LEFT) . ":";
449  $minutes = intval(($seconds / 60) % 60);
450  $retval .= str_pad($minutes, 2, "0", STR_PAD_LEFT) . ":";
451  $seconds = intval($seconds % 60);
452  $retval .= str_pad($seconds, 2, "0", STR_PAD_LEFT);
453  return $retval;
454  }
+ Here is the caller graph for this function:

◆ getResultTableRow()

ilTestTopList::getResultTableRow (   $row,
  $i,
  $a_user_id 
)
private
Parameters
array$row
int$i
int$a_user_id
Returns
array

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

References $i, $row, array, formatTime(), IL_CAL_UNIX, and object.

Referenced by __construct().

406  {
407  $item = array();
408  $item['Rank'] = $i . '. ';
409 
410  if ($this->object->isHighscoreAnon() && $row['usr_id'] != $a_user_id) {
411  $item['Participant'] = "-, -";
412  } else {
413  $item['Participant'] = $row['lastname'] . ', ' . $row['firstname'];
414  }
415 
416  if ($this->object->getHighscoreAchievedTS()) {
417  $item['Achieved'] = new ilDateTime($row['tstamp'], IL_CAL_UNIX);
418  }
419 
420  if ($this->object->getHighscoreScore()) {
421  $item['Score'] = $row['reached_points'] . ' / ' . $row['max_points'];
422  }
423 
424  if ($this->object->getHighscorePercentage()) {
425  $item['Percentage'] = $row['percentage'] . '%';
426  }
427 
428  if ($this->object->getHighscoreHints()) {
429  $item['Hints'] = $row['hint_count'];
430  }
431 
432  if ($this->object->getHighscoreWTime()) {
433  $item['time'] = $this->formatTime($row['workingtime']);
434  }
435 
436  $item['Highlight'] = ($row['usr_id'] == $a_user_id) ? 'tblrowmarked' : '';
437  return $item;
438  }
const IL_CAL_UNIX
Date and time handling
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $object

ilTestTopList::$object
protected

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


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