ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestSequenceFactory Class Reference
+ Collaboration diagram for ilTestSequenceFactory:

Public Member Functions

 __construct (private ilObjTest $test_obj, private ilDBInterface $db, private \ILIAS\TestQuestionPool\QuestionInfoService $questioninfo)
 
 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 26 of file class.ilTestSequenceFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestSequenceFactory::__construct ( private ilObjTest  $test_obj,
private ilDBInterface  $db,
private \ILIAS\TestQuestionPool\QuestionInfoService  $questioninfo 
)

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

35  {
36  }

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 58 of file class.ilTestSequenceFactory.php.

Referenced by getSequenceByTestSession().

59  {
60  if (!isset($this->test_sequences[$activeId][$pass])) {
61  if ($this->test_obj->isFixedTest()) {
62  $this->test_sequences[$activeId][$pass] = new ilTestSequenceFixedQuestionSet(
63  $this->db,
64  $activeId,
65  $pass,
66  $this->questioninfo
67  );
68  }
69 
70  if ($this->test_obj->isRandomTest()) {
71  $this->test_sequences[$activeId][$pass] = new ilTestSequenceRandomQuestionSet(
72  $this->db,
73  $activeId,
74  $pass,
75  $this->questioninfo
76  );
77  }
78  }
79 
80  return $this->test_sequences[$activeId][$pass];
81  }
+ 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 45 of file class.ilTestSequenceFactory.php.

References getSequenceByActiveIdAndPass().

46  {
47  return $this->getSequenceByActiveIdAndPass($testSession->getActiveId(), $testSession->getPass());
48  }
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 29 of file class.ilTestSequenceFactory.php.


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