19 declare(strict_types=1);
44 return $this->collectionSubsetApplications[$applicantId] ??
null;
58 $this->collectionSubsetApplications[$collectionSubsetApplication->
getApplicantId()] = $collectionSubsetApplication;
92 return current($this->collectionSubsetApplications);
95 public function next(): void
97 next($this->collectionSubsetApplications);
102 return key($this->collectionSubsetApplications);
107 return key($this->collectionSubsetApplications) !==
null;
112 reset($this->collectionSubsetApplications);
117 $questionReservationRequired =
false;
119 foreach ($this as $collectionSubsetApplication) {
120 if (!$collectionSubsetApplication->hasQuestion($question->
getQuestionId())) {
124 if ($collectionSubsetApplication->hasRequiredAmountLeft()) {
125 $questionReservationRequired =
true;
126 $collectionSubsetApplication->decrementRequiredAmount();
130 if ($questionReservationRequired) {
139 foreach ($this as $collectionSubsetApplication) {
140 $applicationsNonReservedQstCollection = $collectionSubsetApplication->getRelativeComplementCollection(
144 $availableQuestionCollection->mergeQuestionCollection($applicationsNonReservedQstCollection);
147 $nonReservedQuestionCollection = $availableQuestionCollection->getUniqueQuestionCollection();
149 return $nonReservedQuestionCollection->getQuestionAmount();
resetCollectionSubsetApplicants()
handleQuestionRequest(ilTestRandomQuestionSetQuestion $question)
setReservedQuestionCollection(ilTestRandomQuestionSetQuestionCollection $reservedQuestionCollection)
setCollectionSubsetApplications(array $collectionSubsetApplications)
getNonReservedQuestionAmount()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ilTestRandomQuestionSetQuestionCollection $reservedQuestionCollection
addCollectionSubsetApplication(ilTestRandomQuestionCollectionSubsetApplication $collectionSubsetApplication)
getReservedQuestionCollection()
array $collectionSubsetApplications
addReservedQuestion(ilTestRandomQuestionSetQuestion $reservedQuestion)
getCollectionSubsetApplication($applicantId)
getCollectionSubsetApplications()