ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 33 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 81 of file class.assNumericRange.php.

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

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

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 213 of file class.assNumericRange.php.

213  : bool
214  {
215  $eval = new EvalMath();
216  $eval->suppress_errors = true;
217  $result = $eval->e($value);
218  if (($result === false) || ($result === true)) {
219  return false;
220  }
221 
222  if (($result >= $eval->e($this->lowerlimit)) && ($result <= $eval->e($this->upperlimit))) {
223  return true;
224  } else {
225  return false;
226  }
227  }

◆ 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 98 of file class.assNumericRange.php.

References $lowerlimit.

98  : float
99  {
100  return $this->lowerlimit;
101  }

◆ getOrder()

assNumericRange::getOrder ( )

Get the order of the range.

Returns the order of the range

Returns
integer order
See also
$order

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

References $order.

140  : int
141  {
142  return $this->order;
143  }

◆ getPoints()

assNumericRange::getPoints ( )

Get the points.

Returns the points of the range

Returns
double The points
See also
$points

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

References $points.

126  : float
127  {
128  return $this->points;
129  }

◆ 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 112 of file class.assNumericRange.php.

References $upperlimit.

112  : float
113  {
114  return $this->upperlimit;
115  }

◆ 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 154 of file class.assNumericRange.php.

154  : void
155  {
156  $this->lowerlimit = $limit;
157  }

◆ setOrder()

assNumericRange::setOrder (   $order)

Set the order.

Sets the order of the range

Parameters
integer$orderThe order
See also
$order

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

References $order.

196  : void
197  {
198  $this->order = $order;
199  }

◆ setPoints()

assNumericRange::setPoints (   $points)

Set the points.

Sets the points of the range

Parameters
double$pointsThe points
See also
$points

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

References $points.

182  : void
183  {
184  $this->points = $points;
185  }

◆ 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 168 of file class.assNumericRange.php.

168  : void
169  {
170  $this->upperlimit = $limit;
171  }

Field Documentation

◆ $lowerlimit

assNumericRange::$lowerlimit
protected

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

Referenced by __construct(), and getLowerLimit().

◆ $order

assNumericRange::$order
protected

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

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

◆ $points

assNumericRange::$points
protected

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

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

◆ $upperlimit

assNumericRange::$upperlimit
protected

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

Referenced by __construct(), and getUpperLimit().


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