ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.assNumericRange.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once './Modules/Test/classes/inc.AssessmentConstants.php';
5
21{
29 protected $lowerlimit;
30
38 protected $upperlimit;
39
47 protected $points;
48
56 protected $order;
57
70 public function __construct ( $lowerlimit = 0.0, $upperlimit = 0.0, $points = 0.0, $order = 0 )
71 {
72 $this->lowerlimit = $lowerlimit;
73 $this->upperlimit = $upperlimit;
74 $this->points = $points;
75 $this->order = $order;
76 }
77
87 public function getLowerLimit()
88 {
89 return $this->lowerlimit;
90 }
91
101 function getUpperLimit()
102 {
103 return $this->upperlimit;
104 }
105
115 public function getPoints()
116 {
117 return $this->points;
118 }
119
129 public function getOrder()
130 {
131 return $this->order;
132 }
133
143 public function setLowerLimit($limit)
144 {
145 $this->lowerlimit = $limit;
146 }
147
157 public function setUpperLimit($limit)
158 {
159 $this->upperlimit = $limit;
160 }
161
171 public function setPoints($points)
172 {
173 $this->points = $points;
174 }
175
185 public function setOrder($order)
186 {
187 $this->order = $order;
188 }
189
202 public function contains($value)
203 {
204 require_once './Services/Math/classes/class.EvalMath.php';
205 $eval = new EvalMath();
206 $eval->suppress_errors = TRUE;
207 $result = $eval->e($value);
208 if (($result === FALSE) || ($result === TRUE))
209 {
210 return FALSE;
211 }
212
213 if (($result >= $eval->e($this->lowerlimit)) && ($result <= $eval->e($this->upperlimit)))
214 {
215 return TRUE;
216 }
217 else
218 {
219 return FALSE;
220 }
221 }
222}
$result
Class for numeric ranges of questions.
getOrder()
Get the order of the range.
setPoints($points)
Set the points.
getPoints()
Get the points.
getLowerLimit()
Get the lower limit.
setUpperLimit($limit)
Set the upper limit.
setLowerLimit($limit)
Set the lower limit.
__construct( $lowerlimit=0.0, $upperlimit=0.0, $points=0.0, $order=0)
assNumericRange constructor
setOrder($order)
Set the order.
getUpperLimit()
Get the upper limit.
contains($value)
Checks for a given value within the range.