ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

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 }

Referenced by getSequenceByTestSession().

+ 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.

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...

References getSequenceByActiveIdAndPass().

Referenced by ilTestPlayerAbstractGUI\executeCommand().

+ Here is the call graph for this function:
+ Here is the caller 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: