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

Public Member Functions

 __construct ()
 ilTestRandomQuestionCollectionSubsetApplicantList constructor. More...
 
 getCollectionSubsetApplication ($applicantId)
 
 getCollectionSubsetApplications ()
 
 addCollectionSubsetApplication (ilTestRandomQuestionCollectionSubsetApplication $collectionSubsetApplication)
 
 setCollectionSubsetApplications ($collectionSubsetApplications)
 
 resetCollectionSubsetApplicants ()
 resetter for collectionSubsetApplicants More...
 
 getReservedQuestionCollection ()
 
 setReservedQuestionCollection ($reservedQuestionCollection)
 
 addReservedQuestion (ilTestRandomQuestionSetQuestion $reservedQuestion)
 
 current ()
 
 next ()
 
 key ()
 
 valid ()
 
 rewind ()
 
 handleQuestionRequest (ilTestRandomQuestionSetQuestion $question)
 
 getNonReservedQuestionAmount ()
 

Protected Attributes

 $collectionSubsetApplications = array()
 
 $reservedQuestionCollection
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestRandomQuestionCollectionSubsetApplicationList::__construct ( )

Member Function Documentation

◆ addCollectionSubsetApplication()

ilTestRandomQuestionCollectionSubsetApplicationList::addCollectionSubsetApplication ( ilTestRandomQuestionCollectionSubsetApplication  $collectionSubsetApplication)
Parameters
ilTestRandomQuestionCollectionSubsetApplicant$collectionSubsetApplicant

Definition at line 56 of file class.ilTestRandomQuestionCollectionSubsetApplicationList.php.

References ilTestRandomQuestionCollectionSubsetApplication\getApplicantId().

57  {
58  $this->collectionSubsetApplications[$collectionSubsetApplication->getApplicantId()] = $collectionSubsetApplication;
59  }
+ Here is the call graph for this function:

◆ addReservedQuestion()

ilTestRandomQuestionCollectionSubsetApplicationList::addReservedQuestion ( ilTestRandomQuestionSetQuestion  $reservedQuestion)
Parameters
ilTestRandomQuestionSetQuestion$question

Definition at line 96 of file class.ilTestRandomQuestionCollectionSubsetApplicationList.php.

References getReservedQuestionCollection().

Referenced by handleQuestionRequest().

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

◆ current()

ilTestRandomQuestionCollectionSubsetApplicationList::current ( )

◆ getCollectionSubsetApplication()

ilTestRandomQuestionCollectionSubsetApplicationList::getCollectionSubsetApplication (   $applicantId)
Parameters
integer$applicantId
Returns
ilTestRandomQuestionCollectionSubsetApplication

Definition at line 36 of file class.ilTestRandomQuestionCollectionSubsetApplicationList.php.

37  {
38  if (!isset($this->collectionSubsetApplications[$applicantId])) {
39  return null;
40  }
41 
42  return $this->collectionSubsetApplications[$applicantId];
43  }

◆ getCollectionSubsetApplications()

◆ getNonReservedQuestionAmount()

ilTestRandomQuestionCollectionSubsetApplicationList::getNonReservedQuestionAmount ( )
Returns
int

Definition at line 153 of file class.ilTestRandomQuestionCollectionSubsetApplicationList.php.

References getReservedQuestionCollection().

154  {
155  $availableQuestionCollection = new ilTestRandomQuestionSetQuestionCollection();
156 
157  foreach ($this as $collectionSubsetApplication) {
158  $applicationsNonReservedQstCollection = $collectionSubsetApplication->getRelativeComplementCollection(
160  );
161 
162  $availableQuestionCollection->mergeQuestionCollection($applicationsNonReservedQstCollection);
163  }
164 
165  $nonReservedQuestionCollection = $availableQuestionCollection->getUniqueQuestionCollection();
166 
167  return $nonReservedQuestionCollection->getQuestionAmount();
168  }
+ Here is the call graph for this function:

◆ getReservedQuestionCollection()

ilTestRandomQuestionCollectionSubsetApplicationList::getReservedQuestionCollection ( )

◆ handleQuestionRequest()

ilTestRandomQuestionCollectionSubsetApplicationList::handleQuestionRequest ( ilTestRandomQuestionSetQuestion  $question)
Parameters
ilTestRandomQuestionSetQuestion$question

Definition at line 130 of file class.ilTestRandomQuestionCollectionSubsetApplicationList.php.

References addReservedQuestion(), and ilTestRandomQuestionSetQuestion\getQuestionId().

131  {
132  $questionReservationRequired = false;
133 
134  foreach ($this as $collectionSubsetApplication) {
135  if (!$collectionSubsetApplication->hasQuestion($question->getQuestionId())) {
136  continue;
137  }
138 
139  if ($collectionSubsetApplication->hasRequiredAmountLeft()) {
140  $questionReservationRequired = true;
141  $collectionSubsetApplication->decrementRequiredAmount();
142  }
143  }
144 
145  if ($questionReservationRequired) {
146  $this->addReservedQuestion($question);
147  }
148  }
+ Here is the call graph for this function:

◆ key()

ilTestRandomQuestionCollectionSubsetApplicationList::key ( )

Definition at line 112 of file class.ilTestRandomQuestionCollectionSubsetApplicationList.php.

Referenced by valid().

113  {
114  return key($this->collectionSubsetApplications);
115  }
+ Here is the caller graph for this function:

◆ next()

ilTestRandomQuestionCollectionSubsetApplicationList::next ( )

◆ resetCollectionSubsetApplicants()

ilTestRandomQuestionCollectionSubsetApplicationList::resetCollectionSubsetApplicants ( )

resetter for collectionSubsetApplicants

Definition at line 72 of file class.ilTestRandomQuestionCollectionSubsetApplicationList.php.

References array, and setCollectionSubsetApplications().

73  {
75  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ rewind()

ilTestRandomQuestionCollectionSubsetApplicationList::rewind ( )

Definition at line 122 of file class.ilTestRandomQuestionCollectionSubsetApplicationList.php.

123  {
124  return reset($this->collectionSubsetApplications);
125  }

◆ setCollectionSubsetApplications()

ilTestRandomQuestionCollectionSubsetApplicationList::setCollectionSubsetApplications (   $collectionSubsetApplications)
Parameters
ilTestRandomQuestionCollectionSubsetApplication[]$collectionSubsetApplications

Definition at line 64 of file class.ilTestRandomQuestionCollectionSubsetApplicationList.php.

References $collectionSubsetApplications.

Referenced by resetCollectionSubsetApplicants().

+ Here is the caller graph for this function:

◆ setReservedQuestionCollection()

ilTestRandomQuestionCollectionSubsetApplicationList::setReservedQuestionCollection (   $reservedQuestionCollection)
Parameters
ilTestRandomQuestionSetQuestionCollection$reservedQuestionCollection

Definition at line 88 of file class.ilTestRandomQuestionCollectionSubsetApplicationList.php.

References $reservedQuestionCollection.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ valid()

ilTestRandomQuestionCollectionSubsetApplicationList::valid ( )

Definition at line 117 of file class.ilTestRandomQuestionCollectionSubsetApplicationList.php.

References key().

118  {
119  return key($this->collectionSubsetApplications) !== null;
120  }
+ Here is the call graph for this function:

Field Documentation

◆ $collectionSubsetApplications

ilTestRandomQuestionCollectionSubsetApplicationList::$collectionSubsetApplications = array()
protected

◆ $reservedQuestionCollection

ilTestRandomQuestionCollectionSubsetApplicationList::$reservedQuestionCollection
protected

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