ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
4include_once "./Modules/TestQuestionPool/classes/class.assAnswerBinaryState.php";
5include_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.
Class for true/false or yes/no answers.
setCoords($coords="")
Sets the coordinates of an image map.
__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.
setArea($area="")
Sets the area 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.
An exception for terminatinating execution or to throw for unit testing.