ILIAS  Release_4_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  /*
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 
122  function getUpperLimit()
123  {
124  return $this->upperlimit;
125  }
126 
135  function getPoints()
136  {
137  return $this->points;
138  }
139 
148  function getOrder()
149  {
150  return $this->order;
151  }
152 
161  function setLowerLimit($limit)
162  {
163  $this->lowerlimit = $limit;
164  }
165 
174  function setUpperLimit($limit)
175  {
176  $this->upperlimit = $limit;
177  }
178 
187  function setPoints($points)
188  {
189  $this->points = $points;
190  }
191 
200  function setOrder($order)
201  {
202  $this->order = $order;
203  }
204 
216  function contains($value)
217  {
218  include_once "./Services/Math/classes/class.EvalMath.php";
219  $eval = new EvalMath();
220  $eval->suppress_errors = TRUE;
221  $result = $eval->e($value);
222  if (($result === FALSE) || ($result === TRUE)) return FALSE;
223  if (($result >= $eval->e($this->lowerlimit)) && ($result <= $eval->e($this->upperlimit)))
224  {
225  return TRUE;
226  }
227  else
228  {
229  return FALSE;
230  }
231  }
232 }
233 
234 ?>