ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.assAnswerTrueFalse.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
require_once
'./Modules/TestQuestionPool/classes/class.assAnswerSimple.php'
;
5
require_once
'./Modules/Test/classes/inc.AssessmentConstants.php'
;
6
21
class
ASS_AnswerTrueFalse
extends
ASS_AnswerSimple
22
{
30
public
$correctness
;
31
42
public
function
__construct
(
$answertext
=
""
,
$points
= 0.0,
$order
= 0,
$correctness
=
false
)
43
{
44
parent::__construct(
$answertext
,
$points
,
$order
);
45
46
// force $this->correctness to be a string
47
// ilDB->quote makes 1 from true and saving it to ENUM('1','0') makes that '0'!!!
48
// (maybe that only happens for certain mysql versions)
49
$this->correctness =
$correctness
.
""
;
50
}
51
57
public
function
getCorrectness
()
58
{
59
return
$this->correctness
;
60
}
61
67
public
function
isCorrect
()
68
{
69
return
$this->correctness
;
70
}
71
77
public
function
isIncorrect
()
78
{
79
return
!
$this->correctness
;
80
}
81
89
public
function
isTrue
()
90
{
91
return
$this->correctness
;
92
}
93
101
public
function
isFalse
()
102
{
103
return
!
$this->correctness
;
104
}
105
111
public
function
setCorrectness
(
$correctness
=
false
)
112
{
113
// force $this->correctness to be a string
114
// ilDB->quote makes 1 from true and saving it to ENUM('1','0') makes that '0'!!!
115
// (maybe that only happens for certain mysql versions)
116
$this->correctness =
$correctness
.
""
;
117
}
118
124
public
function
setTrue
()
125
{
126
$this->correctness =
"1"
;
127
}
128
134
public
function
setFalse
()
135
{
136
$this->correctness =
"0"
;
137
}
138
}
ASS_AnswerTrueFalse\getCorrectness
getCorrectness()
Gets the correctness.
Definition:
class.assAnswerTrueFalse.php:57
ASS_AnswerTrueFalse\setTrue
setTrue()
Sets the answer as a correct answer.
Definition:
class.assAnswerTrueFalse.php:124
ASS_AnswerTrueFalse\isFalse
isFalse()
Gets the correctness.
Definition:
class.assAnswerTrueFalse.php:101
ASS_AnswerTrueFalse\setCorrectness
setCorrectness($correctness=false)
Sets the correctness.
Definition:
class.assAnswerTrueFalse.php:111
ASS_AnswerSimple\$answertext
$answertext
Definition:
class.assAnswerSimple.php:27
ASS_AnswerTrueFalse\__construct
__construct($answertext="", $points=0.0, $order=0, $correctness=false)
ASS_AnswerTrueFalse constructor.
Definition:
class.assAnswerTrueFalse.php:42
ASS_AnswerSimple
Class for simple answers.
Definition:
class.assAnswerSimple.php:18
ASS_AnswerSimple\$points
$points
Definition:
class.assAnswerSimple.php:36
ASS_AnswerTrueFalse\setFalse
setFalse()
Sets the answer as a incorrect answer.
Definition:
class.assAnswerTrueFalse.php:134
ASS_AnswerTrueFalse\$correctness
$correctness
Definition:
class.assAnswerTrueFalse.php:30
ASS_AnswerTrueFalse\isIncorrect
isIncorrect()
Gets the correctness.
Definition:
class.assAnswerTrueFalse.php:77
ASS_AnswerTrueFalse\isTrue
isTrue()
Gets the correctness.
Definition:
class.assAnswerTrueFalse.php:89
ASS_AnswerSimple\$order
$order
Definition:
class.assAnswerSimple.php:45
ASS_AnswerTrueFalse
Class for true/false or yes/no answers.
Definition:
class.assAnswerTrueFalse.php:21
ASS_AnswerTrueFalse\isCorrect
isCorrect()
Gets the correctness.
Definition:
class.assAnswerTrueFalse.php:67
Modules
TestQuestionPool
classes
class.assAnswerTrueFalse.php
Generated on Sat Jan 18 2025 19:01:22 for ILIAS by
1.8.13 (using
Doxyfile
)