ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.assNumericRange.php
Go to the documentation of this file.
1<?php
2
34{
42 protected $lowerlimit;
43
51 protected $upperlimit;
52
60 protected $points;
61
69 protected $order;
70
81 public function __construct($lowerlimit = 0.0, $upperlimit = 0.0, $points = 0.0, $order = 0)
82 {
83 $this->lowerlimit = $lowerlimit;
84 $this->upperlimit = $upperlimit;
85 $this->points = $points;
86 $this->order = $order;
87 }
88
98 public function getLowerLimit(): float
99 {
100 return $this->lowerlimit;
101 }
102
112 public function getUpperLimit(): float
113 {
114 return $this->upperlimit;
115 }
116
126 public function getPoints(): float
127 {
128 return $this->points;
129 }
130
140 public function getOrder(): int
141 {
142 return $this->order;
143 }
144
154 public function setLowerLimit($limit): void
155 {
156 $this->lowerlimit = $limit;
157 }
158
168 public function setUpperLimit($limit): void
169 {
170 $this->upperlimit = $limit;
171 }
172
182 public function setPoints($points): void
183 {
184 $this->points = $points;
185 }
186
196 public function setOrder($order): void
197 {
198 $this->order = $order;
199 }
200
213 public function contains($value): bool
214 {
215 $eval = new EvalMath();
216 $eval->suppress_errors = true;
217 $result = $eval->e($value);
218 if (($result === false) || ($result === true)) {
219 return false;
220 }
221
222 if (($result >= $eval->e($this->lowerlimit)) && ($result <= $eval->e($this->upperlimit))) {
223 return true;
224 } else {
225 return false;
226 }
227 }
228}
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.