ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.assAnswerImagemap.php
Go to the documentation of this file.
1<?php
2
28{
32 protected $area;
33 public string $coords;
34
42 protected $points_unchecked = 0.0;
43
55 public function __construct(
56 $answertext = "",
57 $points = 0.0,
58 $order = 0,
59 $coords = "",
60 $area = "",
61 $id = -1,
63 ) {
65 $this->coords = $coords;
66 $this->area = $area;
67 $this->points_unchecked = $points_unchecked;
68 }
69
70
78 public function getCoords(): string
79 {
80 $this->coords = preg_replace("/\s/", "", $this->coords);
81 return $this->coords;
82 }
83
84
91 public function setCoords(string $coords = ""): void
92 {
93 $coords = preg_replace("/\s/", "", $coords);
94 $this->coords = $coords;
95 }
96
104 public function getArea(): string
105 {
106 return $this->area;
107 }
108
109
110 public function setArea(string $area = ""): void
111 {
112 $this->area = $area;
113 }
114
122 public function getPointsUnchecked()
123 {
125 }
126
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 }
145}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
getArea()
Gets the area of an image map.
setCoords(string $coords="")
Sets the coordinates of an image map.
getPointsUnchecked()
Returns the points for an unchecked answer Returns the points for an unchecked answer.
getCoords()
Gets the coordinates of an image map.
setPointsUnchecked($points_unchecked)
Sets the points for an unchecked answer.
checkPoints($a_points)
Checks, if the point value is numeric.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc