ILIAS
release_4-4 Revision
◀ 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
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
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.ilAssIncompleteQuestionPurger.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
ilAssIncompleteQuestionPurger
12
{
16
protected
$db
;
17
18
protected
$ownerId
;
19
20
public
function
__construct
(
ilDB
$db
)
21
{
22
$this->db =
$db
;
23
}
24
25
public
function
getOwnerId
()
26
{
27
return
$this->ownerId
;
28
}
29
30
public
function
setOwnerId
(
$ownerId
)
31
{
32
$this->ownerId =
$ownerId
;
33
}
34
35
public
function
purge
()
36
{
37
$questionIds = $this->
getPurgableQuestionIds
();
38
$this->
purgeQuestionIds
($questionIds);
39
}
40
41
private
function
getPurgableQuestionIds
()
42
{
43
$query
=
"SELECT question_id FROM qpl_questions WHERE owner = %s AND tstamp = %s"
;
44
45
$res
= $this->db->queryF(
$query
, array(
'integer'
,
'integer'
), array($this->
getOwnerId
(), 0));
46
47
$questionIds = array();
48
49
while
(
$row
= $this->db->fetchAssoc(
$res
) )
50
{
51
$questionIds[] =
$row
[
'question_id'
];
52
}
53
54
return
$questionIds;
55
}
56
57
private
function
purgeQuestionIds
($questionIds)
58
{
59
require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php'
;
60
61
foreach
($questionIds as $questionId)
62
{
63
$question =
assQuestion::_instantiateQuestion
($questionId);
64
$question->delete($questionId);
65
}
66
}
67
}
ilAssIncompleteQuestionPurger\$ownerId
$ownerId
Definition:
class.ilAssIncompleteQuestionPurger.php:18
$res
$res
Definition:
examplelayouts.sql.php:25
ilAssIncompleteQuestionPurger\getOwnerId
getOwnerId()
Definition:
class.ilAssIncompleteQuestionPurger.php:25
ilAssIncompleteQuestionPurger\__construct
__construct(ilDB $db)
Definition:
class.ilAssIncompleteQuestionPurger.php:20
$query
$query
Definition:
examplelayouts.sql.php:24
ilAssIncompleteQuestionPurger\purgeQuestionIds
purgeQuestionIds($questionIds)
Definition:
class.ilAssIncompleteQuestionPurger.php:57
ilAssIncompleteQuestionPurger\purge
purge()
Definition:
class.ilAssIncompleteQuestionPurger.php:35
$row
$row
Definition:
examplelayouts.sql.php:26
ilAssIncompleteQuestionPurger\$db
$db
Definition:
class.ilAssIncompleteQuestionPurger.php:16
ilAssIncompleteQuestionPurger\setOwnerId
setOwnerId($ownerId)
Definition:
class.ilAssIncompleteQuestionPurger.php:30
assQuestion\_instantiateQuestion
static _instantiateQuestion($question_id)
Definition:
class.assQuestion.php:2862
ilDB
Database Wrapper.
Definition:
class.ilDB.php:28
ilAssIncompleteQuestionPurger
Definition:
class.ilAssIncompleteQuestionPurger.php:11
ilAssIncompleteQuestionPurger\getPurgableQuestionIds
getPurgableQuestionIds()
Definition:
class.ilAssIncompleteQuestionPurger.php:41
Modules
TestQuestionPool
classes
class.ilAssIncompleteQuestionPurger.php
Generated on Mon Dec 21 2020 19:01:07 for ILIAS by
1.8.13 (using
Doxyfile
)