ILIAS  release_8 Revision v8.23
class.ilTestParticipantScoring.php
Go to the documentation of this file.
1 <?php
2 
27 {
31  protected $activeId;
32 
36  protected $scoredPass;
37 
41  protected $answeredQuestions;
42 
46  protected $totalQuestions;
47 
51  protected $reachedPoints;
52 
56  protected $maxPoints;
57 
61  protected $passed;
62 
66  protected $finalMark;
67 
71  public function __construct()
72  {
73  $this->activeId = 0;
74  $this->scoredPass = 0;
75  $this->answeredQuestions = 0;
76  $this->totalQuestions = 0;
77  $this->reachedPoints = 0.0;
78  $this->maxPoints = 0.0;
79  $this->passed = false;
80  $this->finalMark = '';
81  }
82 
83 
87  public function getActiveId(): int
88  {
89  return $this->activeId;
90  }
91 
95  public function setActiveId(int $activeId)
96  {
97  $this->activeId = $activeId;
98  }
99 
103  public function getScoredPass(): int
104  {
105  return $this->scoredPass;
106  }
107 
111  public function setScoredPass(int $scoredPass)
112  {
113  $this->scoredPass = $scoredPass;
114  }
115 
119  public function getAnsweredQuestions(): int
120  {
122  }
123 
128  {
129  $this->answeredQuestions = $answeredQuestions;
130  }
131 
135  public function getTotalQuestions(): int
136  {
137  return $this->totalQuestions;
138  }
139 
143  public function setTotalQuestions(int $totalQuestions)
144  {
145  $this->totalQuestions = $totalQuestions;
146  }
147 
151  public function getReachedPoints(): float
152  {
153  return $this->reachedPoints;
154  }
155 
159  public function setReachedPoints(float $reachedPoints)
160  {
161  $this->reachedPoints = $reachedPoints;
162  }
163 
167  public function getMaxPoints(): float
168  {
169  return $this->maxPoints;
170  }
171 
175  public function setMaxPoints(float $maxPoints)
176  {
177  $this->maxPoints = $maxPoints;
178  }
179 
183  public function isPassed(): bool
184  {
185  return $this->passed;
186  }
187 
191  public function setPassed(bool $passed)
192  {
193  $this->passed = $passed;
194  }
195 
199  public function getFinalMark(): string
200  {
201  return $this->finalMark;
202  }
203 
207  public function setFinalMark(string $finalMark)
208  {
209  $this->finalMark = $finalMark;
210  }
211 
215  public function getPercentResult()
216  {
217  if ($this->getMaxPoints() > 0) {
218  return $this->getReachedPoints() / $this->getMaxPoints();
219  }
220 
221  return 0;
222  }
223 }
setAnsweredQuestions(int $answeredQuestions)
__construct()
ilTestParticipantScoring constructor.