ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ASS_AnswerMultipleResponse Class Reference

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

+ Inheritance diagram for ASS_AnswerMultipleResponse:
+ Collaboration diagram for ASS_AnswerMultipleResponse:

Public Member Functions

 __construct (string $answertext="", float $points=0.0, int $order=0, int $id=-1, int $state=0)
 ASS_AnswerMultipleResponse constructor. More...
 
 getPointsUnchecked ()
 Returns the points for an unchecked answer. More...
 
 setPointsUnchecked ($points_unchecked=0.0)
 Sets the points for an unchecked answer. More...
 
 setPointsChecked ($points_checked)
 
 getPointsChecked ()
 
- Public Member Functions inherited from ASS_AnswerSimple
 __construct ($answertext="", $points=0.0, $order=0, $id=-1)
 ASS_AnswerSimple constructor. More...
 
 getId ()
 Gets the answer id. More...
 
 getAnswertext ()
 Gets the answer text. More...
 
 getPoints ()
 Gets the points. More...
 
 checkPoints ($a_points)
 Checks, if the point value is numeric. More...
 
 getOrder ()
 Gets the sort/display order. More...
 
 setOrder ($order=0)
 Sets the order. More...
 
 setId ($id=-1)
 Sets the answer id. More...
 
 setAnswertext ($answertext="")
 Sets the answer text. More...
 
 setPoints ($points=0.0)
 Sets the points. More...
 

Data Fields

 $points_unchecked
 The points given to the answer when the answer is not checked. More...
 

Additional Inherited Members

- Protected Attributes inherited from ASS_AnswerSimple
string $answertext
 
 $points
 
 $order
 
 $id
 

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 true/false or yes/no answers

ASS_AnswerMultipleResponse is a class for answers with a binary state indicator (checked/unchecked, set/unset)

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
Version
$Id$
See also
ASS_AnswerSimple

Definition at line 31 of file class.assAnswerMultipleResponse.php.

Constructor & Destructor Documentation

◆ __construct()

ASS_AnswerMultipleResponse::__construct ( string  $answertext = "",
float  $points = 0.0,
int  $order = 0,
int  $id = -1,
int  $state = 0 
)

ASS_AnswerMultipleResponse constructor.

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

Parameters
string$answertextA string defining the answer text
double$pointsThe number of points given for the selected answer
double$points_uncheckedThe points when the answer is not checked
integer$orderA nonnegative value representing a possible display or sort order public

Definition at line 49 of file class.assAnswerMultipleResponse.php.

References ASS_AnswerSimple\$answertext, ASS_AnswerSimple\$id, ASS_AnswerSimple\$order, ASS_AnswerSimple\$points, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ getPointsChecked()

ASS_AnswerMultipleResponse::getPointsChecked ( )

Definition at line 94 of file class.assAnswerMultipleResponse.php.

References ASS_AnswerSimple\getPoints().

94  : float
95  {
96  return $this->getPoints();
97  }
getPoints()
Gets the points.
+ Here is the call graph for this function:

◆ getPointsUnchecked()

ASS_AnswerMultipleResponse::getPointsUnchecked ( )

Returns the points for an unchecked answer.

Returns the points for an unchecked answer

Returns
double The points for an unchecked answer public
See also
$points_unchecked

Definition at line 64 of file class.assAnswerMultipleResponse.php.

References $points_unchecked.

64  : float
65  {
67  }
$points_unchecked
The points given to the answer when the answer is not checked.

◆ setPointsChecked()

ASS_AnswerMultipleResponse::setPointsChecked (   $points_checked)

Definition at line 89 of file class.assAnswerMultipleResponse.php.

References ASS_AnswerSimple\setPoints().

89  : void
90  {
91  $this->setPoints($points_checked);
92  }
setPoints($points=0.0)
Sets the points.
+ Here is the call graph for this function:

◆ setPointsUnchecked()

ASS_AnswerMultipleResponse::setPointsUnchecked (   $points_unchecked = 0.0)

Sets the points for an unchecked answer.

Sets the points for an unchecked answer

Parameters
double$points_uncheckedThe points for an unchecked answer public
See also
$state

Definition at line 78 of file class.assAnswerMultipleResponse.php.

References $points_unchecked, and ASS_AnswerSimple\checkPoints().

78  : void
79  {
80  $new_points = str_replace(",", ".", $points_unchecked);
81 
82  if ($this->checkPoints($new_points)) {
83  $this->points_unchecked = $new_points;
84  } else {
85  $this->points_unchecked = 0.0;
86  }
87  }
checkPoints($a_points)
Checks, if the point value is numeric.
$points_unchecked
The points given to the answer when the answer is not checked.
+ Here is the call graph for this function:

Field Documentation

◆ $points_unchecked

ASS_AnswerMultipleResponse::$points_unchecked

The points given to the answer when the answer is not checked.

Definition at line 36 of file class.assAnswerMultipleResponse.php.

Referenced by getPointsUnchecked(), and setPointsUnchecked().


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