19 declare(strict_types=1);
34 $this->sourcePoolDefinitionList
36 $quantitiesDistribution->initialise();
39 foreach ($this->sourcePoolDefinitionList as $definition) {
40 $quantityCalculation = $quantitiesDistribution->calculateQuantities($definition);
41 if ($quantityCalculation->isRequiredAmountGuaranteedAvailable()) {
44 $is_buildable =
false;
45 $this->checkMessages[] = $quantityCalculation->getDistributionReport($this->
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)) {
69 if (!isset($translator)) {
71 $translator->loadLabels($this->sourcePoolDefinitionList);
73 $this->
logger->info(
"RANDOM TEST: missing questions for: " 74 . implode(
" - ", [$definition->getPoolTitle(), $translator->getTaxonomyFilterLabel($definition->getMappedTaxonomyFilter())]));
77 $questions = $actualQuestionStage;
80 $questionSet->mergeQuestionCollection($questions);
83 $requiredQuestionAmount = $this->sourcePoolDefinitionList->getQuestionAmount();
85 if ($questionSet->isSmallerThan($requiredQuestionAmount)) {
86 $missingQuestionCount = $questionSet->getMissingCount($requiredQuestionAmount);
89 $actualQuestionStage = $potentialQuestionStage->getRelativeComplementCollection($questionSet);
92 $questionSet->mergeQuestionCollection($questions);
getSrcPoolDefListRelatedQuestUniqueCollection(ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList)
handleQuestionOrdering(ilTestRandomQuestionSetQuestionCollection $questionSet)
getSrcPoolDefRelatedQuestCollection(ilTestRandomQuestionSetSourcePoolDefinition $definition)
fetchQuestionsFromStageRandomly(ilTestRandomQuestionSetQuestionCollection $questionStage, $requiredQuestionAmount)
performBuild(ilTestSession $testSession)
storeQuestionSet(ilTestSession $testSession, $questionSet)