ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestPassesSelector Class Reference
+ Collaboration diagram for ilTestPassesSelector:

Public Member Functions

 __construct (ilDB $db, ilObjTest $testOBJ)
 getActiveId ()
 setActiveId ($activeId)
 getLastFinishedPass ()
 setLastFinishedPass ($lastFinishedPass)
 getExistingPasses ()
 getNumExistingPasses ()
 getClosedPasses ()
 getReportablePasses ()

Protected Attributes

 $db
 $testOBJ

Private Member Functions

 loadExistingPasses ()
 fetchReportablePasses ($existingPasses)
 fetchClosedPasses ($existingPasses)
 fetchLastPass ($existingPasses)
 isReportablePass ($lastPass, $pass)
 isClosedPass ($pass)
 isProcessingTimeReached ($pass)

Private Attributes

 $activeId
 $lastFinishedPass

Detailed Description

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

Constructor & Destructor Documentation

ilTestPassesSelector::__construct ( ilDB  $db,
ilObjTest  $testOBJ 
)

Definition at line 21 of file class.ilTestPassesSelector.php.

References $db, and $testOBJ.

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

Member Function Documentation

ilTestPassesSelector::fetchClosedPasses (   $existingPasses)
private

Definition at line 114 of file class.ilTestPassesSelector.php.

References $pass, and isClosedPass().

Referenced by getClosedPasses().

{
$closedPasses = array();
foreach($existingPasses as $pass)
{
if( $this->isClosedPass($pass) )
{
$closedPasses[] = $pass;
}
}
return $closedPasses;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestPassesSelector::fetchLastPass (   $existingPasses)
private

Definition at line 129 of file class.ilTestPassesSelector.php.

References $pass.

Referenced by fetchReportablePasses().

{
$lastPass = null;
foreach($existingPasses as $pass)
{
if( $lastPass === null || $pass > $lastPass )
{
$lastPass = $pass;
}
}
return $lastPass;
}

+ Here is the caller graph for this function:

ilTestPassesSelector::fetchReportablePasses (   $existingPasses)
private

Definition at line 97 of file class.ilTestPassesSelector.php.

References $pass, fetchLastPass(), and isReportablePass().

Referenced by getReportablePasses().

{
$lastPass = $this->fetchLastPass($existingPasses);
$reportablePasses = array();
foreach($existingPasses as $pass)
{
if( $this->isReportablePass($lastPass, $pass) )
{
$reportablePasses[] = $pass;
}
}
return $reportablePasses;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestPassesSelector::getActiveId ( )

Definition at line 27 of file class.ilTestPassesSelector.php.

References $activeId.

Referenced by isProcessingTimeReached(), and loadExistingPasses().

{
}

+ Here is the caller graph for this function:

ilTestPassesSelector::getClosedPasses ( )

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

References fetchClosedPasses(), and loadExistingPasses().

{
$existingPasses = $this->loadExistingPasses();
$closedPasses = $this->fetchClosedPasses($existingPasses);
return $closedPasses;
}

+ Here is the call graph for this function:

ilTestPassesSelector::getExistingPasses ( )

Definition at line 47 of file class.ilTestPassesSelector.php.

References loadExistingPasses().

{
return $this->loadExistingPasses();
}

+ Here is the call graph for this function:

ilTestPassesSelector::getLastFinishedPass ( )

Definition at line 37 of file class.ilTestPassesSelector.php.

References $lastFinishedPass.

Referenced by isClosedPass().

+ Here is the caller graph for this function:

ilTestPassesSelector::getNumExistingPasses ( )

Definition at line 52 of file class.ilTestPassesSelector.php.

References loadExistingPasses().

{
return count($this->loadExistingPasses());
}

+ Here is the call graph for this function:

ilTestPassesSelector::getReportablePasses ( )

Definition at line 65 of file class.ilTestPassesSelector.php.

References fetchReportablePasses(), and loadExistingPasses().

{
$existingPasses = $this->loadExistingPasses();
$reportablePasses = $this->fetchReportablePasses($existingPasses);
return $reportablePasses;
}

+ Here is the call graph for this function:

ilTestPassesSelector::isClosedPass (   $pass)
private

Definition at line 159 of file class.ilTestPassesSelector.php.

References $pass, getLastFinishedPass(), and isProcessingTimeReached().

Referenced by fetchClosedPasses(), and isReportablePass().

{
if( $pass <= $this->getLastFinishedPass() )
{
return true;
}
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestPassesSelector::isProcessingTimeReached (   $pass)
private

Definition at line 174 of file class.ilTestPassesSelector.php.

References $pass, and getActiveId().

Referenced by isClosedPass().

{
if( !$this->testOBJ->getEnableProcessingTime() )
{
return false;
}
$startingTime = $this->testOBJ->getStartingTimeOfUser($this->getActiveId(), $pass);
if($startingTime === FALSE)
{
return false;
}
return $this->testOBJ->isMaxProcessingTimeReached($startingTime, $this->getActiveId());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestPassesSelector::isReportablePass (   $lastPass,
  $pass 
)
private

Definition at line 144 of file class.ilTestPassesSelector.php.

References $pass, and isClosedPass().

Referenced by fetchReportablePasses().

{
if($pass < $lastPass)
{
return true;
}
if( $this->isClosedPass($pass) )
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestPassesSelector::loadExistingPasses ( )
private

Definition at line 73 of file class.ilTestPassesSelector.php.

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

Referenced by getClosedPasses(), getExistingPasses(), getNumExistingPasses(), and getReportablePasses().

{
$query = "
SELECT DISTINCT tst_pass_result.pass FROM tst_pass_result
INNER JOIN tst_test_result
ON tst_pass_result.pass = tst_test_result.pass
AND tst_pass_result.active_fi = tst_test_result.active_fi
WHERE tst_pass_result.active_fi = %s
";
$res = $this->db->queryF(
$query, array('integer'), array($this->getActiveId())
);
$existingPasses = array();
while( $row = $this->db->fetchAssoc($res) )
{
$existingPasses[] = $row['pass'];
}
return $existingPasses;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestPassesSelector::setActiveId (   $activeId)

Definition at line 32 of file class.ilTestPassesSelector.php.

References $activeId.

{
$this->activeId = $activeId;
}
ilTestPassesSelector::setLastFinishedPass (   $lastFinishedPass)

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

References $lastFinishedPass.

{
$this->lastFinishedPass = $lastFinishedPass;
}

Field Documentation

ilTestPassesSelector::$activeId
private

Definition at line 17 of file class.ilTestPassesSelector.php.

Referenced by getActiveId(), and setActiveId().

ilTestPassesSelector::$db
protected

Definition at line 13 of file class.ilTestPassesSelector.php.

Referenced by __construct().

ilTestPassesSelector::$lastFinishedPass
private

Definition at line 19 of file class.ilTestPassesSelector.php.

Referenced by getLastFinishedPass(), and setLastFinishedPass().

ilTestPassesSelector::$testOBJ
protected

Definition at line 15 of file class.ilTestPassesSelector.php.

Referenced by __construct().


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