ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestSequenceFactory Class Reference
+ Collaboration diagram for ilTestSequenceFactory:

Public Member Functions

 __construct (private ilObjTest $test_obj, private ilDBInterface $db, private GeneralQuestionPropertiesRepository $questionrepository)
 
 getSequenceByTestSession ($testSession)
 creates and returns an instance of a test sequence that corresponds to the current test mode and the pass stored in test session More...
 
 getSequenceByActiveIdAndPass ($activeId, $pass)
 creates and returns an instance of a test sequence that corresponds to the current test mode and given active/pass More...
 

Private Attributes

array $test_sequences = []
 

Detailed Description

Definition at line 28 of file class.ilTestSequenceFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestSequenceFactory::__construct ( private ilObjTest  $test_obj,
private ilDBInterface  $db,
private GeneralQuestionPropertiesRepository  $questionrepository 
)

Definition at line 33 of file class.ilTestSequenceFactory.php.

37  {
38  }

Member Function Documentation

◆ getSequenceByActiveIdAndPass()

ilTestSequenceFactory::getSequenceByActiveIdAndPass (   $activeId,
  $pass 
)

creates and returns an instance of a test sequence that corresponds to the current test mode and given active/pass

Parameters
integer$activeId
integer$pass
Returns
ilTestSequenceFixedQuestionSet|ilTestSequenceRandomQuestionSet|ilTestSequenceSummaryProvider

Definition at line 60 of file class.ilTestSequenceFactory.php.

Referenced by getSequenceByTestSession().

61  {
62  if (!isset($this->test_sequences[$activeId][$pass])) {
63  if ($this->test_obj->isFixedTest()) {
64  $this->test_sequences[$activeId][$pass] = new ilTestSequenceFixedQuestionSet(
65  $this->db,
66  $activeId,
67  $pass,
68  $this->questionrepository
69  );
70  }
71 
72  if ($this->test_obj->isRandomTest()) {
73  $this->test_sequences[$activeId][$pass] = new ilTestSequenceRandomQuestionSet(
74  $this->db,
75  $activeId,
76  $pass,
77  $this->questionrepository
78  );
79  }
80  }
81 
82  return $this->test_sequences[$activeId][$pass];
83  }
+ Here is the caller graph for this function:

◆ getSequenceByTestSession()

ilTestSequenceFactory::getSequenceByTestSession (   $testSession)

creates and returns an instance of a test sequence that corresponds to the current test mode and the pass stored in test session

Parameters
ilTestSession$testSession
Returns
ilTestSequence

Definition at line 47 of file class.ilTestSequenceFactory.php.

References getSequenceByActiveIdAndPass().

48  {
49  return $this->getSequenceByActiveIdAndPass($testSession->getActiveId(), $testSession->getPass());
50  }
getSequenceByActiveIdAndPass($activeId, $pass)
creates and returns an instance of a test sequence that corresponds to the current test mode and give...
+ Here is the call graph for this function:

Field Documentation

◆ $test_sequences

array ilTestSequenceFactory::$test_sequences = []
private

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


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