ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilTestParticipantScoring.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
29 {
33  protected $activeId;
34 
38  protected $scoredPass;
39 
43  protected $answeredQuestions;
44 
48  protected $totalQuestions;
49 
53  protected $reachedPoints;
54 
58  protected $maxPoints;
59 
63  protected $passed;
64 
68  protected $finalMark;
69 
73  public function __construct()
74  {
75  $this->activeId = 0;
76  $this->scoredPass = 0;
77  $this->answeredQuestions = 0;
78  $this->totalQuestions = 0;
79  $this->reachedPoints = 0.0;
80  $this->maxPoints = 0.0;
81  $this->passed = false;
82  $this->finalMark = '';
83  }
84 
85 
89  public function getActiveId(): int
90  {
91  return $this->activeId;
92  }
93 
97  public function setActiveId(int $activeId)
98  {
99  $this->activeId = $activeId;
100  }
101 
105  public function getScoredPass(): int
106  {
107  return $this->scoredPass;
108  }
109 
113  public function setScoredPass(int $scoredPass)
114  {
115  $this->scoredPass = $scoredPass;
116  }
117 
121  public function getAnsweredQuestions(): int
122  {
124  }
125 
130  {
131  $this->answeredQuestions = $answeredQuestions;
132  }
133 
137  public function getTotalQuestions(): int
138  {
139  return $this->totalQuestions;
140  }
141 
145  public function setTotalQuestions(int $totalQuestions)
146  {
147  $this->totalQuestions = $totalQuestions;
148  }
149 
153  public function getReachedPoints(): float
154  {
155  return $this->reachedPoints;
156  }
157 
161  public function setReachedPoints(float $reachedPoints)
162  {
163  $this->reachedPoints = $reachedPoints;
164  }
165 
169  public function getMaxPoints(): float
170  {
171  return $this->maxPoints;
172  }
173 
177  public function setMaxPoints(float $maxPoints)
178  {
179  $this->maxPoints = $maxPoints;
180  }
181 
185  public function isPassed(): bool
186  {
187  return $this->passed;
188  }
189 
193  public function setPassed(bool $passed)
194  {
195  $this->passed = $passed;
196  }
197 
201  public function getFinalMark(): string
202  {
203  return $this->finalMark;
204  }
205 
209  public function setFinalMark(string $finalMark)
210  {
211  $this->finalMark = $finalMark;
212  }
213 
217  public function getPercentResult()
218  {
219  if ($this->getMaxPoints() > 0) {
220  return $this->getReachedPoints() / $this->getMaxPoints();
221  }
222 
223  return 0;
224  }
225 }
setAnsweredQuestions(int $answeredQuestions)
__construct()
ilTestParticipantScoring constructor.