ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestRandomQuestionSetSourcePoolDefinitionList Class Reference
+ Inheritance diagram for ilTestRandomQuestionSetSourcePoolDefinitionList:
+ Collaboration diagram for ilTestRandomQuestionSetSourcePoolDefinitionList:

Public Member Functions

 __construct (ilDB $db, ilObjTest $testOBJ, ilTestRandomQuestionSetSourcePoolDefinitionFactory $sourcePoolDefinitionFactory)
 Constructor.
 addDefinition (ilTestRandomQuestionSetSourcePoolDefinition $sourcePoolDefinition)
 loadDefinitions ()
 deleteDefinitions ()
 getNextPosition ()
 savedDefinitionsExist ()
 rewind ()
 current ()
 key ()
 next ()
 valid ()

Protected Attributes

 $db = null
 $testOBJ = null

Private Attributes

 $sourcePoolDefinitions = array()
 $sourcePoolDefinitionFactory = null

Detailed Description

Constructor & Destructor Documentation

ilTestRandomQuestionSetSourcePoolDefinitionList::__construct ( ilDB  $db,
ilObjTest  $testOBJ,
ilTestRandomQuestionSetSourcePoolDefinitionFactory  $sourcePoolDefinitionFactory 
)

Constructor.

Parameters
ilDB$db
ilObjTest$testOBJ

Definition at line 42 of file class.ilTestRandomQuestionSetSourcePoolDefinitionList.php.

References $db, $sourcePoolDefinitionFactory, and $testOBJ.

{
$this->db = $db;
$this->testOBJ = $testOBJ;
$this->sourcePoolDefinitionFactory = $sourcePoolDefinitionFactory;
}

Member Function Documentation

ilTestRandomQuestionSetSourcePoolDefinitionList::addDefinition ( ilTestRandomQuestionSetSourcePoolDefinition  $sourcePoolDefinition)

Definition at line 49 of file class.ilTestRandomQuestionSetSourcePoolDefinitionList.php.

References ilTestRandomQuestionSetSourcePoolDefinition\getId().

Referenced by loadDefinitions().

{
$this->sourcePoolDefinitions[ $sourcePoolDefinition->getId() ] = $sourcePoolDefinition;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestRandomQuestionSetSourcePoolDefinitionList::current ( )
Returns
ilTestRandomQuestionSetSourcePoolDefinition

Definition at line 188 of file class.ilTestRandomQuestionSetSourcePoolDefinitionList.php.

{
return current($this->sourcePoolDefinitions);
}
ilTestRandomQuestionSetSourcePoolDefinitionList::deleteDefinitions ( )

Definition at line 88 of file class.ilTestRandomQuestionSetSourcePoolDefinitionList.php.

References $query.

{
$query = "DELETE FROM tst_rnd_quest_set_qpls WHERE test_fi = %s";
$this->db->manipulateF($query, array('integer'), array($this->testOBJ->getTestId()));
}
ilTestRandomQuestionSetSourcePoolDefinitionList::getNextPosition ( )

Definition at line 119 of file class.ilTestRandomQuestionSetSourcePoolDefinitionList.php.

{
return ( count($this->sourcePoolDefinitions) + 1 );
}
ilTestRandomQuestionSetSourcePoolDefinitionList::key ( )
Returns
integer

Definition at line 196 of file class.ilTestRandomQuestionSetSourcePoolDefinitionList.php.

Referenced by valid().

{
return key($this->sourcePoolDefinitions);
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetSourcePoolDefinitionList::loadDefinitions ( )

Definition at line 54 of file class.ilTestRandomQuestionSetSourcePoolDefinitionList.php.

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

{
$query = "SELECT * FROM tst_rnd_quest_set_qpls WHERE test_fi = %s ORDER BY sequence_pos ASC";
$res = $this->db->queryF($query, array('integer'), array($this->testOBJ->getTestId()));
while( $row = $this->db->fetchAssoc($res) )
{
$sourcePoolDefinition = $this->sourcePoolDefinitionFactory->getEmptySourcePoolDefinition();
$sourcePoolDefinition->initFromArray($row);
$this->addDefinition($sourcePoolDefinition);
}
}

+ Here is the call graph for this function:

ilTestRandomQuestionSetSourcePoolDefinitionList::next ( )
Returns
ilTestRandomQuestionSetSourcePoolDefinition

Definition at line 204 of file class.ilTestRandomQuestionSetSourcePoolDefinitionList.php.

{
return next($this->sourcePoolDefinitions);
}
ilTestRandomQuestionSetSourcePoolDefinitionList::rewind ( )
Returns
ilTestRandomQuestionSetSourcePoolDefinition

Definition at line 180 of file class.ilTestRandomQuestionSetSourcePoolDefinitionList.php.

{
return reset($this->sourcePoolDefinitions);
}
ilTestRandomQuestionSetSourcePoolDefinitionList::savedDefinitionsExist ( )
Returns
bool

Definition at line 153 of file class.ilTestRandomQuestionSetSourcePoolDefinitionList.php.

References $query, $res, and $row.

{
$query = "SELECT COUNT(*) cnt FROM tst_rnd_quest_set_qpls WHERE test_fi = %s";
$res = $this->db->queryF($query, array('integer'), array($this->testOBJ->getTestId()));
$row = $this->db->fetchAssoc($res);
return $row['cnt'] > 0;
}
ilTestRandomQuestionSetSourcePoolDefinitionList::valid ( )
Returns
boolean

Definition at line 212 of file class.ilTestRandomQuestionSetSourcePoolDefinitionList.php.

References key().

{
return key($this->sourcePoolDefinitions) !== null;
}

+ Here is the call graph for this function:

Field Documentation

ilTestRandomQuestionSetSourcePoolDefinitionList::$db = null
protected
ilTestRandomQuestionSetSourcePoolDefinitionList::$sourcePoolDefinitionFactory = null
private
ilTestRandomQuestionSetSourcePoolDefinitionList::$sourcePoolDefinitions = array()
private
ilTestRandomQuestionSetSourcePoolDefinitionList::$testOBJ = null
protected

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