ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
4 require_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 }