ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestSequenceFixedQuestionSet Class Reference
+ Inheritance diagram for ilTestSequenceFixedQuestionSet:
+ Collaboration diagram for ilTestSequenceFixedQuestionSet:

Public Member Functions

 removeQuestion ($questionId, ilTestReindexedSequencePositionMap $reindexedSequencePositionMap)
 
- Public Member Functions inherited from ilTestSequence
 __construct ($active_id, $pass, $randomtest)
 ilTestSequence constructor More...
 
 getActiveId ()
 
 createNewSequence ($max, $shuffle)
 
 loadQuestions (ilTestQuestionSetConfig $testQuestionSetConfig=null, $taxonomyFilterSelection=array())
 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 ($question_id)
 
 hideQuestion ($question_id)
 
 isPostponedQuestion ($question_id)
 
 isHiddenQuestion ($question_id)
 
 isPostponedSequence ($sequence)
 
 isHiddenSequence ($sequence)
 
 postponeSequence ($sequence)
 
 hideSequence ($sequence)
 
 setQuestionPresented ($questionId)
 
 isQuestionPresented ($questionId)
 
 isNextQuestionPresented ($questionId)
 
 setQuestionChecked ($questionId)
 
 isQuestionChecked ($questionId)
 
 getPositionOfSequence ($sequence)
 
 getUserQuestionCount ()
 
 getOrderedSequence ()
 
 getOrderedSequenceQuestions ()
 
 getUserSequence ()
 
 getUserSequenceQuestions ()
 
 getSequenceForQuestion ($question_id)
 
 getFirstSequence ()
 
 getLastSequence ()
 
 getNextSequence ($sequence)
 
 getPreviousSequence ($sequence)
 
 pcArrayShuffle ($array)
 Shuffles the values of a given array. More...
 
 getQuestionForSequence ($sequence)
 
 getSequenceSummary ($obligationsFilterEnabled=false)
 
 getPass ()
 
 setPass ($pass)
 
 hasSequence ()
 
 hasHiddenQuestions ()
 
 clearHiddenQuestions ()
 
 hasStarted (ilTestSession $testSession)
 
 openQuestionExists ()
 
 getQuestionIds ()
 
 questionExists ($questionId)
 
 setQuestionOptional ($questionId)
 
 isQuestionOptional ($questionId)
 
 hasOptionalQuestions ()
 
 getOptionalQuestions ()
 
 clearOptionalQuestions ()
 
 reorderOptionalQuestionsToSequenceEnd ()
 
 isAnsweringOptionalQuestionsConfirmed ()
 
 setAnsweringOptionalQuestionsConfirmed ($answeringOptionalQuestionsConfirmed)
 
 isConsiderHiddenQuestionsEnabled ()
 
 setConsiderHiddenQuestionsEnabled ($considerHiddenQuestionsEnabled)
 
 isConsiderOptionalQuestionsEnabled ()
 
 setConsiderOptionalQuestionsEnabled ($considerOptionalQuestionsEnabled)
 

Private Member Functions

 removeArrayValue ($array, $value)
 

Additional Inherited Members

- Data Fields inherited from ilTestSequence
 $sequencedata
 
 $questions
 
 $active_id
 
 $pass
 
 $isRandomTest
 
- Protected Member Functions inherited from ilTestSequence
 loadPresentedQuestions ()
 
 saveNewlyPresentedQuestion ()
 
 getCorrectedSequence ()
 
- Protected Attributes inherited from ilTestSequence
 $alreadyPresentedQuestions = array()
 
 $newlyPresentedQuestion = 0
 
 $alreadyCheckedQuestions
 
 $newlyCheckedQuestion
 
 $optionalQuestions
 

Detailed Description

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

Member Function Documentation

◆ removeArrayValue()

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

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

References $key.

Referenced by removeQuestion().

43  {
44  foreach ($array as $key => $val) {
45  if ($val == $value) {
46  unset($array[$key]);
47  }
48  }
49 
50  return $array;
51  }
$key
Definition: croninfo.php:18
+ Here is the caller graph for this function:

◆ removeQuestion()

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

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

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

19  {
20  foreach ($this->sequencedata['sequence'] as $key => $oldSequenceElement) {
21  $newSequenceElement = $reindexedSequencePositionMap->getNewSequencePosition($oldSequenceElement);
22 
23  if ($newSequenceElement) {
24  $this->sequencedata['sequence'][$key] = $newSequenceElement;
25  } else {
26  unset($this->sequencedata['sequence'][$key]);
27  }
28  }
29 
30  $this->sequencedata['sequence'] = array_values($this->sequencedata['sequence']);
31 
32  $this->sequencedata['postponed'] = $this->removeArrayValue($this->sequencedata['postponed'], $questionId);
33  $this->sequencedata['hidden'] = $this->removeArrayValue($this->sequencedata['hidden'], $questionId);
34 
35  $this->optionalQuestions = $this->removeArrayValue($this->optionalQuestions, $questionId);
36 
37  $this->alreadyPresentedQuestions = $this->removeArrayValue($this->alreadyPresentedQuestions, $questionId);
38 
39  $this->alreadyCheckedQuestions = $this->removeArrayValue($this->alreadyCheckedQuestions, $questionId);
40  }
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

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