4 require_once
'Modules/Test/classes/class.ilObjTest.php';
5 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
6 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
7 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetQuestionCollection.php';
8 require_once
'Modules/Test/classes/class.ilTestRandomQuestionCollectionSubsetApplicationList.php';
9 require_once
'Modules/Test/classes/class.ilTestRandomQuestionsSrcPoolDefinitionQuantitiesCalculation.php';
50 if ($questionCollectionProvider !== null) {
96 $nonRequiredDb = $DIC[
'ilDB'];
132 $this->questRelatedSrcPoolDefRegister = array();
141 if (!$this->questRelatedSrcPoolDefRegister[$questionId]) {
145 $this->questRelatedSrcPoolDefRegister[$questionId]->addDefinition($definition);
154 if (isset($this->questRelatedSrcPoolDefRegister[$questionId])) {
155 return $this->questRelatedSrcPoolDefRegister[$questionId];
166 $this->srcPoolDefRelatedQuestRegister = array();
175 if (!isset($this->srcPoolDefRelatedQuestRegister[$definitionId])) {
179 $this->srcPoolDefRelatedQuestRegister[$definitionId]->addQuestion($randomSetQuestion);
188 if (isset($this->srcPoolDefRelatedQuestRegister[$definitionId])) {
189 return $this->srcPoolDefRelatedQuestRegister[$definitionId];
204 $randomQuestion->getSourcePoolDefinitionId()
208 $randomQuestion->getSourcePoolDefinitionId(),
213 $randomQuestion->getQuestionId(),
214 $sourcePoolDefinition
238 $defQstCombinationCollection = $qstCollectionProvider->getSrcPoolDefListRelatedQuestCombinationCollection(
239 $srcPoolDefinitionList
242 return $defQstCombinationCollection;
258 $exclusiveQstCollection->addQuestion($question);
261 return $exclusiveQstCollection;
272 return $srcPoolDefRelatedQstCollection->getRelativeComplementCollection($exclusiveQstCollection);
285 $intersectionQstCollection = $thisDefRelatedSharedQstCollection->getIntersectionCollection(
286 $thatDefRelatedSharedQstCollection
289 return $intersectionQstCollection;
298 $intersectionQstCollectionsByDefId = array();
301 foreach ($sharedQuestionCollection as $sharedQuestion) {
303 foreach ($relatedSrcPoolDefList as $otherDefinition) {
304 if ($otherDefinition->getId() == $definition->
getId()) {
308 if (isset($intersectionQstCollectionsByDefId[$otherDefinition->getId()])) {
313 $definition->
getId(),
314 $otherDefinition->getId()
317 $intersectionQstCollectionsByDefId[$otherDefinition->getId()] = $intersectionQuestionCollection;
321 return $intersectionQstCollectionsByDefId;
333 foreach ($intersectionQstCollectionByDefIdMap as $otherDefinitionId => $intersectionCollection) {
337 $qstCollectionSubsetApplication->setQuestions($intersectionCollection->getQuestions());
338 $qstCollectionSubsetApplication->setApplicantId($otherDefinitionId);
340 #$qstCollectionSubsetApplication->setRequiredAmount($this->getRequiredSharedQuestionAmount( 341 # $this->getSourcePoolDefinitionList()->getDefinition($otherDefinitionId) 344 $qstCollectionSubsetApplication->setRequiredAmount(
348 $qstCollectionSubsetApplicationList->addCollectionSubsetApplication($qstCollectionSubsetApplication);
351 return $qstCollectionSubsetApplicationList;
365 foreach ($sharedQuestionCollection as $sharedQuestion) {
367 foreach ($relatedSrcPoolDefList as $otherDefinition) {
368 if ($otherDefinition->getId() == $definition->
getId()) {
372 if ($intersectionSharingDefinitionList->hasDefinition($otherDefinition->getId())) {
376 $intersectionSharingDefinitionList->addDefinition($otherDefinition);
380 return $intersectionSharingDefinitionList;
390 $qstRelatedSrcPoolDefList = $this->questRelatedSrcPoolDefRegister[$question->
getQuestionId()];
391 return $qstRelatedSrcPoolDefList->getDefinitionCount() > 1;
420 $intersectionSubsetApplicationList->handleQuestionRequest($sharedQuestion);
423 return $intersectionSubsetApplicationList->getNonReservedQuestionAmount();
433 $missingExclsuiveQstCount = $exclusiveQstCollection->getMissingCount($definition->
getQuestionAmount());
434 return $missingExclsuiveQstCount;
472 $quantityCalculation->setIntersectionQuantitySharingDefinitionList(
476 return $quantityCalculation;
getIntersectionQuestionCollectionSubsetApplicationList(ilTestRandomQuestionSetSourcePoolDefinition $definition)
getSourcePoolDefinitionList()
buildQuestionCollectionSubsetApplicationListInstance()
getIntersectionQstCollectionByDefinitionMap(ilTestRandomQuestionSetSourcePoolDefinition $definition)
buildSourcePoolDefinitionListInstance()
$questionCollectionProvider
resetRegisters()
reset internal registers
resetQuestRelatedSrcPoolDefRegister()
re-setter for questRelatedSrcPoolDefRegister
resetSrcPoolDefRelatedQuestRegister()
re-setter the srcPoolDefRelatedQuestRegister
getRequiredSharedQuestionAmount(ilTestRandomQuestionSetSourcePoolDefinition $definition)
$questRelatedSrcPoolDefRegister
getSharedQuestionCollection($definitionId)
getIntersectionSharingDefinitionList(ilTestRandomQuestionSetSourcePoolDefinition $definition)
$sourcePoolDefinitionList
getExclusiveQuestionCollection($definitionId)
getIntersectionQuestionCollection($thisDefinitionId, $thatDefinitionId)
registerSrcPoolDefRelatedQuest($definitionId, ilTestRandomQuestionSetQuestion $randomSetQuestion)
getSrcPoolDefRelatedQuestionCollection($definitionId)
$srcPoolDefRelatedQuestRegister
initialiseRegisters()
initialise the src-pool-def/question registers
getSrcPoolDefQuestionCombinationCollection()
requiresSharedQuestions(ilTestRandomQuestionSetSourcePoolDefinition $definition)
getAvailableSharedQuestionAmount(ilTestRandomQuestionSetSourcePoolDefinition $definition)
setQuestionCollectionProvider(ilTestRandomSourcePoolDefinitionQuestionCollectionProvider $questionCollectionProvider)
isQuestionUsedByMultipleSrcPoolDefinitions(ilTestRandomQuestionSetQuestion $question)
setSourcePoolDefinitionList($sourcePoolDefinitionList)
registerQuestRelatedSrcPoolDef($questionId, ilTestRandomQuestionSetSourcePoolDefinition $definition)
getQuestRelatedSrcPoolDefinitionList($questionId)
buildQuestionCollectionSubsetApplicationInstance()
calculateQuantities(ilTestRandomQuestionSetSourcePoolDefinition $definition)
buildRandomQuestionCollectionInstance()
__construct(ilTestRandomSourcePoolDefinitionQuestionCollectionProvider $questionCollectionProvider)
getExclusiveQuestionAmount(ilTestRandomQuestionSetSourcePoolDefinition $definition)
getSrcPoolDefRelatedQuestionAmount(ilTestRandomQuestionSetSourcePoolDefinition $definition)
getQuestionCollectionProvider()