ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
assNumericRange Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for assNumericRange:

Public Member Functions

 __construct ($lowerlimit=0.0, $upperlimit=0.0, $points=0.0, $order=0)
 assNumericRange constructor More...
 
 getLowerLimit ()
 Get the lower limit. More...
 
 getUpperLimit ()
 Get the upper limit. More...
 
 getPoints ()
 Get the points. More...
 
 getOrder ()
 Get the order of the range. More...
 
 setLowerLimit ($limit)
 Set the lower limit. More...
 
 setUpperLimit ($limit)
 Set the upper limit. More...
 
 setPoints ($points)
 Set the points. More...
 
 setOrder ($order)
 Set the order. More...
 
 contains ($value)
 Checks for a given value within the range. More...
 

Protected Attributes

 $lowerlimit
 
 $upperlimit
 
 $points
 
 $order
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class for numeric ranges of questions

assNumericRange is a class for numeric ranges of questions

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$
See also
assNumeric

Definition at line 35 of file class.assNumericRange.php.

Constructor & Destructor Documentation

◆ __construct()

assNumericRange::__construct (   $lowerlimit = 0.0,
  $upperlimit = 0.0,
  $points = 0.0,
  $order = 0 
)

assNumericRange constructor

The constructor takes possible arguments an creates an instance of the assNumericRange object.

Parameters
double$lowerlimitThe lower limit of the range
double$upperlimitThe upper limit of the range
double$pointsThe number of points given for the correct range
integer$orderA nonnegative value representing a possible display or sort order

Definition at line 83 of file class.assNumericRange.php.

References $lowerlimit, $order, $points, and $upperlimit.

84  {
85  $this->lowerlimit = $lowerlimit;
86  $this->upperlimit = $upperlimit;
87  $this->points = $points;
88  $this->order = $order;
89  }

Member Function Documentation

◆ contains()

assNumericRange::contains (   $value)

Checks for a given value within the range.

Checks for a given value within the range

Parameters
double$valueThe value to check
Returns
boolean TRUE if the value is in the range, FALSE otherwise
See also
$upperlimit
$lowerlimit

Definition at line 215 of file class.assNumericRange.php.

215  : bool
216  {
217  require_once './Services/Math/classes/class.EvalMath.php';
218  $eval = new EvalMath();
219  $eval->suppress_errors = true;
220  $result = $eval->e($value);
221  if (($result === false) || ($result === true)) {
222  return false;
223  }
224 
225  if (($result >= $eval->e($this->lowerlimit)) && ($result <= $eval->e($this->upperlimit))) {
226  return true;
227  } else {
228  return false;
229  }
230  }

◆ getLowerLimit()

assNumericRange::getLowerLimit ( )

Get the lower limit.

Returns the lower limit of the range

Returns
double The lower limit
See also
$lowerlimit

Definition at line 100 of file class.assNumericRange.php.

References $lowerlimit.

100  : float
101  {
102  return $this->lowerlimit;
103  }

◆ getOrder()

assNumericRange::getOrder ( )

Get the order of the range.

Returns the order of the range

Returns
integer order
See also
$order

Definition at line 142 of file class.assNumericRange.php.

References $order.

142  : int
143  {
144  return $this->order;
145  }

◆ getPoints()

assNumericRange::getPoints ( )

Get the points.

Returns the points of the range

Returns
double The points
See also
$points

Definition at line 128 of file class.assNumericRange.php.

References $points.

128  : float
129  {
130  return $this->points;
131  }

◆ getUpperLimit()

assNumericRange::getUpperLimit ( )

Get the upper limit.

Returns the upper limit of the range

Returns
double The upper limit
See also
$upperlimit

Definition at line 114 of file class.assNumericRange.php.

References $upperlimit.

114  : float
115  {
116  return $this->upperlimit;
117  }

◆ setLowerLimit()

assNumericRange::setLowerLimit (   $limit)

Set the lower limit.

Sets the lower limit of the range

Parameters
double$limitThe lower limit
See also
$lowerlimit

Definition at line 156 of file class.assNumericRange.php.

156  : void
157  {
158  $this->lowerlimit = $limit;
159  }

◆ setOrder()

assNumericRange::setOrder (   $order)

Set the order.

Sets the order of the range

Parameters
integer$orderThe order
See also
$order

Definition at line 198 of file class.assNumericRange.php.

References $order.

198  : void
199  {
200  $this->order = $order;
201  }

◆ setPoints()

assNumericRange::setPoints (   $points)

Set the points.

Sets the points of the range

Parameters
double$pointsThe points
See also
$points

Definition at line 184 of file class.assNumericRange.php.

References $points.

184  : void
185  {
186  $this->points = $points;
187  }

◆ setUpperLimit()

assNumericRange::setUpperLimit (   $limit)

Set the upper limit.

Sets the upper limit of the range

Parameters
double$limitThe upper limit
See also
$upperlimit

Definition at line 170 of file class.assNumericRange.php.

170  : void
171  {
172  $this->upperlimit = $limit;
173  }

Field Documentation

◆ $lowerlimit

assNumericRange::$lowerlimit
protected

Definition at line 44 of file class.assNumericRange.php.

Referenced by __construct(), and getLowerLimit().

◆ $order

assNumericRange::$order
protected

Definition at line 71 of file class.assNumericRange.php.

Referenced by __construct(), getOrder(), and setOrder().

◆ $points

assNumericRange::$points
protected

Definition at line 62 of file class.assNumericRange.php.

Referenced by __construct(), getPoints(), and setPoints().

◆ $upperlimit

assNumericRange::$upperlimit
protected

Definition at line 53 of file class.assNumericRange.php.

Referenced by __construct(), and getUpperLimit().


The documentation for this class was generated from the following file: