• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Modules/TestQuestionPool/classes/class.assNumericRange.php

Go to the documentation of this file.
00001 <?php
00002  /*
00003    +----------------------------------------------------------------------------+
00004    | ILIAS open source                                                          |
00005    +----------------------------------------------------------------------------+
00006    | Copyright (c) 1998-2001 ILIAS open source, University of Cologne           |
00007    |                                                                            |
00008    | This program is free software; you can redistribute it and/or              |
00009    | modify it under the terms of the GNU General Public License                |
00010    | as published by the Free Software Foundation; either version 2             |
00011    | of the License, or (at your option) any later version.                     |
00012    |                                                                            |
00013    | This program is distributed in the hope that it will be useful,            |
00014    | but WITHOUT ANY WARRANTY; without even the implied warranty of             |
00015    | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              |
00016    | GNU General Public License for more details.                               |
00017    |                                                                            |
00018    | You should have received a copy of the GNU General Public License          |
00019    | along with this program; if not, write to the Free Software                |
00020    | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 
00021    +----------------------------------------------------------------------------+
00022 */
00023 
00024 include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
00025 
00037 class assNumericRange 
00038 {
00046   var $lowerlimit;
00047 
00055   var $upperlimit;
00056         
00064   var $points;
00065 
00073   var $order;
00074 
00075         
00087   function assNumericRange (
00088     $lowerlimit = 0.0,
00089     $upperlimit = 0.0,
00090     $points = 0.0,
00091     $order = 0
00092   )
00093   {
00094                 $this->lowerlimit = $lowerlimit;
00095                 $this->upperlimit = $upperlimit;
00096                 $this->points = $points;
00097                 $this->order = $order;
00098   }
00099 
00100 
00109   function getLowerLimit() 
00110         {
00111     return $this->lowerlimit;
00112   }
00113 
00123   function getUpperLimit() 
00124         {
00125     return $this->upperlimit;
00126   }
00127 
00136   function getPoints() 
00137         {
00138     return $this->points;
00139   }
00140 
00149   function getOrder() 
00150         {
00151     return $this->order;
00152   }
00153 
00162   function setLowerLimit($limit) 
00163         {
00164     $this->lowerlimit = $limit;
00165   }
00166 
00175   function setUpperLimit($limit) 
00176         {
00177     $this->upperlimit = $limit;
00178   }
00179 
00189   function setPoints($points) 
00190         {
00191     $this->points = $points;
00192   }
00193 
00202   function setOrder($order) 
00203         {
00204     $this->order = $order;
00205   }
00206         
00218   function contains($value) 
00219         {
00220                 include_once "./Services/Math/classes/class.EvalMath.php";
00221                 $eval = new EvalMath();
00222                 $eval->suppress_errors = TRUE;
00223                 $result = $eval->e($value);
00224                 if (($result === FALSE) || ($result === TRUE)) return FALSE;
00225                 if (($result >= $eval->e($this->lowerlimit)) && ($result <= $eval->e($this->upperlimit)))
00226                 {
00227                         return TRUE;
00228                 }
00229                 else
00230                 {
00231                         return FALSE;
00232                 }
00233   }
00234 }
00235 
00236 ?>

Generated on Fri Dec 13 2013 17:56:54 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1