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

Public Member Functions

 checkBuildable ()
- Public Member Functions inherited from ilTestRandomQuestionSetBuilder
 performBuild (ilTestSession $testSession)

Private Member Functions

 isQuestionSetFetchable (ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList, $questionStage)
 getUniqueQuestionCollectionFromPotentialQuestionCollection ($potentialQuestionCollection, $otherQuestionCollection)
 questionCollectionGreaterThanRequiredAmount ($questionCollection, $requiredAmount)
 questionCollectionSmallerThanRequiredAmount ($questionCollection, $requiredAmount)
 mergeQuestionCollections ($questionSet, $questions)
 getMissingQuestionCount ($questionSet, $requiredQuestionAmount)

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

ilTestRandomQuestionSetBuilderWithAmountPerPool::checkBuildable ( )

Reimplemented from ilTestRandomQuestionSetBuilder.

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

References isQuestionSetFetchable().

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

+ Here is the call graph for this function:

ilTestRandomQuestionSetBuilderWithAmountPerPool::getMissingQuestionCount (   $questionSet,
  $requiredQuestionAmount 
)
private

Definition at line 93 of file class.ilTestRandomQuestionSetBuilderWithAmountPerPool.php.

{
return ( $requiredQuestionAmount - count($questionSet) );
}
ilTestRandomQuestionSetBuilderWithAmountPerPool::getUniqueQuestionCollectionFromPotentialQuestionCollection (   $potentialQuestionCollection,
  $otherQuestionCollection 
)
private

Definition at line 72 of file class.ilTestRandomQuestionSetBuilderWithAmountPerPool.php.

{
$uniqueQuestionCollection = array_diff($potentialQuestionCollection, $otherQuestionCollection);
return $uniqueQuestionCollection;
}
ilTestRandomQuestionSetBuilderWithAmountPerPool::isQuestionSetFetchable ( ilTestRandomQuestionSetSourcePoolDefinitionList  $sourcePoolDefinitionList,
  $questionStage 
)
private

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

Referenced by checkBuildable().

{
$requiredAmount = $this->getRequiredQuestionAmountForDefinitionList($sourcePoolDefinitionList);
$possibleAmount = count($questionStage);
return ( $possibleAmount >= $requiredAmount );
}

+ Here is the caller graph for this function:

ilTestRandomQuestionSetBuilderWithAmountPerPool::mergeQuestionCollections (   $questionSet,
  $questions 
)
private

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

{
return array_merge($questionSet, $questions);
}
ilTestRandomQuestionSetBuilderWithAmountPerPool::questionCollectionGreaterThanRequiredAmount (   $questionCollection,
  $requiredAmount 
)
private

Definition at line 78 of file class.ilTestRandomQuestionSetBuilderWithAmountPerPool.php.

{
return count($questionCollection) > $requiredAmount;
}
ilTestRandomQuestionSetBuilderWithAmountPerPool::questionCollectionSmallerThanRequiredAmount (   $questionCollection,
  $requiredAmount 
)
private

Definition at line 83 of file class.ilTestRandomQuestionSetBuilderWithAmountPerPool.php.

{
return count($questionCollection) < $requiredAmount;
}

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