ILIAS  release_8 Revision v8.24
class.assNumericRange.php
Go to the documentation of this file.
1<?php
2
19require_once './Modules/Test/classes/inc.AssessmentConstants.php';
20
36{
44 protected $lowerlimit;
45
53 protected $upperlimit;
54
62 protected $points;
63
71 protected $order;
72
83 public function __construct($lowerlimit = 0.0, $upperlimit = 0.0, $points = 0.0, $order = 0)
84 {
85 $this->lowerlimit = $lowerlimit;
86 $this->upperlimit = $upperlimit;
87 $this->points = $points;
88 $this->order = $order;
89 }
90
100 public function getLowerLimit(): float
101 {
102 return $this->lowerlimit;
103 }
104
114 public function getUpperLimit(): float
115 {
116 return $this->upperlimit;
117 }
118
128 public function getPoints(): float
129 {
130 return $this->points;
131 }
132
142 public function getOrder(): int
143 {
144 return $this->order;
145 }
146
156 public function setLowerLimit($limit): void
157 {
158 $this->lowerlimit = $limit;
159 }
160
170 public function setUpperLimit($limit): void
171 {
172 $this->upperlimit = $limit;
173 }
174
184 public function setPoints($points): void
185 {
186 $this->points = $points;
187 }
188
198 public function setOrder($order): void
199 {
200 $this->order = $order;
201 }
202
215 public function contains($value): bool
216 {
217 require_once './Services/Math/classes/class.EvalMath.php';
218 $eval = new EvalMath();
219 $eval->suppress_errors = true;
220 $result = $eval->e($value);
221 if (($result === false) || ($result === true)) {
222 return false;
223 }
224
225 if (($result >= $eval->e($this->lowerlimit)) && ($result <= $eval->e($this->upperlimit))) {
226 return true;
227 } else {
228 return false;
229 }
230 }
231}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getOrder()
Get the order of the range.
setPoints($points)
Set the points.
getPoints()
Get the points.
__construct($lowerlimit=0.0, $upperlimit=0.0, $points=0.0, $order=0)
assNumericRange constructor
getLowerLimit()
Get the lower limit.
setUpperLimit($limit)
Set the upper limit.
setLowerLimit($limit)
Set the lower limit.
setOrder($order)
Set the order.
getUpperLimit()
Get the upper limit.
contains($value)
Checks for a given value within the range.