ILIAS
Release_5_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.ilAssQuestionPreviewSettings.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
11
class
ilAssQuestionPreviewSettings
12
{
13
private
$contextRefId
= null;
14
15
private
$genericFeedbackEnabled
=
false
;
16
17
private
$specificFeedbackEnabled
=
false
;
18
19
private
$hintProvidingEnabled
=
false
;
20
21
private
$bestSolutionEnabled
=
false
;
22
23
public
function
__construct
(
$contextRefId
)
24
{
25
$this->contextRefId =
$contextRefId
;
26
}
27
28
public
function
init
()
29
{
30
if
( $this->
isTestRefId
() )
31
{
32
$this->
initSettingsWithTestObject
();
33
}
34
else
35
{
36
$this->
initSettingsFromPostParameters
();
37
}
38
}
39
40
private
function
isTestRefId
()
41
{
42
$objectType =
ilObject::_lookupType
($this->contextRefId,
true
);
43
44
return
$objectType ==
'tst'
;
45
}
46
47
private
function
initSettingsWithTestObject
()
48
{
49
$testOBJ =
ilObjectFactory::getInstanceByRefId
($this->contextRefId);
50
$testOBJ->loadFromDb();
51
52
$this->
setGenericFeedbackEnabled
($testOBJ->getGenericAnswerFeedback());
53
$this->
setSpecificFeedbackEnabled
($testOBJ->getSpecificAnswerFeedback());
54
$this->
setHintProvidingEnabled
($testOBJ->isOfferingQuestionHintsEnabled());
55
$this->
setBestSolutionEnabled
($testOBJ->getInstantFeedbackSolution());
56
}
57
58
private
function
initSettingsFromPostParameters
()
59
{
60
// get from post or from toolbar instance if possible
61
62
$this->
setGenericFeedbackEnabled
(
true
);
63
$this->
setSpecificFeedbackEnabled
(
true
);
64
$this->
setHintProvidingEnabled
(
true
);
65
$this->
setBestSolutionEnabled
(
true
);
66
}
67
68
public
function
setContextRefId
(
$contextRefId
)
69
{
70
$this->contextRefId =
$contextRefId
;
71
}
72
73
public
function
getContextRefId
()
74
{
75
return
$this->contextRefId
;
76
}
77
78
public
function
setGenericFeedbackEnabled
(
$genericFeedbackEnabled
)
79
{
80
$this->genericFeedbackEnabled =
$genericFeedbackEnabled
;
81
}
82
83
public
function
isGenericFeedbackEnabled
()
84
{
85
return
$this->genericFeedbackEnabled
;
86
}
87
88
public
function
setSpecificFeedbackEnabled
(
$specificFeedbackEnabled
)
89
{
90
$this->specificFeedbackEnabled =
$specificFeedbackEnabled
;
91
}
92
93
public
function
isSpecificFeedbackEnabled
()
94
{
95
return
$this->specificFeedbackEnabled
;
96
}
97
98
public
function
setHintProvidingEnabled
(
$hintProvidingEnabled
)
99
{
100
$this->hintProvidingEnabled =
$hintProvidingEnabled
;
101
}
102
103
public
function
isHintProvidingEnabled
()
104
{
105
return
$this->hintProvidingEnabled
;
106
}
107
108
public
function
setBestSolutionEnabled
(
$bestSolutionEnabled
)
109
{
110
$this->bestSolutionEnabled =
$bestSolutionEnabled
;
111
}
112
113
public
function
isBestSolutionEnabled
()
114
{
115
return
$this->bestSolutionEnabled
;
116
}
117
118
public
function
isInstantFeedbackNavigationRequired
()
119
{
120
if
( $this->
isGenericFeedbackEnabled
() )
121
{
122
return
true
;
123
}
124
125
if
( $this->
isSpecificFeedbackEnabled
() )
126
{
127
return
true
;
128
}
129
130
if
( $this->
isBestSolutionEnabled
() )
131
{
132
return
true
;
133
}
134
135
return
false
;
136
}
137
138
public
function
isHintProvidingNavigationRequired
()
139
{
140
return
$this->
isHintProvidingEnabled
();
141
}
142
}
Modules
TestQuestionPool
classes
class.ilAssQuestionPreviewSettings.php
Generated on Wed Apr 27 2016 21:01:21 for ILIAS by
1.8.1.2 (using
Doxyfile
)