ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestSequenceFactory Class Reference
+ Collaboration diagram for ilTestSequenceFactory:

Public Member Functions

 __construct (ilDBInterface $db, ilLanguage $lng, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
 constructor More...
 
 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

 $testSequences = array()
 
 $db = null
 
 $lng = null
 
 $pluginAdmin = null
 
 $testOBJ = null
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestSequenceFactory::__construct ( ilDBInterface  $db,
ilLanguage  $lng,
ilPluginAdmin  $pluginAdmin,
ilObjTest  $testOBJ 
)

constructor

Parameters
ilObjTest$testOBJ

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

References $db, $lng, $pluginAdmin, and $testOBJ.

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

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

References $pass, ilObjTest\QUESTION_SET_TYPE_DYNAMIC, ilObjTest\QUESTION_SET_TYPE_FIXED, and ilObjTest\QUESTION_SET_TYPE_RANDOM.

Referenced by getSequenceByTestSession().

83  {
84  if ($this->testSequences[$activeId][$pass] === null) {
85  switch ($this->testOBJ->getQuestionSetType()) {
87 
88  require_once 'Modules/Test/classes/class.ilTestSequenceFixedQuestionSet.php';
89  $this->testSequences[$activeId][$pass] = new ilTestSequenceFixedQuestionSet(
90  $activeId,
91  $pass,
92  $this->testOBJ->isRandomTest()
93  );
94  break;
95 
97 
98  require_once 'Modules/Test/classes/class.ilTestSequenceRandomQuestionSet.php';
99  $this->testSequences[$activeId][$pass] = new ilTestSequenceRandomQuestionSet(
100  $activeId,
101  $pass,
102  $this->testOBJ->isRandomTest()
103  );
104  break;
105 
107 
108  require_once 'Modules/Test/classes/class.ilTestSequenceDynamicQuestionSet.php';
109  require_once 'Modules/Test/classes/class.ilTestDynamicQuestionSet.php';
110  $questionSet = new ilTestDynamicQuestionSet(
111  $this->db,
112  $this->lng,
113  $this->pluginAdmin,
114  $this->testOBJ
115  );
116  $this->testSequences[$activeId][$pass] = new ilTestSequenceDynamicQuestionSet(
117  $this->db,
118  $questionSet,
119  $activeId
120  );
121 
122  #$this->testSequence->setPreventCheckedQuestionsFromComingUpEnabled(
123  # $this->testOBJ->isInstantFeedbackAnswerFixationEnabled()
124  #); // checked questions now has to come up any time, so they can be set to unchecked right at this moment
125 
126  break;
127  }
128  }
129 
130  return $this->testSequences[$activeId][$pass];
131  }
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)
+ 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 69 of file class.ilTestSequenceFactory.php.

References getSequenceByActiveIdAndPass().

70  {
71  return $this->getSequenceByActiveIdAndPass($testSession->getActiveId(), $testSession->getPass());
72  }
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

◆ $db

ilTestSequenceFactory::$db = null
private

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

Referenced by __construct().

◆ $lng

ilTestSequenceFactory::$lng = null
private

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

Referenced by __construct().

◆ $pluginAdmin

ilTestSequenceFactory::$pluginAdmin = null
private

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

Referenced by __construct().

◆ $testOBJ

ilTestSequenceFactory::$testOBJ = null
private

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

Referenced by __construct().

◆ $testSequences

ilTestSequenceFactory::$testSequences = array()
private

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


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