ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ASS_AnswerImagemap 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_AnswerImagemap:
+ Collaboration diagram for ASS_AnswerImagemap:

Public Member Functions

 __construct ( $answertext="", $points=0.0, $order=0, $coords="", $area="", $id=-1, $points_unchecked=0)
 ASS_AnswerImagemap constructor. More...
 
 getCoords ()
 Gets the coordinates of an image map. More...
 
 setCoords (string $coords="")
 Sets the coordinates of an image map. More...
 
 getArea ()
 Gets the area of an image map. More...
 
 setArea (string $area="")
 
 getPointsUnchecked ()
 Returns the points for an unchecked answer Returns the points for an unchecked answer. More...
 
 setPointsUnchecked ($points_unchecked)
 Sets the points for an unchecked answer. More...
 
- Public Member Functions inherited from ASS_AnswerBinaryState
 __construct (string $answertext="", float $points=0.0, int $order=0, bool $checked=false, int $id=-1)
 ASS_AnswerBinaryState constructor The constructor takes possible arguments and creates an instance of the ASS_AnswerBinaryState object. More...
 
 getState ()
 Gets the state. More...
 
 isStateChecked ()
 Gets the state. More...
 
 isStateSet ()
 Gets the state. More...
 
 isStateUnset ()
 Gets the state. More...
 
 isStateUnchecked ()
 Gets the state. More...
 
 setState (bool $state=false)
 Sets the state. More...
 
 setChecked ()
 Sets the answer as a checked answer. More...
 
 setSet ()
 Sets the answer as a set answer. More...
 
 setUnset ()
 Sets the answer as a unset answer. More...
 
 setUnchecked ()
 Sets the answer as a unchecked answer. More...
 
- 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

string $coords
 

Protected Attributes

 $area
 
 $points_unchecked = 0.0
 
- 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_AnswerImagemap is a class for true/false or yes/no answers used for example in multiple choice tests.

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 \

Definition at line 27 of file class.assAnswerImagemap.php.

Constructor & Destructor Documentation

◆ __construct()

ASS_AnswerImagemap::__construct (   $answertext = "",
  $points = 0.0,
  $order = 0,
  $coords = "",
  $area = "",
  $id = -1,
  $points_unchecked = 0 
)

ASS_AnswerImagemap constructor.

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

Parameters
string$answertextA string defining the answer text
double$pointsThe number of points given for the selected answer
boolean$correctnessA boolean value indicating the correctness of the answer
integer$orderA nonnegative value representing a possible display or sort order public

Definition at line 55 of file class.assAnswerImagemap.php.

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getArea()

ASS_AnswerImagemap::getArea ( )

Gets the area of an image map.

Returns
string area public
See also
$area

Definition at line 104 of file class.assAnswerImagemap.php.

References $area.

104  : string
105  {
106  return $this->area;
107  }

◆ getCoords()

ASS_AnswerImagemap::getCoords ( )

Gets the coordinates of an image map.

Returns
string coords public
See also
$coords

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

References $coords.

78  : string
79  {
80  $this->coords = preg_replace("/\s/", "", $this->coords);
81  return $this->coords;
82  }

◆ getPointsUnchecked()

ASS_AnswerImagemap::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 122 of file class.assAnswerImagemap.php.

References $points_unchecked.

123  {
125  }

◆ setArea()

ASS_AnswerImagemap::setArea ( string  $area = "")

Definition at line 110 of file class.assAnswerImagemap.php.

References $area.

110  : void
111  {
112  $this->area = $area;
113  }

◆ setCoords()

ASS_AnswerImagemap::setCoords ( string  $coords = "")

Sets the coordinates of an image map.

Parameters
string$coordspublic
See also
$coords

Definition at line 91 of file class.assAnswerImagemap.php.

References $coords.

91  : void
92  {
93  $coords = preg_replace("/\s/", "", $coords);
94  $this->coords = $coords;
95  }

◆ setPointsUnchecked()

ASS_AnswerImagemap::setPointsUnchecked (   $points_unchecked)

Sets the points for an unchecked answer.

Parameters
int | string | null$points_uncheckedThe points for an unchecked answer
See also
$points_unchecked

Analyze usage and see if we can get rid of "magic nullification" here.

Definition at line 135 of file class.assAnswerImagemap.php.

References $points_unchecked, and ASS_AnswerSimple\checkPoints().

135  : void
136  {
137  $new_points = str_replace(",", ".", $points_unchecked);
138 
139  if ($this->checkPoints($new_points)) {
140  $this->points_unchecked = $new_points;
141  } else {
142  $this->points_unchecked = 0.0;
143  }
144  }
checkPoints($a_points)
Checks, if the point value is numeric.
+ Here is the call graph for this function:

Field Documentation

◆ $area

ASS_AnswerImagemap::$area
protected

Definition at line 32 of file class.assAnswerImagemap.php.

Referenced by __construct(), getArea(), and setArea().

◆ $coords

string ASS_AnswerImagemap::$coords

Definition at line 33 of file class.assAnswerImagemap.php.

Referenced by __construct(), getCoords(), and setCoords().

◆ $points_unchecked

ASS_AnswerImagemap::$points_unchecked = 0.0
protected

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

Referenced by __construct(), getPointsUnchecked(), and setPointsUnchecked().


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