ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Test\Results\Data\TestOverview Class Reference
+ Collaboration diagram for ILIAS\Test\Results\Data\TestOverview:

Public Member Functions

 __construct (private readonly int $test_obj_id, private readonly int $total_number_of_participants=0, private readonly int $total_number_of_participants_with_finished_attempts=0, private readonly int $total_number_of_participants_with_passing_result=0, private readonly int $average_time_on_task_with_finished_attempts=0, private readonly int $average_time_on_task_passed=0, private readonly int $rank_of_median=0, private readonly string $mark_of_median='', private readonly float $points_of_median=0, private readonly float $average_points_passed=0)
 
 getTestObjId ()
 
 getAsDescriptiveListing (Language $lng, UIFactory $ui_factory)
 

Private Member Functions

 buildHumanReadableTime (int $time)
 

Detailed Description

Definition at line 27 of file TestOverview.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Results\Data\TestOverview::__construct ( private readonly int  $test_obj_id,
private readonly int  $total_number_of_participants = 0,
private readonly int  $total_number_of_participants_with_finished_attempts = 0,
private readonly int  $total_number_of_participants_with_passing_result = 0,
private readonly int  $average_time_on_task_with_finished_attempts = 0,
private readonly int  $average_time_on_task_passed = 0,
private readonly int  $rank_of_median = 0,
private readonly string  $mark_of_median = '',
private readonly float  $points_of_median = 0,
private readonly float  $average_points_passed = 0 
)

Definition at line 29 of file TestOverview.php.

40 {
41 }

Member Function Documentation

◆ buildHumanReadableTime()

ILIAS\Test\Results\Data\TestOverview::buildHumanReadableTime ( int  $time)
private

Definition at line 69 of file TestOverview.php.

69 : string
70 {
71 $diff_seconds = $time;
72 $diff_hours = floor($diff_seconds / 3600);
73 $diff_seconds -= $diff_hours * 3600;
74 $diff_minutes = floor($diff_seconds / 60);
75 $diff_seconds -= $diff_minutes * 60;
76 return sprintf("%02d:%02d:%02d", $diff_hours, $diff_minutes, $diff_seconds);
77 }

◆ getAsDescriptiveListing()

ILIAS\Test\Results\Data\TestOverview::getAsDescriptiveListing ( Language  $lng,
UIFactory  $ui_factory 
)

Definition at line 48 of file TestOverview.php.

51 : DescriptiveListing {
52 return $ui_factory->listing()->descriptive([
53 $lng->txt('tst_eval_total_persons') => (string) $this->total_number_of_participants,
54 $lng->txt('tst_stat_result_rank_median') => (string) $this->rank_of_median,
55 $lng->txt('tst_stat_result_median') => sprintf('%2.2f', $this->points_of_median),
56 $lng->txt('tst_stat_result_mark_median') => $this->mark_of_median,
57 $lng->txt('tst_eval_total_finished') => (string) $this->total_number_of_participants_with_finished_attempts,
58 $lng->txt('tst_eval_total_finished_average_time') => $this->buildHumanReadableTime(
59 $this->average_time_on_task_with_finished_attempts
60 ),
61 $lng->txt('tst_eval_total_passed') => (string) $this->total_number_of_participants_with_passing_result,
62 $lng->txt('tst_eval_total_passed_average_time') => $this->buildHumanReadableTime(
63 $this->average_time_on_task_passed
64 ),
65 $lng->txt('tst_eval_total_passed_average_points') => sprintf('%2.2f', $this->average_points_passed)
66 ]);
67 }
global $lng
Definition: privfeed.php:31

◆ getTestObjId()

ILIAS\Test\Results\Data\TestOverview::getTestObjId ( )

Definition at line 43 of file TestOverview.php.

43 : int
44 {
45 return $this->test_obj_id;
46 }

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