ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.assNumericRange.php
Go to the documentation of this file.
1 <?php
2  /*
3  +----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +----------------------------------------------------------------------------+
22 */
23 
24 include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
25 
38 {
47 
56 
64  var $points;
65 
73  var $order;
74 
75 
87  function assNumericRange (
88  $lowerlimit = 0.0,
89  $upperlimit = 0.0,
90  $points = 0.0,
91  $order = 0
92  )
93  {
94  $this->lowerlimit = $lowerlimit;
95  $this->upperlimit = $upperlimit;
96  $this->points = $points;
97  $this->order = $order;
98  }
99 
100 
109  function getLowerLimit()
110  {
111  return $this->lowerlimit;
112  }
113 
123  function getUpperLimit()
124  {
125  return $this->upperlimit;
126  }
127 
136  function getPoints()
137  {
138  return $this->points;
139  }
140 
149  function getOrder()
150  {
151  return $this->order;
152  }
153 
162  function setLowerLimit($limit)
163  {
164  $this->lowerlimit = $limit;
165  }
166 
175  function setUpperLimit($limit)
176  {
177  $this->upperlimit = $limit;
178  }
179 
189  function setPoints($points)
190  {
191  $this->points = $points;
192  }
193 
202  function setOrder($order)
203  {
204  $this->order = $order;
205  }
206 
218  function contains($value)
219  {
220  include_once "./Services/Math/classes/class.EvalMath.php";
221  $eval = new EvalMath();
222  $eval->suppress_errors = TRUE;
223  $result = $eval->e($value);
224  if (($result === FALSE) || ($result === TRUE)) return FALSE;
225  if (($result >= $eval->e($this->lowerlimit)) && ($result <= $eval->e($this->upperlimit)))
226  {
227  return TRUE;
228  }
229  else
230  {
231  return FALSE;
232  }
233  }
234 }
235 
236 ?>