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

Public Member Functions

 __construct (ilDBInterface $db, ilObjTest $test_obj, ilTestSequenceFactory $test_sequence_facory)
 
 getResponsibleSourcePoolDefinitionId (int $question_id)
 
- Public Member Functions inherited from ilTestVirtualSequence
 __construct (protected ilDBInterface $db, protected ilObjTest $test_obj, protected ilTestSequenceFactory $test_sequence_factory)
 
 getActiveId ()
 
 setActiveId (int $active_id)
 
 getQuestionIds ()
 
 getQuestionsPassMap ()
 
 getUniquePasses ()
 
 init ()
 

Protected Member Functions

 fetchQuestionsFromPasses (int $active_id, array $passes)
 
- Protected Member Functions inherited from ilTestVirtualSequence
 getTestSequence (int $active_id, int $pass)
 
 wasAnsweredInThisPass (ilTestSequence $test_sequence, int $question_id)
 
 fetchQuestionsFromPasses (int $active_id, array $passes)
 

Private Attributes

array $questions_source_pool_definition_map
 

Additional Inherited Members

- Protected Attributes inherited from ilTestVirtualSequence
int $active_id
 
array $questions_pass_map
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestVirtualSequenceRandomQuestionSet::__construct ( ilDBInterface  $db,
ilObjTest  $test_obj,
ilTestSequenceFactory  $test_sequence_facory 
)

Definition at line 31 of file class.ilTestVirtualSequenceRandomQuestionSet.php.

References ILIAS\GlobalScreen\Provider\__construct().

32  {
33  parent::__construct($db, $test_obj, $test_sequence_facory);
34 
35  $this->questions_source_pool_definition_map = [];
36  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ fetchQuestionsFromPasses()

ilTestVirtualSequenceRandomQuestionSet::fetchQuestionsFromPasses ( int  $active_id,
array  $passes 
)
protected

Definition at line 43 of file class.ilTestVirtualSequenceRandomQuestionSet.php.

References ilTestVirtualSequence\getTestSequence(), and ilTestVirtualSequence\wasAnsweredInThisPass().

43  : void
44  {
45  $this->questions_pass_map = [];
46 
47  foreach ($passes as $pass) {
48  $handled_source_pool_definitions = array_flip($this->questions_source_pool_definition_map);
49 
50  $test_sequence = $this->getTestSequence($active_id, $pass);
51 
52  foreach ($test_sequence->getOrderedSequenceQuestions() as $question_id) {
53  $definition_id = $test_sequence->getResponsibleSourcePoolDefinitionId($question_id);
54 
55  if (isset($handled_source_pool_definitions[$definition_id])) {
56  continue;
57  }
58 
59  if ($this->wasAnsweredInThisPass($test_sequence, $question_id)) {
60  $this->questions_pass_map[$question_id] = $pass;
61 
62  $this->questions_source_pool_definition_map[$question_id] = $definition_id;
63  }
64  }
65  }
66  }
getTestSequence(int $active_id, int $pass)
wasAnsweredInThisPass(ilTestSequence $test_sequence, int $question_id)
+ Here is the call graph for this function:

◆ getResponsibleSourcePoolDefinitionId()

ilTestVirtualSequenceRandomQuestionSet::getResponsibleSourcePoolDefinitionId ( int  $question_id)

Implements ilTestRandomQuestionSequence.

Definition at line 38 of file class.ilTestVirtualSequenceRandomQuestionSet.php.

38  : ?int
39  {
40  return $this->questions_source_pool_definition_map[$question_id];
41  }

Field Documentation

◆ $questions_source_pool_definition_map

array ilTestVirtualSequenceRandomQuestionSet::$questions_source_pool_definition_map
private

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