4 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetBuilder.php';
18 public function checkBuildableNewer()
25 require_once
'Modules/Test/classes/class.ilTestRandomQuestionsQuantitiesDistribution.php';
27 $quantitiesDistribution->setSourcePoolDefinitionList($this->sourcePoolDefinitionList);
28 $quantitiesDistribution->initialise();
34 foreach ($this->sourcePoolDefinitionList as $definition) {
37 $quantityCalculation = $quantitiesDistribution->calculateQuantities($definition);
39 if ($quantityCalculation->isRequiredAmountGuaranteedAvailable()) {
45 $this->checkMessages[] = $quantityCalculation->getDistributionReport(
$lng);
58 return $this->checkBuildableNewer();
63 if ($questionStage->isSmallerThan($this->sourcePoolDefinitionList->getQuestionAmount())) {
74 foreach ($this->sourcePoolDefinitionList as $definition) {
77 $requiredQuestionAmount = $definition->getQuestionAmount();
81 $actualQuestionStage = $potentialQuestionStage->getRelativeComplementCollection($questionSet);
83 if ($actualQuestionStage->isGreaterThan($requiredQuestionAmount)) {
87 if ($actualQuestionStage->isSmallerThan($requiredQuestionAmount)) {
92 require_once(
"./Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php");
94 $translator->loadLabels($this->sourcePoolDefinitionList);
96 $ilLog->write(
"RANDOM TEST: missing questions for: " 97 . implode(
" - ", array($definition->getPoolTitle(),
$translator->getTaxonomyFilterLabel($definition->getMappedTaxonomyFilter()))));
100 $questions = $actualQuestionStage;
103 $questionSet->mergeQuestionCollection($questions);
106 $requiredQuestionAmount = $this->sourcePoolDefinitionList->getQuestionAmount();
108 if ($questionSet->isSmallerThan($requiredQuestionAmount)) {
109 $missingQuestionCount = $questionSet->getMissingCount($requiredQuestionAmount);
112 $actualQuestionStage = $potentialQuestionStage->getRelativeComplementCollection($questionSet);
115 $questionSet->mergeQuestionCollection($questions);
getSrcPoolDefListRelatedQuestUniqueCollection(ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList)
handleQuestionOrdering(ilTestRandomQuestionSetQuestionCollection $questionSet)
getSrcPoolDefRelatedQuestCollection(ilTestRandomQuestionSetSourcePoolDefinition $definition)
fetchQuestionsFromStageRandomly(ilTestRandomQuestionSetQuestionCollection $questionStage, $requiredQuestionAmount)
performBuild(ilTestSession $testSession)
storeQuestionSet(ilTestSession $testSession, $questionSet)