ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilAssIncompleteQuestionPurger Class Reference
+ Collaboration diagram for ilAssIncompleteQuestionPurger:

Public Member Functions

 __construct (ilDB $db)
 
 getOwnerId ()
 
 setOwnerId ($ownerId)
 
 purge ()
 

Protected Member Functions

 setIgnoredContainerObjectTypes ($ignoredContainerObjectTypes)
 
 getIgnoredContainerObjectTypes ()
 

Protected Attributes

 $db
 
 $ownerId
 

Private Member Functions

 getPurgableQuestionIds ()
 
 purgeQuestionIds ($questionIds)
 

Private Attributes

 $ignoredContainerObjectTypes
 

Detailed Description

Definition at line 11 of file class.ilAssIncompleteQuestionPurger.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssIncompleteQuestionPurger::__construct ( ilDB  $db)

Definition at line 22 of file class.ilAssIncompleteQuestionPurger.php.

23 {
24 $this->db = $db;
25
26 $this->ignoredContainerObjectTypes = array('lm');
27 }

References $db.

Member Function Documentation

◆ getIgnoredContainerObjectTypes()

ilAssIncompleteQuestionPurger::getIgnoredContainerObjectTypes ( )
protected

Definition at line 87 of file class.ilAssIncompleteQuestionPurger.php.

References $ignoredContainerObjectTypes.

Referenced by getPurgableQuestionIds().

+ Here is the caller graph for this function:

◆ getOwnerId()

ilAssIncompleteQuestionPurger::getOwnerId ( )

Definition at line 29 of file class.ilAssIncompleteQuestionPurger.php.

References $ownerId.

Referenced by getPurgableQuestionIds().

+ Here is the caller graph for this function:

◆ getPurgableQuestionIds()

ilAssIncompleteQuestionPurger::getPurgableQuestionIds ( )
private

Definition at line 45 of file class.ilAssIncompleteQuestionPurger.php.

46 {
47 $INtypes = $this->db->in('object_data.type', $this->getIgnoredContainerObjectTypes(), true, 'text');
48
49 $query = "
50 SELECT qpl_questions.question_id
51 FROM qpl_questions
52 INNER JOIN object_data
53 ON object_data.obj_id = qpl_questions.obj_fi
54 AND $INtypes
55 WHERE qpl_questions.owner = %s
56 AND qpl_questions.tstamp = %s
57 ";
58
59 $res = $this->db->queryF($query, array('integer', 'integer'), array($this->getOwnerId(), 0));
60
61 $questionIds = array();
62
63 while( $row = $this->db->fetchAssoc($res) )
64 {
65 $questionIds[] = $row['question_id'];
66 }
67
68 return $questionIds;
69 }

References $query, $res, $row, getIgnoredContainerObjectTypes(), and getOwnerId().

Referenced by purge().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ purge()

ilAssIncompleteQuestionPurger::purge ( )

Definition at line 39 of file class.ilAssIncompleteQuestionPurger.php.

References getPurgableQuestionIds(), and purgeQuestionIds().

+ Here is the call graph for this function:

◆ purgeQuestionIds()

ilAssIncompleteQuestionPurger::purgeQuestionIds (   $questionIds)
private

Definition at line 71 of file class.ilAssIncompleteQuestionPurger.php.

72 {
73 require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
74
75 foreach($questionIds as $questionId)
76 {
77 $question = assQuestion::_instantiateQuestion($questionId);
78 $question->delete($questionId);
79 }
80 }
static _instantiateQuestion($question_id)

References assQuestion\_instantiateQuestion().

Referenced by purge().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setIgnoredContainerObjectTypes()

ilAssIncompleteQuestionPurger::setIgnoredContainerObjectTypes (   $ignoredContainerObjectTypes)
protected

Definition at line 82 of file class.ilAssIncompleteQuestionPurger.php.

83 {
84 $this->ignoredContainerObjectTypes = $ignoredContainerObjectTypes;
85 }

References $ignoredContainerObjectTypes.

◆ setOwnerId()

ilAssIncompleteQuestionPurger::setOwnerId (   $ownerId)

Definition at line 34 of file class.ilAssIncompleteQuestionPurger.php.

35 {
36 $this->ownerId = $ownerId;
37 }

References $ownerId.

Field Documentation

◆ $db

ilAssIncompleteQuestionPurger::$db
protected

Definition at line 16 of file class.ilAssIncompleteQuestionPurger.php.

Referenced by __construct().

◆ $ignoredContainerObjectTypes

ilAssIncompleteQuestionPurger::$ignoredContainerObjectTypes
private

◆ $ownerId

ilAssIncompleteQuestionPurger::$ownerId
protected

Definition at line 18 of file class.ilAssIncompleteQuestionPurger.php.

Referenced by getOwnerId(), and setOwnerId().


The documentation for this class was generated from the following file: