ILIAS  release_4-4 Revision
assNumericRange Class Reference

Class for numeric ranges of questions. 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

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 20 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
Returns
assNumericRange

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

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

71  {
72  $this->lowerlimit = $lowerlimit;
73  $this->upperlimit = $upperlimit;
74  $this->points = $points;
75  $this->order = $order;
76  }

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

References $result.

203  {
204  require_once './Services/Math/classes/class.EvalMath.php';
205  $eval = new EvalMath();
206  $eval->suppress_errors = TRUE;
207  $result = $eval->e($value);
208  if (($result === FALSE) || ($result === TRUE))
209  {
210  return FALSE;
211  }
212 
213  if (($result >= $eval->e($this->lowerlimit)) && ($result <= $eval->e($this->upperlimit)))
214  {
215  return TRUE;
216  }
217  else
218  {
219  return FALSE;
220  }
221  }
$result

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

References $lowerlimit.

88  {
89  return $this->lowerlimit;
90  }

◆ getOrder()

assNumericRange::getOrder ( )

Get the order of the range.

Returns the order of the range

Returns
integer order
See also
$order

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

References $order.

130  {
131  return $this->order;
132  }

◆ getPoints()

assNumericRange::getPoints ( )

Get the points.

Returns the points of the range

Returns
double The points
See also
$points

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

References $points.

116  {
117  return $this->points;
118  }

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

References $upperlimit.

102  {
103  return $this->upperlimit;
104  }

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

144  {
145  $this->lowerlimit = $limit;
146  }

◆ setOrder()

assNumericRange::setOrder (   $order)

Set the order.

Sets the order of the range

Parameters
integer$orderThe order
See also
$order

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

References $order.

186  {
187  $this->order = $order;
188  }

◆ setPoints()

assNumericRange::setPoints (   $points)

Set the points.

Sets the points of the range

Parameters
double$pointsThe points
See also
$points

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

References $points.

172  {
173  $this->points = $points;
174  }

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

158  {
159  $this->upperlimit = $limit;
160  }

Field Documentation

◆ $lowerlimit

assNumericRange::$lowerlimit
protected

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

Referenced by __construct(), and getLowerLimit().

◆ $order

assNumericRange::$order
protected

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

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

◆ $points

assNumericRange::$points
protected

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

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

◆ $upperlimit

assNumericRange::$upperlimit
protected

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

Referenced by __construct(), and getUpperLimit().


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