ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.assAnswerImagemap.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once "./Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php";
5 include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
6 
19 {
27  public $coords;
28 
36  public $area;
37 
45  protected $points_unchecked = 0.0;
46 
58  public function __construct(
59  $answertext = "",
60  $points = 0.0,
61  $order = 0,
62  $coords = "",
63  $area = "",
64  $id = -1,
66  ) {
67  parent::__construct($answertext, $points, 1, $id);
68  $this->coords = $coords;
69  $this->area = $area;
70  $this->points_unchecked = $points_unchecked;
71  }
72 
73 
81  public function getCoords()
82  {
83  $this->coords = preg_replace("/\s/", "", $this->coords);
84  return $this->coords;
85  }
86 
87 
95  public function setCoords($coords="")
96  {
97  $coords = preg_replace("/\s/", "", $coords);
98  $this->coords=$coords;
99  }
100 
108  public function getArea()
109  {
110  return $this->area;
111  }
112 
113 
121  public function setArea($area="")
122  {
123  $this->area=$area;
124  }
125 
133  public function getPointsUnchecked()
134  {
136  }
137 
147  {
148  $new_points = str_replace(",", ".", $points_unchecked);
149 
150  if ($this->checkPoints($new_points)) {
151  $this->points_unchecked = $new_points;
152  } else {
153  $this->points_unchecked = 0.0;
154  }
155  }
156 }
Class for true/false or yes/no answers.
__construct( $answertext="", $points=0.0, $order=0, $coords="", $area="", $id=-1, $points_unchecked=0)
ASS_AnswerImagemap constructor.
setArea($area="")
Sets the area of an image map.
checkPoints($a_points)
Checks, if the point value is numeric.
setPointsUnchecked($points_unchecked)
Sets the points for an unchecked answer.
getCoords()
Gets the coordinates of an image map.
getArea()
Gets the area of an image map.
getPointsUnchecked()
Returns the points for an unchecked answer Returns the points for an unchecked answer.
setCoords($coords="")
Sets the coordinates of an image map.
Class for true/false or yes/no answers.