ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilTestParticipantScoring.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 
14 {
18  protected $activeId;
19 
23  protected $scoredPass;
24 
28  protected $answeredQuestions;
29 
33  protected $totalQuestions;
34 
38  protected $reachedPoints;
39 
43  protected $maxPoints;
44 
48  protected $passed;
49 
53  protected $finalMark;
54 
58  public function __construct()
59  {
60  $this->activeId = 0;
61  $this->scoredPass = 0;
62  $this->answeredQuestions = 0;
63  $this->totalQuestions = 0;
64  $this->reachedPoints = 0.0;
65  $this->maxPoints = 0.0;
66  $this->passed = false;
67  $this->finalMark = '';
68  }
69 
70 
74  public function getActiveId() : int
75  {
76  return $this->activeId;
77  }
78 
82  public function setActiveId(int $activeId)
83  {
84  $this->activeId = $activeId;
85  }
86 
90  public function getScoredPass() : int
91  {
92  return $this->scoredPass;
93  }
94 
98  public function setScoredPass(int $scoredPass)
99  {
100  $this->scoredPass = $scoredPass;
101  }
102 
106  public function getAnsweredQuestions() : int
107  {
109  }
110 
115  {
116  $this->answeredQuestions = $answeredQuestions;
117  }
118 
122  public function getTotalQuestions() : int
123  {
124  return $this->totalQuestions;
125  }
126 
130  public function setTotalQuestions(int $totalQuestions)
131  {
132  $this->totalQuestions = $totalQuestions;
133  }
134 
138  public function getReachedPoints() : float
139  {
140  return $this->reachedPoints;
141  }
142 
146  public function setReachedPoints(float $reachedPoints)
147  {
148  $this->reachedPoints = $reachedPoints;
149  }
150 
154  public function getMaxPoints() : float
155  {
156  return $this->maxPoints;
157  }
158 
162  public function setMaxPoints(float $maxPoints)
163  {
164  $this->maxPoints = $maxPoints;
165  }
166 
170  public function isPassed() : bool
171  {
172  return $this->passed;
173  }
174 
178  public function setPassed(bool $passed)
179  {
180  $this->passed = $passed;
181  }
182 
186  public function getFinalMark() : string
187  {
188  return $this->finalMark;
189  }
190 
194  public function setFinalMark(string $finalMark)
195  {
196  $this->finalMark = $finalMark;
197  }
198 
202  public function getPercentResult()
203  {
204  if ($this->getMaxPoints() > 0) {
205  return $this->getReachedPoints() / $this->getMaxPoints();
206  }
207 
208  return 0;
209  }
210 }
setAnsweredQuestions(int $answeredQuestions)
__construct()
ilTestParticipantScoring constructor.