19 declare(strict_types=1);
26 private readonly
int $question_id,
27 private readonly
int $number_of_answers = 0,
28 private readonly
float $available_points = 0.0,
29 private readonly
float $total_achieved_points = 0.0,
35 return $this->question_id;
40 return $this->number_of_answers;
45 if ($this->number_of_answers === 0) {
48 return $this->total_achieved_points / $this->number_of_answers;
53 if ($this->number_of_answers === 0.0
54 || $this->available_points === 0.0) {
57 return ($this->total_achieved_points / ($this->number_of_answers * $this->available_points)) * 100;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPercentageOfPointsAchieved()
__construct(private readonly int $question_id, private readonly int $number_of_answers=0, private readonly float $available_points=0.0, private readonly float $total_achieved_points=0.0,)