ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilTestStatistics.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 require_once './Modules/Test/classes/inc.AssessmentConstants.php';
22 
33 {
34  public $test_id;
35  public $statistics;
36 
42  public function __construct($eval_data)
43  {
44  $this->statistics = null;
45  $this->calculateStatistics($eval_data);
46  }
47 
55  public function getStatistics(): ?object
56  {
57  return $this->statistics;
58  }
59 
66  public function calculateStatistics($eval_data)
67  {
68  $median_array = [];
69 
70  foreach ($eval_data->getParticipantIds() as $active_id) {
71  $participant = $eval_data->getParticipant($active_id);
72  array_push($median_array, $participant->getReached());
73  }
74 
75  $this->statistics = new ilStatistics();
76  $this->statistics->setData($median_array);
77  }
78 }
calculateStatistics($eval_data)
Instanciates the statistics object.
getStatistics()
Returns the statistics object.
__construct($eval_data)
ilTestStatistics constructor
This class calculates statistical data for a test which has to be calculated using all participant da...
Constants for the handling of elements which are not a number.