ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.assAnswerImagemap.php
Go to the documentation of this file.
1 <?php
2 
19 require_once './Modules/Test/classes/inc.AssessmentConstants.php';
20 
30 {
34  protected $area;
35  public string $coords;
36 
44  protected $points_unchecked = 0.0;
45 
57  public function __construct(
58  $answertext = "",
59  $points = 0.0,
60  $order = 0,
61  $coords = "",
62  $area = "",
63  $id = -1,
65  ) {
67  $this->coords = $coords;
68  $this->area = $area;
69  $this->points_unchecked = $points_unchecked;
70  }
71 
72 
80  public function getCoords(): string
81  {
82  $this->coords = preg_replace("/\s/", "", $this->coords);
83  return $this->coords;
84  }
85 
86 
93  public function setCoords(string $coords = ""): void
94  {
95  $coords = preg_replace("/\s/", "", $coords);
96  $this->coords = $coords;
97  }
98 
106  public function getArea(): string
107  {
108  return $this->area;
109  }
110 
111 
112  public function setArea(string $area = ""): void
113  {
114  $this->area = $area;
115  }
116 
124  public function getPointsUnchecked()
125  {
127  }
128 
137  public function setPointsUnchecked($points_unchecked): void
138  {
139  $new_points = str_replace(",", ".", $points_unchecked);
140 
141  if ($this->checkPoints($new_points)) {
142  $this->points_unchecked = $new_points;
143  } else {
144  $this->points_unchecked = 0.0;
145  }
146  }
147 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct( $answertext="", $points=0.0, $order=0, $coords="", $area="", $id=-1, $points_unchecked=0)
ASS_AnswerImagemap constructor.
checkPoints($a_points)
Checks, if the point value is numeric.
setPointsUnchecked($points_unchecked)
Sets the points for an unchecked answer.
__construct(VocabulariesInterface $vocabularies)
getCoords()
Gets the coordinates of an image map.
setCoords(string $coords="")
Sets 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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...