ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilTestRandomQuestionsQuantitiesDistribution Class Reference
+ Collaboration diagram for ilTestRandomQuestionsQuantitiesDistribution:

Public Member Functions

 __construct (ilTestRandomSourcePoolDefinitionQuestionCollectionProvider $questionCollectionProvider)
 
 setQuestionCollectionProvider (ilTestRandomSourcePoolDefinitionQuestionCollectionProvider $questionCollectionProvider)
 
 getQuestionCollectionProvider ()
 
 setSourcePoolDefinitionList ($sourcePoolDefinitionList)
 
 getSourcePoolDefinitionList ()
 
 initialise ()
 
 reset ()
 
 calculateQuantities (ilTestRandomQuestionSetSourcePoolDefinition $definition)
 

Protected Member Functions

 buildSourcePoolDefinitionListInstance ()
 
 buildRandomQuestionCollectionInstance ()
 
 buildQuestionCollectionSubsetApplicationInstance ()
 
 buildQuestionCollectionSubsetApplicationListInstance ()
 
 resetQuestRelatedSrcPoolDefRegister ()
 re-setter for questRelatedSrcPoolDefRegister More...
 
 registerQuestRelatedSrcPoolDef ($questionId, ilTestRandomQuestionSetSourcePoolDefinition $definition)
 
 getQuestRelatedSrcPoolDefinitionList ($questionId)
 
 resetSrcPoolDefRelatedQuestRegister ()
 re-setter the srcPoolDefRelatedQuestRegister More...
 
 registerSrcPoolDefRelatedQuest ($definitionId, ilTestRandomQuestionSetQuestion $randomSetQuestion)
 
 getSrcPoolDefRelatedQuestionCollection ($definitionId)
 
 initialiseRegisters ()
 initialise the src-pool-def/question registers More...
 
 resetRegisters ()
 reset internal registers More...
 
 getSrcPoolDefQuestionCombinationCollection ()
 
 getExclusiveQuestionCollection ($definitionId)
 
 getSharedQuestionCollection ($definitionId)
 
 getIntersectionQuestionCollection ($thisDefinitionId, $thatDefinitionId)
 
 getIntersectionQstCollectionByDefinitionMap (ilTestRandomQuestionSetSourcePoolDefinition $definition)
 
 getIntersectionQuestionCollectionSubsetApplicationList (ilTestRandomQuestionSetSourcePoolDefinition $definition)
 
 getIntersectionSharingDefinitionList (ilTestRandomQuestionSetSourcePoolDefinition $definition)
 
 isQuestionUsedByMultipleSrcPoolDefinitions (ilTestRandomQuestionSetQuestion $question)
 
 getSrcPoolDefRelatedQuestionAmount (ilTestRandomQuestionSetSourcePoolDefinition $definition)
 
 getExclusiveQuestionAmount (ilTestRandomQuestionSetSourcePoolDefinition $definition)
 
 getAvailableSharedQuestionAmount (ilTestRandomQuestionSetSourcePoolDefinition $definition)
 
 getRequiredSharedQuestionAmount (ilTestRandomQuestionSetSourcePoolDefinition $definition)
 
 requiresSharedQuestions (ilTestRandomQuestionSetSourcePoolDefinition $definition)
 

Protected Attributes

 $questionCollectionProvider
 
 $sourcePoolDefinitionList
 
 $questRelatedSrcPoolDefRegister = array()
 
 $srcPoolDefRelatedQuestRegister = array()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestRandomQuestionsQuantitiesDistribution::__construct ( ilTestRandomSourcePoolDefinitionQuestionCollectionProvider  $questionCollectionProvider)
Parameters
ilTestRandomSourcePoolDefinitionQuestionCollectionProvider$questionCollectionProvider

Definition at line 48 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References setQuestionCollectionProvider().

49  {
50  if ($questionCollectionProvider !== null) {
51  $this->setQuestionCollectionProvider($questionCollectionProvider);
52  }
53  }
setQuestionCollectionProvider(ilTestRandomSourcePoolDefinitionQuestionCollectionProvider $questionCollectionProvider)
+ Here is the call graph for this function:

Member Function Documentation

◆ buildQuestionCollectionSubsetApplicationInstance()

ilTestRandomQuestionsQuantitiesDistribution::buildQuestionCollectionSubsetApplicationInstance ( )
protected

◆ buildQuestionCollectionSubsetApplicationListInstance()

ilTestRandomQuestionsQuantitiesDistribution::buildQuestionCollectionSubsetApplicationListInstance ( )
protected

◆ buildRandomQuestionCollectionInstance()

ilTestRandomQuestionsQuantitiesDistribution::buildRandomQuestionCollectionInstance ( )
protected

◆ buildSourcePoolDefinitionListInstance()

ilTestRandomQuestionsQuantitiesDistribution::buildSourcePoolDefinitionListInstance ( )
protected
Returns
ilTestRandomQuestionSetSourcePoolDefinitionList

Definition at line 92 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References $GLOBALS.

Referenced by getIntersectionSharingDefinitionList(), and registerQuestRelatedSrcPoolDef().

93  {
94  $anyTestObject = new ilObjTest();
95  $nonRequiredDb = isset($GLOBALS['DIC']) ? $GLOBALS['DIC']['ilDB'] : $GLOBALS['ilDB'];
96  $nonUsedFactory = new ilTestRandomQuestionSetSourcePoolDefinitionFactory($nonRequiredDb, $anyTestObject);
97  return new ilTestRandomQuestionSetSourcePoolDefinitionList($nonRequiredDb, $anyTestObject, $nonUsedFactory);
98  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
+ Here is the caller graph for this function:

◆ calculateQuantities()

ilTestRandomQuestionsQuantitiesDistribution::calculateQuantities ( ilTestRandomQuestionSetSourcePoolDefinition  $definition)
Parameters
ilTestRandomQuestionSetSourcePoolDefinition$definition
Returns
ilTestRandomQuestionsSrcPoolDefinitionQuantitiesCalculation

Definition at line 463 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References getAvailableSharedQuestionAmount(), getExclusiveQuestionAmount(), getIntersectionSharingDefinitionList(), and getSrcPoolDefRelatedQuestionAmount().

464  {
465  $quantityCalculation = new ilTestRandomQuestionsSrcPoolDefinitionQuantitiesCalculation($definition);
466 
467  $quantityCalculation->setOverallQuestionAmount($this->getSrcPoolDefRelatedQuestionAmount($definition));
468  $quantityCalculation->setExclusiveQuestionAmount($this->getExclusiveQuestionAmount($definition));
469  $quantityCalculation->setAvailableSharedQuestionAmount($this->getAvailableSharedQuestionAmount($definition));
470 
471  $quantityCalculation->setIntersectionQuantitySharingDefinitionList(
472  $this->getIntersectionSharingDefinitionList($definition)
473  );
474 
475  return $quantityCalculation;
476  }
getIntersectionSharingDefinitionList(ilTestRandomQuestionSetSourcePoolDefinition $definition)
getAvailableSharedQuestionAmount(ilTestRandomQuestionSetSourcePoolDefinition $definition)
getExclusiveQuestionAmount(ilTestRandomQuestionSetSourcePoolDefinition $definition)
getSrcPoolDefRelatedQuestionAmount(ilTestRandomQuestionSetSourcePoolDefinition $definition)
+ Here is the call graph for this function:

◆ getAvailableSharedQuestionAmount()

ilTestRandomQuestionsQuantitiesDistribution::getAvailableSharedQuestionAmount ( ilTestRandomQuestionSetSourcePoolDefinition  $definition)
protected
Parameters
ilTestRandomQuestionSetSourcePoolDefinition$definition
Returns
integer $availableSharedQuestionAmount

Definition at line 414 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References ilTestRandomQuestionSetSourcePoolDefinition\getId(), getIntersectionQuestionCollectionSubsetApplicationList(), and getSharedQuestionCollection().

Referenced by calculateQuantities().

415  {
416  $intersectionSubsetApplicationList = $this->getIntersectionQuestionCollectionSubsetApplicationList($definition);
417 
418  foreach ($this->getSharedQuestionCollection($definition->getId()) as $sharedQuestion) {
419  $intersectionSubsetApplicationList->handleQuestionRequest($sharedQuestion);
420  }
421 
422  return $intersectionSubsetApplicationList->getNonReservedQuestionAmount();
423  }
getIntersectionQuestionCollectionSubsetApplicationList(ilTestRandomQuestionSetSourcePoolDefinition $definition)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExclusiveQuestionAmount()

ilTestRandomQuestionsQuantitiesDistribution::getExclusiveQuestionAmount ( ilTestRandomQuestionSetSourcePoolDefinition  $definition)
protected
Parameters
ilTestRandomQuestionSetSourcePoolDefinition$definition
Returns
integer

Definition at line 405 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References getExclusiveQuestionCollection(), and ilTestRandomQuestionSetSourcePoolDefinition\getId().

Referenced by calculateQuantities().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExclusiveQuestionCollection()

ilTestRandomQuestionsQuantitiesDistribution::getExclusiveQuestionCollection (   $definitionId)
protected
Parameters
integer$definitionId
Returns
ilTestRandomQuestionSetQuestionCollection

Definition at line 248 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References buildRandomQuestionCollectionInstance(), getSrcPoolDefRelatedQuestionCollection(), and isQuestionUsedByMultipleSrcPoolDefinitions().

Referenced by getExclusiveQuestionAmount(), getRequiredSharedQuestionAmount(), and getSharedQuestionCollection().

249  {
250  $exclusiveQstCollection = $this->buildRandomQuestionCollectionInstance();
251 
252  foreach ($this->getSrcPoolDefRelatedQuestionCollection($definitionId) as $question) {
253  if ($this->isQuestionUsedByMultipleSrcPoolDefinitions($question)) {
254  continue;
255  }
256 
257  $exclusiveQstCollection->addQuestion($question);
258  }
259 
260  return $exclusiveQstCollection;
261  }
isQuestionUsedByMultipleSrcPoolDefinitions(ilTestRandomQuestionSetQuestion $question)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIntersectionQstCollectionByDefinitionMap()

ilTestRandomQuestionsQuantitiesDistribution::getIntersectionQstCollectionByDefinitionMap ( ilTestRandomQuestionSetSourcePoolDefinition  $definition)
protected
Parameters
ilTestRandomQuestionSetSourcePoolDefinition$definition
Returns
array[ $definitionId => ilTestRandomQuestionSetQuestionCollection ]

Definition at line 295 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References array, ilTestRandomQuestionSetSourcePoolDefinition\getId(), getIntersectionQuestionCollection(), getQuestRelatedSrcPoolDefinitionList(), and getSharedQuestionCollection().

Referenced by getIntersectionQuestionCollectionSubsetApplicationList().

296  {
297  $intersectionQstCollectionsByDefId = array();
298 
299  $sharedQuestionCollection = $this->getSharedQuestionCollection($definition->getId());
300  foreach ($sharedQuestionCollection as $sharedQuestion) {
301  $relatedSrcPoolDefList = $this->getQuestRelatedSrcPoolDefinitionList($sharedQuestion->getQuestionId());
302  foreach ($relatedSrcPoolDefList as $otherDefinition) {
303  if ($otherDefinition->getId() == $definition->getId()) {
304  continue;
305  }
306 
307  if (isset($intersectionQstCollectionsByDefId[$otherDefinition->getId()])) {
308  continue;
309  }
310 
311  $intersectionQuestionCollection = $this->getIntersectionQuestionCollection(
312  $definition->getId(),
313  $otherDefinition->getId()
314  );
315 
316  $intersectionQstCollectionsByDefId[$otherDefinition->getId()] = $intersectionQuestionCollection;
317  }
318  }
319 
320  return $intersectionQstCollectionsByDefId;
321  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIntersectionQuestionCollection()

ilTestRandomQuestionsQuantitiesDistribution::getIntersectionQuestionCollection (   $thisDefinitionId,
  $thatDefinitionId 
)
protected
Parameters
integer$thisDefinitionId
integer$thatDefinitionId
Returns
ilTestRandomQuestionSetQuestionCollection

Definition at line 279 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References getSharedQuestionCollection().

Referenced by getIntersectionQstCollectionByDefinitionMap().

280  {
281  $thisDefRelatedSharedQstCollection = $this->getSharedQuestionCollection($thisDefinitionId);
282  $thatDefRelatedSharedQstCollection = $this->getSharedQuestionCollection($thatDefinitionId);
283 
284  $intersectionQstCollection = $thisDefRelatedSharedQstCollection->getIntersectionCollection(
285  $thatDefRelatedSharedQstCollection
286  );
287 
288  return $intersectionQstCollection;
289  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIntersectionQuestionCollectionSubsetApplicationList()

ilTestRandomQuestionsQuantitiesDistribution::getIntersectionQuestionCollectionSubsetApplicationList ( ilTestRandomQuestionSetSourcePoolDefinition  $definition)
protected
Parameters
ilTestRandomQuestionSetSourcePoolDefinition$definition
Returns
ilTestRandomQuestionCollectionSubsetApplicationList

Definition at line 327 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References buildQuestionCollectionSubsetApplicationInstance(), buildQuestionCollectionSubsetApplicationListInstance(), getIntersectionQstCollectionByDefinitionMap(), and getSourcePoolDefinitionList().

Referenced by getAvailableSharedQuestionAmount().

328  {
329  $qstCollectionSubsetApplicationList = $this->buildQuestionCollectionSubsetApplicationListInstance();
330 
331  $intersectionQstCollectionByDefIdMap = $this->getIntersectionQstCollectionByDefinitionMap($definition);
332  foreach ($intersectionQstCollectionByDefIdMap as $otherDefinitionId => $intersectionCollection) {
333  /* @var ilTestRandomQuestionSetQuestionCollection $intersectionCollection */
334 
335  $qstCollectionSubsetApplication = $this->buildQuestionCollectionSubsetApplicationInstance();
336  $qstCollectionSubsetApplication->setQuestions($intersectionCollection->getQuestions());
337  $qstCollectionSubsetApplication->setApplicantId($otherDefinitionId);
338 
339  #$qstCollectionSubsetApplication->setRequiredAmount($this->getRequiredSharedQuestionAmount(
340  # $this->getSourcePoolDefinitionList()->getDefinition($otherDefinitionId)
341  #));
342 
343  $qstCollectionSubsetApplication->setRequiredAmount(
344  $this->getSourcePoolDefinitionList()->getDefinition($otherDefinitionId)->getQuestionAmount()
345  );
346 
347  $qstCollectionSubsetApplicationList->addCollectionSubsetApplication($qstCollectionSubsetApplication);
348  }
349 
350  return $qstCollectionSubsetApplicationList;
351  }
getIntersectionQstCollectionByDefinitionMap(ilTestRandomQuestionSetSourcePoolDefinition $definition)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIntersectionSharingDefinitionList()

ilTestRandomQuestionsQuantitiesDistribution::getIntersectionSharingDefinitionList ( ilTestRandomQuestionSetSourcePoolDefinition  $definition)
protected
Parameters
ilTestRandomQuestionSetSourcePoolDefinition$definition
Returns
ilTestRandomQuestionSetSourcePoolDefinitionList

Definition at line 359 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References buildSourcePoolDefinitionListInstance(), ilTestRandomQuestionSetSourcePoolDefinition\getId(), getQuestRelatedSrcPoolDefinitionList(), and getSharedQuestionCollection().

Referenced by calculateQuantities().

360  {
361  $intersectionSharingDefinitionList = $this->buildSourcePoolDefinitionListInstance();
362 
363  $sharedQuestionCollection = $this->getSharedQuestionCollection($definition->getId());
364  foreach ($sharedQuestionCollection as $sharedQuestion) {
365  $relatedSrcPoolDefList = $this->getQuestRelatedSrcPoolDefinitionList($sharedQuestion->getQuestionId());
366  foreach ($relatedSrcPoolDefList as $otherDefinition) {
367  if ($otherDefinition->getId() == $definition->getId()) {
368  continue;
369  }
370 
371  if ($intersectionSharingDefinitionList->hasDefinition($otherDefinition->getId())) {
372  continue;
373  }
374 
375  $intersectionSharingDefinitionList->addDefinition($otherDefinition);
376  }
377  }
378 
379  return $intersectionSharingDefinitionList;
380  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionCollectionProvider()

ilTestRandomQuestionsQuantitiesDistribution::getQuestionCollectionProvider ( )

◆ getQuestRelatedSrcPoolDefinitionList()

ilTestRandomQuestionsQuantitiesDistribution::getQuestRelatedSrcPoolDefinitionList (   $questionId)
protected
Parameters
$questionId
Returns
ilTestRandomQuestionSetSourcePoolDefinitionList

Definition at line 151 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

Referenced by getIntersectionQstCollectionByDefinitionMap(), and getIntersectionSharingDefinitionList().

152  {
153  if (isset($this->questRelatedSrcPoolDefRegister[$questionId])) {
154  return $this->questRelatedSrcPoolDefRegister[$questionId];
155  }
156 
157  return null;
158  }
+ Here is the caller graph for this function:

◆ getRequiredSharedQuestionAmount()

ilTestRandomQuestionsQuantitiesDistribution::getRequiredSharedQuestionAmount ( ilTestRandomQuestionSetSourcePoolDefinition  $definition)
protected
Parameters
ilTestRandomQuestionSetSourcePoolDefinition$definition
Returns
integer

Definition at line 429 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References getExclusiveQuestionCollection(), ilTestRandomQuestionSetSourcePoolDefinition\getId(), and ilTestRandomQuestionSetSourcePoolDefinition\getQuestionAmount().

Referenced by requiresSharedQuestions().

430  {
431  $exclusiveQstCollection = $this->getExclusiveQuestionCollection($definition->getId());
432  $missingExclsuiveQstCount = $exclusiveQstCollection->getMissingCount($definition->getQuestionAmount());
433  return $missingExclsuiveQstCount;
434  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSharedQuestionCollection()

ilTestRandomQuestionsQuantitiesDistribution::getSharedQuestionCollection (   $definitionId)
protected
Parameters
integer$definitionId
Returns
ilTestRandomQuestionSetQuestionCollection

Definition at line 267 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References getExclusiveQuestionCollection(), and getSrcPoolDefRelatedQuestionCollection().

Referenced by getAvailableSharedQuestionAmount(), getIntersectionQstCollectionByDefinitionMap(), getIntersectionQuestionCollection(), and getIntersectionSharingDefinitionList().

268  {
269  $srcPoolDefRelatedQstCollection = $this->getSrcPoolDefRelatedQuestionCollection($definitionId);
270  $exclusiveQstCollection = $this->getExclusiveQuestionCollection($definitionId);
271  return $srcPoolDefRelatedQstCollection->getRelativeComplementCollection($exclusiveQstCollection);
272  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSourcePoolDefinitionList()

◆ getSrcPoolDefQuestionCombinationCollection()

ilTestRandomQuestionsQuantitiesDistribution::getSrcPoolDefQuestionCombinationCollection ( )
protected
Returns
ilTestRandomQuestionSetQuestionCollection

Definition at line 232 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References getQuestionCollectionProvider(), and getSourcePoolDefinitionList().

Referenced by initialiseRegisters().

233  {
234  $qstCollectionProvider = $this->getQuestionCollectionProvider();
235  $srcPoolDefinitionList = $this->getSourcePoolDefinitionList();
236 
237  $defQstCombinationCollection = $qstCollectionProvider->getSrcPoolDefListRelatedQuestCombinationCollection(
238  $srcPoolDefinitionList
239  );
240 
241  return $defQstCombinationCollection;
242  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSrcPoolDefRelatedQuestionAmount()

ilTestRandomQuestionsQuantitiesDistribution::getSrcPoolDefRelatedQuestionAmount ( ilTestRandomQuestionSetSourcePoolDefinition  $definition)
protected
Parameters
ilTestRandomQuestionSetSourcePoolDefinition$definition

Definition at line 396 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References ilTestRandomQuestionSetSourcePoolDefinition\getId(), and getSrcPoolDefRelatedQuestionCollection().

Referenced by calculateQuantities().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSrcPoolDefRelatedQuestionCollection()

ilTestRandomQuestionsQuantitiesDistribution::getSrcPoolDefRelatedQuestionCollection (   $definitionId)
protected
Parameters
integer$definitionId
Returns
ilTestRandomQuestionSetQuestionCollection

Definition at line 185 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

Referenced by getExclusiveQuestionCollection(), getSharedQuestionCollection(), and getSrcPoolDefRelatedQuestionAmount().

186  {
187  if (isset($this->srcPoolDefRelatedQuestRegister[$definitionId])) {
188  return $this->srcPoolDefRelatedQuestRegister[$definitionId];
189  }
190 
192  }
+ Here is the caller graph for this function:

◆ initialise()

ilTestRandomQuestionsQuantitiesDistribution::initialise ( )

Definition at line 447 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References initialiseRegisters().

448  {
449  $this->initialiseRegisters();
450  }
initialiseRegisters()
initialise the src-pool-def/question registers
+ Here is the call graph for this function:

◆ initialiseRegisters()

ilTestRandomQuestionsQuantitiesDistribution::initialiseRegisters ( )
protected

initialise the src-pool-def/question registers

Definition at line 199 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References getSourcePoolDefinitionList(), getSrcPoolDefQuestionCombinationCollection(), registerQuestRelatedSrcPoolDef(), and registerSrcPoolDefRelatedQuest().

Referenced by initialise().

200  {
201  foreach ($this->getSrcPoolDefQuestionCombinationCollection() as $randomQuestion) {
202  $sourcePoolDefinition = $this->getSourcePoolDefinitionList()->getDefinition(
203  $randomQuestion->getSourcePoolDefinitionId()
204  );
205 
207  $randomQuestion->getSourcePoolDefinitionId(),
208  $randomQuestion
209  );
210 
212  $randomQuestion->getQuestionId(),
213  $sourcePoolDefinition
214  );
215  }
216  }
registerSrcPoolDefRelatedQuest($definitionId, ilTestRandomQuestionSetQuestion $randomSetQuestion)
registerQuestRelatedSrcPoolDef($questionId, ilTestRandomQuestionSetSourcePoolDefinition $definition)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isQuestionUsedByMultipleSrcPoolDefinitions()

ilTestRandomQuestionsQuantitiesDistribution::isQuestionUsedByMultipleSrcPoolDefinitions ( ilTestRandomQuestionSetQuestion  $question)
protected
Parameters
ilTestRandomQuestionSetQuestion$question
Returns
bool

Definition at line 386 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References ilTestRandomQuestionSetQuestion\getQuestionId().

Referenced by getExclusiveQuestionCollection().

387  {
388  /* @var ilTestRandomQuestionSetSourcePoolDefinitionList $qstRelatedSrcPoolDefList */
389  $qstRelatedSrcPoolDefList = $this->questRelatedSrcPoolDefRegister[$question->getQuestionId()];
390  return $qstRelatedSrcPoolDefList->getDefinitionCount() > 1;
391  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerQuestRelatedSrcPoolDef()

ilTestRandomQuestionsQuantitiesDistribution::registerQuestRelatedSrcPoolDef (   $questionId,
ilTestRandomQuestionSetSourcePoolDefinition  $definition 
)
protected
Parameters
integer$questionId
ilTestRandomQuestionSetSourcePoolDefinition$definition

Definition at line 138 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References buildSourcePoolDefinitionListInstance().

Referenced by initialiseRegisters().

139  {
140  if (!$this->questRelatedSrcPoolDefRegister[$questionId]) {
141  $this->questRelatedSrcPoolDefRegister[$questionId] = $this->buildSourcePoolDefinitionListInstance();
142  }
143 
144  $this->questRelatedSrcPoolDefRegister[$questionId]->addDefinition($definition);
145  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerSrcPoolDefRelatedQuest()

ilTestRandomQuestionsQuantitiesDistribution::registerSrcPoolDefRelatedQuest (   $definitionId,
ilTestRandomQuestionSetQuestion  $randomSetQuestion 
)
protected
Parameters
integer$definitionId
ilTestRandomQuestionSetQuestion$randomSetQuestion

Definition at line 172 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References buildRandomQuestionCollectionInstance().

Referenced by initialiseRegisters().

173  {
174  if (!isset($this->srcPoolDefRelatedQuestRegister[$definitionId])) {
175  $this->srcPoolDefRelatedQuestRegister[$definitionId] = $this->buildRandomQuestionCollectionInstance();
176  }
177 
178  $this->srcPoolDefRelatedQuestRegister[$definitionId]->addQuestion($randomSetQuestion);
179  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ requiresSharedQuestions()

ilTestRandomQuestionsQuantitiesDistribution::requiresSharedQuestions ( ilTestRandomQuestionSetSourcePoolDefinition  $definition)
protected
Parameters
ilTestRandomQuestionSetSourcePoolDefinition$definition
Returns
bool

Definition at line 440 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References getRequiredSharedQuestionAmount().

441  {
442  return $this->getRequiredSharedQuestionAmount($definition) > 0;
443  }
getRequiredSharedQuestionAmount(ilTestRandomQuestionSetSourcePoolDefinition $definition)
+ Here is the call graph for this function:

◆ reset()

ilTestRandomQuestionsQuantitiesDistribution::reset ( )

Definition at line 452 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References resetRegisters().

453  {
454  $this->resetRegisters();
455  }
+ Here is the call graph for this function:

◆ resetQuestRelatedSrcPoolDefRegister()

ilTestRandomQuestionsQuantitiesDistribution::resetQuestRelatedSrcPoolDefRegister ( )
protected

re-setter for questRelatedSrcPoolDefRegister

Definition at line 129 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References array.

Referenced by resetRegisters().

130  {
131  $this->questRelatedSrcPoolDefRegister = array();
132  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ resetRegisters()

ilTestRandomQuestionsQuantitiesDistribution::resetRegisters ( )
protected

reset internal registers

Definition at line 221 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References resetQuestRelatedSrcPoolDefRegister(), and resetSrcPoolDefRelatedQuestRegister().

Referenced by reset().

222  {
225  }
resetQuestRelatedSrcPoolDefRegister()
re-setter for questRelatedSrcPoolDefRegister
resetSrcPoolDefRelatedQuestRegister()
re-setter the srcPoolDefRelatedQuestRegister
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetSrcPoolDefRelatedQuestRegister()

ilTestRandomQuestionsQuantitiesDistribution::resetSrcPoolDefRelatedQuestRegister ( )
protected

re-setter the srcPoolDefRelatedQuestRegister

Definition at line 163 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References array.

Referenced by resetRegisters().

164  {
165  $this->srcPoolDefRelatedQuestRegister = array();
166  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ setQuestionCollectionProvider()

ilTestRandomQuestionsQuantitiesDistribution::setQuestionCollectionProvider ( ilTestRandomSourcePoolDefinitionQuestionCollectionProvider  $questionCollectionProvider)
Parameters
ilTestRandomSourcePoolDefinitionQuestionCollectionProvider$questionCollectionProvider

Definition at line 58 of file class.ilTestRandomQuestionsQuantitiesDistribution.php.

References $questionCollectionProvider.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setSourcePoolDefinitionList()

ilTestRandomQuestionsQuantitiesDistribution::setSourcePoolDefinitionList (   $sourcePoolDefinitionList)

Field Documentation

◆ $questionCollectionProvider

ilTestRandomQuestionsQuantitiesDistribution::$questionCollectionProvider
protected

◆ $questRelatedSrcPoolDefRegister

ilTestRandomQuestionsQuantitiesDistribution::$questRelatedSrcPoolDefRegister = array()
protected

◆ $sourcePoolDefinitionList

ilTestRandomQuestionsQuantitiesDistribution::$sourcePoolDefinitionList
protected

◆ $srcPoolDefRelatedQuestRegister

ilTestRandomQuestionsQuantitiesDistribution::$srcPoolDefRelatedQuestRegister = array()
protected

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