ILIAS
Release_4_0_x_branch Revision 61816
◀ ilDoc Overview
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
class.assAnswerSimple.php
Go to the documentation of this file.
1
<?php
2
/*
3
+----------------------------------------------------------------------------+
4
| ILIAS open source |
5
+----------------------------------------------------------------------------+
6
| Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7
| |
8
| This program is free software; you can redistribute it and/or |
9
| modify it under the terms of the GNU General Public License |
10
| as published by the Free Software Foundation; either version 2 |
11
| of the License, or (at your option) any later version. |
12
| |
13
| This program is distributed in the hope that it will be useful, |
14
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
| GNU General Public License for more details. |
17
| |
18
| You should have received a copy of the GNU General Public License |
19
| along with this program; if not, write to the Free Software |
20
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21
+----------------------------------------------------------------------------+
22
*/
23
24
include_once
"./Modules/Test/classes/inc.AssessmentConstants.php"
;
25
35
class
ASS_AnswerSimple
36
{
44
var
$answertext
;
45
53
var
$points
;
54
62
var
$order
;
63
71
var
$id
;
72
83
function
ASS_AnswerSimple
(
84
$answertext
=
""
,
85
$points
= 0.0,
86
$order
= 0,
87
$id
= -1
88
)
89
{
90
$this->answertext =
$answertext
;
91
$this->
setPoints
(
$points
);
92
$this->order =
$order
;
93
$this->
id
=
$id
;
94
}
95
105
function
getId
()
106
{
107
return
$this->id
;
108
}
109
119
function
getAnswertext
()
120
{
121
//$tmpanswertext = "<![CDATA[".$this->answertext."]]>";
122
$tmpanswertext =
$this->answertext
;
123
return
$tmpanswertext;
124
}
125
135
function
getPoints
()
136
{
137
if
(round($this->points) == $this->points)
138
{
139
return
sprintf(
"%d"
, $this->points);
140
}
141
else
142
{
143
return
$this->points
;
144
}
145
}
146
156
function
checkPoints
($a_points)
157
{
158
if
(is_numeric($a_points))
159
{
160
return
TRUE;
161
}
162
else
163
{
164
return
FALSE;
165
}
166
}
167
177
function
getOrder
()
178
{
179
return
$this->order
;
180
}
181
191
function
setOrder
(
$order
= 0)
192
{
193
if
(
$order
>= 0)
194
{
195
$this->order =
$order
;
196
}
197
}
198
208
function
setId
(
$id
= -1)
209
{
210
$this->order =
$order
;
211
}
212
222
function
setAnswertext
(
$answertext
=
""
)
223
{
224
$this->answertext =
$answertext
;
225
}
226
236
function
setPoints
(
$points
= 0.0)
237
{
238
$new_points = str_replace(
","
,
"."
,
$points
);
239
if
($this->
checkPoints
($new_points))
240
{
241
$this->points = $new_points;
242
}
243
else
244
{
245
$this->points = 0.0;
246
}
247
}
248
}
249
250
?>
Modules
TestQuestionPool
classes
class.assAnswerSimple.php
Generated on Wed Apr 27 2016 19:01:26 for ILIAS by
1.8.1.2 (using
Doxyfile
)