ILIAS  release_4-4 Revision
ASS_AnswerImagemap Class Reference

Class for true/false or yes/no answers. More...

+ Inheritance diagram for ASS_AnswerImagemap:
+ Collaboration diagram for ASS_AnswerImagemap:

Public Member Functions

 ASS_AnswerImagemap ( $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 ($coords="")
 Sets the coordinates of an image map. More...
 
 getArea ()
 Gets the area of an image map. More...
 
 setArea ($area="")
 Sets the area of an image map. More...
 
 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 ( $answertext="", $points=0.0, $order=0, $state=0, $id=-1)
 ASS_AnswerBinaryState constructor. 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 ($state=0)
 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

 $coords
 
 $area
 

Protected Attributes

 $points_unchecked = 0.0
 
- Protected Attributes inherited from ASS_AnswerBinaryState
 $state
 
- Protected Attributes inherited from ASS_AnswerSimple
 $answertext
 
 $points
 
 $order
 
 $id
 

Detailed Description

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

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

Member Function Documentation

◆ ASS_AnswerImagemap()

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

References ASS_AnswerSimple\$answertext, $area, $coords, ASS_AnswerSimple\$id, ASS_AnswerSimple\$points, and $points_unchecked.

◆ getArea()

ASS_AnswerImagemap::getArea ( )

Gets the area of an image map.

Returns
string area public
See also
$area

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

References $area.

106  {
107  return $this->area;
108  }

◆ getCoords()

ASS_AnswerImagemap::getCoords ( )

Gets the coordinates of an image map.

Returns
string coords public
See also
$coords

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

References $coords.

81  {
82  $this->coords = preg_replace("/\s/", "", $this->coords);
83  return $this->coords;
84  }

◆ 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 129 of file class.assAnswerImagemap.php.

References $points_unchecked.

130  {
132  }

◆ setArea()

ASS_AnswerImagemap::setArea (   $area = "")

Sets the area of an image map.

Parameters
string$areapublic
See also
$area

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

References $area.

118  {
119  $this->area=$area;
120  }

◆ setCoords()

ASS_AnswerImagemap::setCoords (   $coords = "")

Sets the coordinates of an image map.

Parameters
string$coordspublic
See also
$coords

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

References $coords.

94  {
95  $coords = preg_replace("/\s/", "", $coords);
96  $this->coords=$coords;
97  }

◆ setPointsUnchecked()

ASS_AnswerImagemap::setPointsUnchecked (   $points_unchecked)

Sets the points for an unchecked answer.

Parameters
double$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 142 of file class.assAnswerImagemap.php.

References $points_unchecked, and ASS_AnswerSimple\checkPoints().

143  {
144  $new_points = str_replace(",", ".", $points_unchecked);
145 
146  if($this->checkPoints($new_points))
147  {
148  $this->points_unchecked = $new_points;
149  }
150  else
151  {
152  $this->points_unchecked = 0.0;
153  }
154  }
checkPoints($a_points)
Checks, if the point value is numeric.
+ Here is the call graph for this function:

Field Documentation

◆ $area

ASS_AnswerImagemap::$area

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

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

◆ $coords

ASS_AnswerImagemap::$coords

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

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

◆ $points_unchecked

ASS_AnswerImagemap::$points_unchecked = 0.0
protected

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