ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestSequenceFactory Class Reference
+ Collaboration diagram for ilTestSequenceFactory:

Public Member Functions

 __construct (ilDBInterface $db, ilLanguage $lng, Refinery $refinery, ilComponentRepository $component_repository, ilObjTest $testOBJ)
 
 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 $testSequences = []
 
ilDBInterface $db
 
ilLanguage $lng
 
Refinery $refinery
 
ilComponentRepository $component_repository
 
ilObjTest $testOBJ
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestSequenceFactory::__construct ( ilDBInterface  $db,
ilLanguage  $lng,
Refinery  $refinery,
ilComponentRepository  $component_repository,
ilObjTest  $testOBJ 
)

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

References $component_repository, $db, $lng, $refinery, $testOBJ, ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

42  {
43  $this->db = $db;
44  $this->lng = $lng;
45  $this->refinery = $refinery;
46  $this->component_repository = $component_repository;
47  $this->testOBJ = $testOBJ;
48  }
ilComponentRepository $component_repository
+ Here is the call graph for this function:

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|ilTestSequenceDynamicQuestionSet|ilTestSequenceSummaryProvider

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

References ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

Referenced by getSequenceByTestSession().

71  {
72  if (!isset($this->testSequences[$activeId][$pass])) {
73  if ($this->testOBJ->isFixedTest()) {
74  $this->testSequences[$activeId][$pass] = new ilTestSequenceFixedQuestionSet(
75  $activeId,
76  $pass,
77  $this->testOBJ->isRandomTest()
78  );
79  }
80 
81  if ($this->testOBJ->isRandomTest()) {
82  $this->testSequences[$activeId][$pass] = new ilTestSequenceRandomQuestionSet(
83  $activeId,
84  $pass,
85  $this->testOBJ->isRandomTest()
86  );
87  }
88 
89  if ($this->testOBJ->isDynamicTest()) {
90  $questionSet = new ilTestDynamicQuestionSet(
91  $this->db,
92  $this->lng,
93  $this->refinery,
94  $this->component_repository,
95  $this->testOBJ
96  );
97  $this->testSequences[$activeId][$pass] = new ilTestSequenceDynamicQuestionSet(
98  $this->db,
99  $questionSet,
100  $activeId
101  );
102  }
103  }
104 
105  return $this->testSequences[$activeId][$pass];
106  }
+ Here is the call graph for this function:
+ 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 | ilTestSessionDynamicQuestionSet$testSession
Returns
ilTestSequence|ilTestSequenceDynamicQuestionSet

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

References getSequenceByActiveIdAndPass().

58  {
59  return $this->getSequenceByActiveIdAndPass($testSession->getActiveId(), $testSession->getPass());
60  }
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

◆ $component_repository

ilComponentRepository ilTestSequenceFactory::$component_repository
private

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

Referenced by __construct().

◆ $db

ilDBInterface ilTestSequenceFactory::$db
private

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

Referenced by __construct().

◆ $lng

ilLanguage ilTestSequenceFactory::$lng
private

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

Referenced by __construct().

◆ $refinery

Refinery ilTestSequenceFactory::$refinery
private

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

Referenced by __construct().

◆ $testOBJ

ilObjTest ilTestSequenceFactory::$testOBJ
private

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

Referenced by __construct().

◆ $testSequences

array ilTestSequenceFactory::$testSequences = []
private

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


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