ILIAS
release_5-0 Revision 5.0.0-1144-gc4397b1f870
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Files
File List
+
Globals
+
All
$
(
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
v
w
x
+
Variables
$
(
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
class.ilTestSkillLevelThreshold.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
ilTestSkillLevelThreshold
12
{
16
private
$db
;
17
21
private
$testId
;
22
26
private
$skillBaseId
;
27
31
private
$skillTrefId
;
32
36
private
$skillLevelId
;
37
41
private
$threshold
;
42
43
public
function
__construct
(
ilDB
$db
)
44
{
45
$this->db =
$db
;
46
}
47
48
public
function
loadFromDb
()
49
{
50
$query
=
"
51
SELECT test_fi, skill_base_fi, skill_tref_fi, skill_level_fi, threshold
52
FROM tst_skl_thresholds
53
WHERE test_fi = %s
54
AND skill_base_fi = %s
55
AND skill_tref_fi = %s
56
AND skill_level_fi = %s
57
"
;
58
59
$res
= $this->db->queryF(
60
$query
, array(
'integer'
,
'integer'
,
'integer'
,
'integer'
),
61
array($this->
getTestId
(), $this->
getSkillBaseId
(), $this->
getSkillTrefId
(), $this->
getSkillLevelId
())
62
);
63
64
$row
= $this->db->fetchAssoc(
$res
);
65
66
if
( is_array(
$row
) )
67
{
68
$this->
setThreshold
(
$row
[
'threshold'
]);
69
}
70
}
71
72
public
function
saveToDb
()
73
{
74
if
( $this->
dbRecordExists
() )
75
{
76
$this->db->update(
'tst_skl_thresholds'
, array(
77
'threshold'
=> array(
'integer'
, $this->
getThreshold
())
78
),
79
array(
80
'test_fi'
=> array(
'integer'
, $this->
getTestId
()),
81
'skill_base_fi'
=> array(
'integer'
, $this->
getSkillBaseId
()),
82
'skill_tref_fi'
=> array(
'integer'
, $this->
getSkillTrefId
()),
83
'skill_level_fi'
=> array(
'integer'
, $this->
getSkillLevelId
())
84
)
85
);
86
}
87
else
88
{
89
$this->db->insert(
'tst_skl_thresholds'
, array(
90
'test_fi'
=> array(
'integer'
, $this->
getTestId
()),
91
'skill_base_fi'
=> array(
'integer'
, $this->
getSkillBaseId
()),
92
'skill_tref_fi'
=> array(
'integer'
, $this->
getSkillTrefId
()),
93
'skill_level_fi'
=> array(
'integer'
, $this->
getSkillLevelId
()),
94
'threshold'
=> array(
'integer'
, $this->
getThreshold
())
95
));
96
}
97
}
98
99
public
function
deleteFromDb
()
100
{
101
$query
=
"
102
DELETE FROM tst_skl_thresholds
103
WHERE test_fi = %s
104
AND skill_base_fi = %s
105
AND skill_tref_fi = %s
106
AND skill_level_fi = %s
107
"
;
108
109
$this->db->manipulateF(
110
$query
, array(
'integer'
,
'integer'
,
'integer'
,
'integer'
),
111
array($this->
getTestId
(), $this->
getSkillBaseId
(), $this->
getSkillTrefId
(), $this->
getSkillLevelId
())
112
);
113
}
114
115
public
function
dbRecordExists
()
116
{
117
$query
=
"
118
SELECT COUNT(*) cnt
119
FROM tst_skl_thresholds
120
WHERE test_fi = %s
121
AND skill_base_fi = %s
122
AND skill_tref_fi = %s
123
AND skill_level_fi = %s
124
"
;
125
126
$res
= $this->db->queryF(
127
$query
, array(
'integer'
,
'integer'
,
'integer'
,
'integer'
),
128
array($this->
getTestId
(), $this->
getSkillBaseId
(), $this->
getSkillTrefId
(), $this->
getSkillLevelId
())
129
);
130
131
$row
= $this->db->fetchAssoc(
$res
);
132
133
return
$row
[
'cnt'
] > 0;
134
}
135
139
public
function
setTestId
(
$testId
)
140
{
141
$this->testId =
$testId
;
142
}
143
147
public
function
getTestId
()
148
{
149
return
$this->testId
;
150
}
151
155
public
function
setSkillBaseId
(
$skillBaseId
)
156
{
157
$this->skillBaseId =
$skillBaseId
;
158
}
159
163
public
function
getSkillBaseId
()
164
{
165
return
$this->skillBaseId
;
166
}
167
171
public
function
setSkillTrefId
(
$skillTrefId
)
172
{
173
$this->skillTrefId =
$skillTrefId
;
174
}
175
179
public
function
getSkillTrefId
()
180
{
181
return
$this->skillTrefId
;
182
}
183
187
public
function
setSkillLevelId
(
$skillLevelId
)
188
{
189
$this->skillLevelId =
$skillLevelId
;
190
}
191
195
public
function
getSkillLevelId
()
196
{
197
return
$this->skillLevelId
;
198
}
199
203
public
function
setThreshold
(
$threshold
)
204
{
205
$this->threshold =
$threshold
;
206
}
207
211
public
function
getThreshold
()
212
{
213
return
$this->threshold
;
214
}
215
}
ilTestSkillLevelThreshold\getSkillTrefId
getSkillTrefId()
Definition:
class.ilTestSkillLevelThreshold.php:179
ilTestSkillLevelThreshold\$skillBaseId
$skillBaseId
Definition:
class.ilTestSkillLevelThreshold.php:26
ilTestSkillLevelThreshold\dbRecordExists
dbRecordExists()
Definition:
class.ilTestSkillLevelThreshold.php:115
$res
$res
Definition:
examplelayouts.sql.php:25
ilTestSkillLevelThreshold\setSkillLevelId
setSkillLevelId($skillLevelId)
Definition:
class.ilTestSkillLevelThreshold.php:187
ilTestSkillLevelThreshold\$skillLevelId
$skillLevelId
Definition:
class.ilTestSkillLevelThreshold.php:36
ilTestSkillLevelThreshold
Definition:
class.ilTestSkillLevelThreshold.php:11
$query
$query
Definition:
examplelayouts.sql.php:24
ilTestSkillLevelThreshold\$db
$db
Definition:
class.ilTestSkillLevelThreshold.php:16
$row
$row
Definition:
examplelayouts.sql.php:26
ilTestSkillLevelThreshold\getSkillBaseId
getSkillBaseId()
Definition:
class.ilTestSkillLevelThreshold.php:163
ilTestSkillLevelThreshold\getThreshold
getThreshold()
Definition:
class.ilTestSkillLevelThreshold.php:211
ilTestSkillLevelThreshold\saveToDb
saveToDb()
Definition:
class.ilTestSkillLevelThreshold.php:72
ilTestSkillLevelThreshold\loadFromDb
loadFromDb()
Definition:
class.ilTestSkillLevelThreshold.php:48
ilTestSkillLevelThreshold\$skillTrefId
$skillTrefId
Definition:
class.ilTestSkillLevelThreshold.php:31
ilTestSkillLevelThreshold\$threshold
$threshold
Definition:
class.ilTestSkillLevelThreshold.php:41
ilTestSkillLevelThreshold\__construct
__construct(ilDB $db)
Definition:
class.ilTestSkillLevelThreshold.php:43
ilTestSkillLevelThreshold\setThreshold
setThreshold($threshold)
Definition:
class.ilTestSkillLevelThreshold.php:203
ilTestSkillLevelThreshold\$testId
$testId
Definition:
class.ilTestSkillLevelThreshold.php:21
ilDB
Database Wrapper.
Definition:
class.ilDB.php:28
ilTestSkillLevelThreshold\setSkillTrefId
setSkillTrefId($skillTrefId)
Definition:
class.ilTestSkillLevelThreshold.php:171
ilTestSkillLevelThreshold\deleteFromDb
deleteFromDb()
Definition:
class.ilTestSkillLevelThreshold.php:99
ilTestSkillLevelThreshold\setSkillBaseId
setSkillBaseId($skillBaseId)
Definition:
class.ilTestSkillLevelThreshold.php:155
ilTestSkillLevelThreshold\setTestId
setTestId($testId)
Definition:
class.ilTestSkillLevelThreshold.php:139
ilTestSkillLevelThreshold\getSkillLevelId
getSkillLevelId()
Definition:
class.ilTestSkillLevelThreshold.php:195
ilTestSkillLevelThreshold\getTestId
getTestId()
Definition:
class.ilTestSkillLevelThreshold.php:147
Modules
Test
classes
class.ilTestSkillLevelThreshold.php
Generated on Mon Apr 7 2025 19:00:43 for ILIAS by
1.8.13 (using
Doxyfile
)