ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAssIncompleteQuestionPurger Class Reference
+ Collaboration diagram for ilAssIncompleteQuestionPurger:

Public Member Functions

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

Protected Attributes

 $db
 
 $ownerId
 

Private Member Functions

 getPurgableQuestionIds ()
 
 purgeQuestionIds ($questionIds)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilAssIncompleteQuestionPurger::__construct ( ilDB  $db)

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

References $db.

Member Function Documentation

◆ getOwnerId()

ilAssIncompleteQuestionPurger::getOwnerId ( )

Definition at line 25 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 41 of file class.ilAssIncompleteQuestionPurger.php.

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

Referenced by purge().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ purge()

ilAssIncompleteQuestionPurger::purge ( )

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

References getPurgableQuestionIds(), and purgeQuestionIds().

36  {
37  $questionIds = $this->getPurgableQuestionIds();
38  $this->purgeQuestionIds($questionIds);
39  }
+ Here is the call graph for this function:

◆ purgeQuestionIds()

ilAssIncompleteQuestionPurger::purgeQuestionIds (   $questionIds)
private

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

References assQuestion\_instantiateQuestion().

Referenced by purge().

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  }
static _instantiateQuestion($question_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setOwnerId()

ilAssIncompleteQuestionPurger::setOwnerId (   $ownerId)

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

References $ownerId.

31  {
32  $this->ownerId = $ownerId;
33  }

Field Documentation

◆ $db

ilAssIncompleteQuestionPurger::$db
protected

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

Referenced by __construct().

◆ $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: