ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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.

16 {
17 $this->object = $a_object;
18 }

Member Function Documentation

◆ formatTime()

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

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

463 {
464 $retval = '';
465 $hours = intval(intval($seconds) / 3600);
466 $retval .= str_pad($hours, 2, "0", STR_PAD_LEFT) . ":";
467 $minutes = intval(($seconds / 60) % 60);
468 $retval .= str_pad($minutes, 2, "0", STR_PAD_LEFT) . ":";
469 $seconds = intval($seconds % 60);
470 $retval .= str_pad($seconds, 2, "0", STR_PAD_LEFT);
471 return $retval;
472 }

Referenced by getResultTableRow().

+ 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 414 of file class.ilTestTopList.php.

415 {
416 $item = array();
417 $item['Rank'] = $i . '. ';
418
419 if($this->object->isHighscoreAnon() && $row['usr_id'] != $a_user_id)
420 {
421 $item['Participant'] = "-, -";
422 }
423 else
424 {
425 $item['Participant'] = $row['lastname'] . ', ' . $row['firstname'];
426 }
427
428 if($this->object->getHighscoreAchievedTS())
429 {
430 $item['Achieved'] = new ilDateTime($row['tstamp'], IL_CAL_UNIX);
431
432 }
433
434 if($this->object->getHighscoreScore())
435 {
436 $item['Score'] = $row['reached_points'] . ' / ' . $row['max_points'];
437 }
438
439 if($this->object->getHighscorePercentage())
440 {
441 $item['Percentage'] = $row['percentage'] . '%';
442 }
443
444 if($this->object->getHighscoreHints())
445 {
446 $item['Hints'] = $row['hint_count'];
447 }
448
449 if($this->object->getHighscoreWTime())
450 {
451 $item['time'] = $this->formatTime($row['workingtime']);
452 }
453
454 $item['Highlight'] = ($row['usr_id'] == $a_user_id) ? 'tblrowmarked' : '';
455 return $item;
456 }
const IL_CAL_UNIX
@classDescription Date and time handling

References $row, formatTime(), and IL_CAL_UNIX.

+ Here is the call 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: