ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilLOTestAssignment.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
10
class
ilLOTestAssignment
11
{
12
private
$assignment_id
= 0;
13
private
$container_id
= 0;
14
private
$assignment_type
= 0;
15
private
$objective_id
= 0;
16
private
$test_ref_id
= 0;
17
18
23
public
function
__construct
($a_id = 0)
24
{
25
$this->
setAssignmentId
($a_id);
26
$this->
read
();
27
}
28
29
public
function
setAssignmentId
($a_id)
30
{
31
$this->assignment_id = $a_id;
32
}
33
34
public
function
getAssignmentId
()
35
{
36
return
$this->assignment_id
;
37
}
38
39
public
function
setContainerId
($a_id)
40
{
41
$this->container_id = $a_id;
42
}
43
44
public
function
getContainerId
()
45
{
46
return
$this->container_id
;
47
}
48
49
public
function
setAssignmentType
(
$a_type
)
50
{
51
$this->assignment_type =
$a_type
;
52
}
53
54
public
function
getAssignmentType
()
55
{
56
return
$this->assignment_type
;
57
}
58
59
public
function
setObjectiveId
($a_id)
60
{
61
$this->objective_id = $a_id;
62
}
63
64
public
function
getObjectiveId
()
65
{
66
return
$this->objective_id
;
67
}
68
69
public
function
setTestRefId
($a_id)
70
{
71
$this->test_ref_id = $a_id;
72
}
73
74
public
function
getTestRefId
()
75
{
76
return
$this->test_ref_id
;
77
}
78
83
public
function
save
()
84
{
85
if
($this->
getAssignmentId
()) {
86
return
$this->
update
();
87
}
else
{
88
return
$this->
create
();
89
}
90
}
91
96
public
function
create
()
97
{
98
global
$DIC
;
99
100
$ilDB
= $DIC[
'ilDB'
];
101
102
$this->
setAssignmentId
(
$ilDB
->nextId(
'loc_tst_assignments'
));
103
$query
=
'INSERT INTO loc_tst_assignments (assignment_id, container_id, assignment_type, objective_id, tst_ref_id) '
.
104
'VALUES ( '
.
105
$ilDB
->quote($this->
getAssignmentId
(),
'integer'
) .
', '
.
106
$ilDB
->quote($this->
getContainerId
(),
'integer'
) .
', '
.
107
$ilDB
->quote($this->
getAssignmentType
(),
'integer'
) .
', '
.
108
$ilDB
->quote($this->
getObjectiveId
(),
'integer'
) .
', '
.
109
$ilDB
->quote($this->
getTestRefId
(),
'integer'
) .
' '
.
110
') '
;
111
$GLOBALS
[
'DIC'
][
'ilLog'
]->write($query);
112
$ilDB
->manipulate($query);
113
}
114
119
public
function
update
()
120
{
121
global
$DIC
;
122
123
$ilDB
= $DIC[
'ilDB'
];
124
125
$query
=
'UPDATE loc_tst_assignments '
.
126
'SET container_id = '
.
$ilDB
->quote($this->
getContainerId
(),
'integer'
) .
', '
.
127
'assignment_type = '
.
$ilDB
->quote($this->
getAssignmentType
(),
'integer'
) .
', '
.
128
'objective_id = '
.
$ilDB
->quote($this->
getObjectiveId
(),
'integer'
) .
', '
.
129
'tst_ref_id = '
.
$ilDB
->quote($this->
getTestRefId
(),
'integer'
) .
' '
.
130
'WHERE assignment_id = '
.
$ilDB
->quote($this->
getAssignmentId
(),
'integer'
);
131
$ilDB
->manipulate(
$query
);
132
}
133
139
public
function
delete
()
140
{
141
global
$DIC
;
142
143
$ilDB
= $DIC[
'ilDB'
];
144
145
$query
=
'DELETE FROM loc_tst_assignments '
.
146
'WHERE assignment_id = '
.
$ilDB
->quote($this->
getAssignmentId
(),
'integer'
) .
' '
;
147
$ilDB
->manipulate(
$query
);
148
return
true
;
149
}
150
156
public
function
read
()
157
{
158
global
$DIC
;
159
160
$ilDB
= $DIC[
'ilDB'
];
161
162
if
(!$this->
getAssignmentId
()) {
163
return
false
;
164
}
165
166
$query
=
'SELECT * FROM loc_tst_assignments '
.
167
'WHERE assignment_id = '
.
$ilDB
->quote($this->
getAssignmentId
(),
'integer'
) .
' '
;
168
$res
=
$ilDB
->query(
$query
);
169
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
170
$this->
setContainerId
(
$row
->container_id);
171
$this->
setObjectiveId
(
$row
->objective_id);
172
$this->
setAssignmentType
(
$row
->assignment_type);
173
$this->
setTestRefId
(
$row
->tst_ref_id);
174
}
175
return
true
;
176
}
177
183
public
function
cloneSettings
($a_copy_id, $a_target_id, $a_objective_id)
184
{
185
include_once
'./Services/CopyWizard/classes/class.ilCopyWizardOptions.php'
;
186
$options
=
ilCopyWizardOptions::_getInstance
($a_copy_id);
187
$mappings =
$options
->getMappings();
188
189
if
(!array_key_exists($this->
getTestRefId
(), $mappings)) {
190
return
false
;
191
}
192
193
$copy =
new
ilLOTestAssignment
();
194
$copy->setContainerId($a_target_id);
195
$copy->setAssignmentType($this->
getAssignmentType
());
196
$copy->setObjectiveId($a_objective_id);
197
$copy->setTestRefId($mappings[$this->
getTestRefId
()]);
198
$copy->create();
199
}
200
}
ilLOTestAssignment\$assignment_id
$assignment_id
Definition:
class.ilLOTestAssignment.php:12
ilLOTestAssignment\$assignment_type
$assignment_type
Definition:
class.ilLOTestAssignment.php:14
$DIC
global $DIC
Definition:
saml.php:7
ilLOTestAssignment\setAssignmentId
setAssignmentId($a_id)
Definition:
class.ilLOTestAssignment.php:29
PHPMailer\PHPMailer\$options
$options
Definition:
get_oauth_token.php:91
$a_type
$a_type
Definition:
workflow.php:92
ilLOTestAssignment\setObjectiveId
setObjectiveId($a_id)
Definition:
class.ilLOTestAssignment.php:59
ilCopyWizardOptions\_getInstance
static _getInstance($a_copy_id)
Get instance of copy wizard options.
Definition:
class.ilCopyWizardOptions.php:82
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilLOTestAssignment\read
read()
Read db entry type $ilDB.
Definition:
class.ilLOTestAssignment.php:156
ilLOTestAssignment\save
save()
save settings
Definition:
class.ilLOTestAssignment.php:83
ilLOTestAssignment\update
update()
Update assignment type $ilDB.
Definition:
class.ilLOTestAssignment.php:119
$query
$query
Definition:
proxy_ylocal.php:13
ilLOTestAssignment\setAssignmentType
setAssignmentType($a_type)
Definition:
class.ilLOTestAssignment.php:49
$row
$row
Definition:
migrateto20.php:360
ilLOTestAssignment\getObjectiveId
getObjectiveId()
Definition:
class.ilLOTestAssignment.php:64
ilLOTestAssignment\create
create()
Create new aassignment type $ilDB.
Definition:
class.ilLOTestAssignment.php:96
ilLOTestAssignment
Settings for LO courses.
Definition:
class.ilLOTestAssignment.php:10
ilLOTestAssignment\getAssignmentId
getAssignmentId()
Definition:
class.ilLOTestAssignment.php:34
ilLOTestAssignment\$objective_id
$objective_id
Definition:
class.ilLOTestAssignment.php:15
ilLOTestAssignment\setContainerId
setContainerId($a_id)
Definition:
class.ilLOTestAssignment.php:39
ilLOTestAssignment\getContainerId
getContainerId()
Definition:
class.ilLOTestAssignment.php:44
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilLOTestAssignment\$container_id
$container_id
Definition:
class.ilLOTestAssignment.php:13
ilLOTestAssignment\getTestRefId
getTestRefId()
Definition:
class.ilLOTestAssignment.php:74
php
ilLOTestAssignment\getAssignmentType
getAssignmentType()
Definition:
class.ilLOTestAssignment.php:54
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilLOTestAssignment\$test_ref_id
$test_ref_id
Definition:
class.ilLOTestAssignment.php:16
ilLOTestAssignment\__construct
__construct($a_id=0)
constructor
Definition:
class.ilLOTestAssignment.php:23
$GLOBALS
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Definition:
module.tag.xmp.php:702
ilLOTestAssignment\setTestRefId
setTestRefId($a_id)
Definition:
class.ilLOTestAssignment.php:69
ilLOTestAssignment\cloneSettings
cloneSettings($a_copy_id, $a_target_id, $a_objective_id)
Clone assignments.
Definition:
class.ilLOTestAssignment.php:183
Modules
Course
classes
Objectives
class.ilLOTestAssignment.php
Generated on Sun Mar 2 2025 19:01:40 for ILIAS by
1.8.13 (using
Doxyfile
)