ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ilObjTest\getQuestionsOfPass(), and getSequenceByTestSession().

83  {
84  if($this->testSequences[$activeId][$pass] === null)
85  {
86  switch( $this->testOBJ->getQuestionSetType() )
87  {
89 
90  require_once 'Modules/Test/classes/class.ilTestSequenceFixedQuestionSet.php';
91  $this->testSequences[$activeId][$pass] = new ilTestSequenceFixedQuestionSet(
92  $activeId, $pass, $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, $pass, $this->testOBJ->isRandomTest()
101  );
102  break;
103 
105 
106  require_once 'Modules/Test/classes/class.ilTestSequenceDynamicQuestionSet.php';
107  require_once 'Modules/Test/classes/class.ilTestDynamicQuestionSet.php';
108  $questionSet = new ilTestDynamicQuestionSet(
109  $this->db, $this->lng, $this->pluginAdmin, $this->testOBJ
110  );
111  $this->testSequences[$activeId][$pass] = new ilTestSequenceDynamicQuestionSet(
112  $this->db, $questionSet, $activeId
113  );
114 
115  #$this->testSequence->setPreventCheckedQuestionsFromComingUpEnabled(
116  # $this->testOBJ->isInstantFeedbackAnswerFixationEnabled()
117  #); // checked questions now has to come up any time, so they can be set to unchecked right at this moment
118 
119  break;
120  }
121  }
122 
123  return $this->testSequences[$activeId][$pass];
124  }
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: