ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups 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

ilAssIncompleteQuestionPurger::__construct ( ilDB  $db)

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

References $db.

{
$this->db = $db;
}

Member Function Documentation

ilAssIncompleteQuestionPurger::getOwnerId ( )

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

References $ownerId.

Referenced by getPurgableQuestionIds().

{
}

+ Here is the caller graph for this function:

ilAssIncompleteQuestionPurger::getPurgableQuestionIds ( )
private

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

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

Referenced by purge().

{
$query = "SELECT question_id FROM qpl_questions WHERE owner = %s AND tstamp = %s";
$res = $this->db->queryF($query, array('integer', 'integer'), array($this->getOwnerId(), 0));
$questionIds = array();
while( $row = $this->db->fetchAssoc($res) )
{
$questionIds[] = $row['question_id'];
}
return $questionIds;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAssIncompleteQuestionPurger::purge ( )

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

References getPurgableQuestionIds(), and purgeQuestionIds().

{
$questionIds = $this->getPurgableQuestionIds();
$this->purgeQuestionIds($questionIds);
}

+ Here is the call graph for this function:

ilAssIncompleteQuestionPurger::purgeQuestionIds (   $questionIds)
private

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

References assQuestion\_instantiateQuestion().

Referenced by purge().

{
require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
foreach($questionIds as $questionId)
{
$question = assQuestion::_instantiateQuestion($questionId);
$question->delete($questionId);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAssIncompleteQuestionPurger::setOwnerId (   $ownerId)

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

References $ownerId.

{
$this->ownerId = $ownerId;
}

Field Documentation

ilAssIncompleteQuestionPurger::$db
protected

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

Referenced by __construct().

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: