32 require_once
'Modules/Test/classes/class.ilTestRandomQuestionsQuantitiesDistribution.php';
34 $quantitiesDistribution->setSourcePoolDefinitionList($this->sourcePoolDefinitionList);
35 $quantitiesDistribution->initialise();
38 foreach ($this->sourcePoolDefinitionList as $definition) {
39 $quantityCalculation = $quantitiesDistribution->calculateQuantities($definition);
40 if ($quantityCalculation->isRequiredAmountGuaranteedAvailable()) {
45 $this->checkMessages[] = $quantityCalculation->getDistributionReport(
$lng);
55 foreach ($this->sourcePoolDefinitionList as $definition) {
58 $requiredQuestionAmount = $definition->getQuestionAmount();
62 $actualQuestionStage = $potentialQuestionStage->getRelativeComplementCollection($questionSet);
64 if ($actualQuestionStage->isGreaterThan($requiredQuestionAmount)) {
68 if ($actualQuestionStage->isSmallerThan($requiredQuestionAmount)) {
71 $ilLog = $DIC[
'ilLog'];
72 if (!isset($translator)) {
73 require_once(
"./Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php");
75 $translator->loadLabels($this->sourcePoolDefinitionList);
77 $ilLog->write(
"RANDOM TEST: missing questions for: " 78 . implode(
" - ", array($definition->getPoolTitle(), $translator->getTaxonomyFilterLabel($definition->getMappedTaxonomyFilter()))));
81 $questions = $actualQuestionStage;
84 $questionSet->mergeQuestionCollection($questions);
87 $requiredQuestionAmount = $this->sourcePoolDefinitionList->getQuestionAmount();
89 if ($questionSet->isSmallerThan($requiredQuestionAmount)) {
90 $missingQuestionCount = $questionSet->getMissingCount($requiredQuestionAmount);
93 $actualQuestionStage = $potentialQuestionStage->getRelativeComplementCollection($questionSet);
96 $questionSet->mergeQuestionCollection($questions);
getSrcPoolDefListRelatedQuestUniqueCollection(ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList)
handleQuestionOrdering(ilTestRandomQuestionSetQuestionCollection $questionSet)
getSrcPoolDefRelatedQuestCollection(ilTestRandomQuestionSetSourcePoolDefinition $definition)
fetchQuestionsFromStageRandomly(ilTestRandomQuestionSetQuestionCollection $questionStage, $requiredQuestionAmount)
performBuild(ilTestSession $testSession)
storeQuestionSet(ilTestSession $testSession, $questionSet)