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

Public Member Functions

 checkBuildable ()
 performBuild (ilTestSession $testSession)

Private Member Functions

 isQuestionSetFetchable ($questionStage)

Additional Inherited Members

- Static Public Member Functions inherited from ilTestRandomQuestionSetBuilder
static getInstance (ilDB $db, ilObjTest $testOBJ, ilTestRandomQuestionSetConfig $questionSetConfig, ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList, ilTestRandomQuestionSetStagingPoolQuestionList $stagingPoolQuestionList)
- Protected Member Functions inherited from ilTestRandomQuestionSetBuilder
 __construct (ilDB $db, ilObjTest $testOBJ, ilTestRandomQuestionSetConfig $questionSetConfig, ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList, ilTestRandomQuestionSetStagingPoolQuestionList $stagingPoolQuestionList)
 getQuestionStageForSourcePoolDefinition (ilTestRandomQuestionSetSourcePoolDefinition $definition)
 storeQuestionSet (ilTestSession $testSession, $questionSet)
 fetchQuestionsFromStageRandomly ($questionStage, $requiredQuestionAmount)
 handleQuestionOrdering ($questionSet)
- Protected Attributes inherited from ilTestRandomQuestionSetBuilder
 $db = null
 $testOBJ = null
 $questionSetConfig = null
 $sourcePoolDefinitionList = null
 $stagingPoolQuestionList = null

Detailed Description

Member Function Documentation

ilTestRandomQuestionSetBuilderWithAmountPerTest::checkBuildable ( )

Reimplemented from ilTestRandomQuestionSetBuilder.

Definition at line 14 of file class.ilTestRandomQuestionSetBuilderWithAmountPerTest.php.

References isQuestionSetFetchable().

{
$questionStage = $this->getQuestionStageForSourcePoolDefinitionList($this->sourcePoolDefinitionList);
return $this->isQuestionSetFetchable($questionStage);
}

+ Here is the call graph for this function:

ilTestRandomQuestionSetBuilderWithAmountPerTest::isQuestionSetFetchable (   $questionStage)
private

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

Referenced by checkBuildable().

{
$requiredAmount = $this->questionSetConfig->getQuestionAmountPerTest();
$possibleAmount = count($questionStage);
return ( $possibleAmount >= $requiredAmount );
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetBuilderWithAmountPerTest::performBuild ( ilTestSession  $testSession)

Reimplemented from ilTestRandomQuestionSetBuilder.

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

References ilTestRandomQuestionSetBuilder\fetchQuestionsFromStageRandomly(), ilTestRandomQuestionSetBuilder\handleQuestionOrdering(), and ilTestRandomQuestionSetBuilder\storeQuestionSet().

{
$questionStage = $this->getQuestionStageForSourcePoolDefinitionList($this->sourcePoolDefinitionList);
$questionSet = $this->fetchQuestionsFromStageRandomly(
$questionStage, $this->questionSetConfig->getQuestionAmountPerTest()
);
$questionSet = $this->handleQuestionOrdering($questionSet);
$this->storeQuestionSet($testSession, $questionSet);
}

+ Here is the call graph for this function:


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