ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestSequenceFixedQuestionSet Class Reference
+ Inheritance diagram for ilTestSequenceFixedQuestionSet:
+ Collaboration diagram for ilTestSequenceFixedQuestionSet:

Public Member Functions

 removeQuestion (int $question_id, ilTestReindexedSequencePositionMap $reindexedSequencePositionMap)
 
- Public Member Functions inherited from ilTestSequence
 __construct (protected ilDBInterface $db, protected int $active_id, protected int $pass, protected GeneralQuestionPropertiesRepository $questionrepository)
 ilTestSequence constructor More...
 
 getActiveId ()
 
 createNewSequence (int $max, bool $shuffle)
 
 loadQuestions ()
 Loads the question mapping. More...
 
 loadFromDb ()
 Loads the sequence data for a given active id. More...
 
 saveToDb ()
 Saves the sequence data for a given pass to the database. More...
 
 postponeQuestion (int $question_id)
 
 hideQuestion (int $question_id)
 
 isPostponedQuestion (int $question_id)
 
 isHiddenQuestion (int $question_id)
 
 isPostponedSequence (int $sequence)
 
 isHiddenSequence (int $sequence)
 
 postponeSequence (int $sequence)
 
 hideSequence (int $sequence)
 
 setQuestionPresented (int $question_id)
 
 isQuestionPresented (int $question_id)
 
 isNextQuestionPresented (int $question_id)
 
 setQuestionChecked (int $question_id)
 
 isQuestionChecked (int $question_id)
 
 getPositionOfSequence (int $sequence)
 
 getUserQuestionCount ()
 
 getOrderedSequence ()
 
 getOrderedSequenceQuestions ()
 
 getUserSequence ()
 
 getUserSequenceQuestions ()
 
 getSequenceForQuestion (int $question_id)
 
 getFirstSequence ()
 
 getLastSequence ()
 
 getNextSequence (int $sequence)
 
 getPreviousSequence (int $sequence)
 
 pcArrayShuffle (array $array)
 Shuffles the values of a given array. More...
 
 getQuestionForSequence (int $sequence)
 
 getSequenceSummary ()
 
 getPass ()
 
 setPass (int $pass)
 
 hasSequence ()
 
 hasHiddenQuestions ()
 
 clearHiddenQuestions ()
 
 hasStarted (ilTestSession $testSession)
 
 openQuestionExists ()
 
 getQuestionIds ()
 
 questionExists (int $question_id)
 
 setQuestionOptional (int $question_id)
 
 isQuestionOptional (int $question_id)
 
 hasOptionalQuestions ()
 
 getOptionalQuestions ()
 
 clearOptionalQuestions ()
 
 reorderOptionalQuestionsToSequenceEnd ()
 
 isAnsweringOptionalQuestionsConfirmed ()
 
 setAnsweringOptionalQuestionsConfirmed (bool $answeringOptionalQuestionsConfirmed)
 
 isConsiderHiddenQuestionsEnabled ()
 
 setConsiderHiddenQuestionsEnabled (bool $considerHiddenQuestionsEnabled)
 
 isConsiderOptionalQuestionsEnabled ()
 
 setConsiderOptionalQuestionsEnabled (bool $considerOptionalQuestionsEnabled)
 

Private Member Functions

 removeArrayValue (array $array, int $value)
 

Additional Inherited Members

- Data Fields inherited from ilTestSequence
array $sequencedata
 An array containing the sequence data. More...
 
array $questions
 The mapping of the sequence numbers to the questions. More...
 
- Protected Member Functions inherited from ilTestSequence
 loadPresentedQuestions ()
 
 saveNewlyPresentedQuestion ()
 
 getCorrectedSequence ()
 
- Protected Attributes inherited from ilTestSequence
array $alreadyPresentedQuestions = []
 
int $newlyPresentedQuestion = 0
 
array $alreadyCheckedQuestions = []
 
int $newlyCheckedQuestion = null
 
array $optionalQuestions = []
 

Detailed Description

Definition at line 27 of file class.ilTestSequenceFixedQuestionSet.php.

Member Function Documentation

◆ removeArrayValue()

ilTestSequenceFixedQuestionSet::removeArrayValue ( array  $array,
int  $value 
)
private

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

Referenced by removeQuestion().

56  : array
57  {
58  foreach ($array as $key => $val) {
59  if ($val == $value) {
60  unset($array[$key]);
61  }
62  }
63 
64  return $array;
65  }
+ Here is the caller graph for this function:

◆ removeQuestion()

ilTestSequenceFixedQuestionSet::removeQuestion ( int  $question_id,
ilTestReindexedSequencePositionMap  $reindexedSequencePositionMap 
)
Parameters
ilTestReindexedSequencePositionMap$reindexedSequencePositionMap

Definition at line 32 of file class.ilTestSequenceFixedQuestionSet.php.

References ilTestReindexedSequencePositionMap\getNewSequencePosition(), and removeArrayValue().

32  : void
33  {
34  foreach ($this->sequencedata['sequence'] as $key => $oldSequenceElement) {
35  $newSequenceElement = $reindexedSequencePositionMap->getNewSequencePosition($oldSequenceElement);
36 
37  if ($newSequenceElement) {
38  $this->sequencedata['sequence'][$key] = $newSequenceElement;
39  } else {
40  unset($this->sequencedata['sequence'][$key]);
41  }
42  }
43 
44  $this->sequencedata['sequence'] = array_values($this->sequencedata['sequence']);
45 
46  $this->sequencedata['postponed'] = $this->removeArrayValue($this->sequencedata['postponed'], $question_id);
47  $this->sequencedata['hidden'] = $this->removeArrayValue($this->sequencedata['hidden'], $question_id);
48 
49  $this->optionalQuestions = $this->removeArrayValue($this->optionalQuestions, $question_id);
50 
51  $this->alreadyPresentedQuestions = $this->removeArrayValue($this->alreadyPresentedQuestions, $question_id);
52 
53  $this->alreadyCheckedQuestions = $this->removeArrayValue($this->alreadyCheckedQuestions, $question_id);
54  }
+ Here is the call graph for this function:

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