ILIAS  release_7 Revision v7.30-3-g800a261c036
ilTestSequenceFactory Class Reference
+ Collaboration diagram for ilTestSequenceFactory:

Public Member Functions

 __construct (ilDBInterface $db, ilLanguage $lng, \ILIAS\Refinery\Factory $refinery, 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...
 

Protected Attributes

 $refinery
 

Private Attributes

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

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestSequenceFactory::__construct ( ilDBInterface  $db,
ilLanguage  $lng,
\ILIAS\Refinery\Factory  $refinery,
ilPluginAdmin  $pluginAdmin,
ilObjTest  $testOBJ 
)

constructor

Parameters
ilObjTest$testOBJ

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

References $db, $lng, $pluginAdmin, $refinery, 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 90 of file class.ilTestSequenceFactory.php.

91 {
92 if ($this->testSequences[$activeId][$pass] === null) {
93 switch ($this->testOBJ->getQuestionSetType()) {
95
96 require_once 'Modules/Test/classes/class.ilTestSequenceFixedQuestionSet.php';
97 $this->testSequences[$activeId][$pass] = new ilTestSequenceFixedQuestionSet(
98 $activeId,
99 $pass,
100 $this->testOBJ->isRandomTest()
101 );
102 break;
103
105
106 require_once 'Modules/Test/classes/class.ilTestSequenceRandomQuestionSet.php';
107 $this->testSequences[$activeId][$pass] = new ilTestSequenceRandomQuestionSet(
108 $activeId,
109 $pass,
110 $this->testOBJ->isRandomTest()
111 );
112 break;
113
115
116 require_once 'Modules/Test/classes/class.ilTestSequenceDynamicQuestionSet.php';
117 require_once 'Modules/Test/classes/class.ilTestDynamicQuestionSet.php';
118 $questionSet = new ilTestDynamicQuestionSet(
119 $this->db,
120 $this->lng,
121 $this->refinery,
122 $this->pluginAdmin,
123 $this->testOBJ
124 );
125 $this->testSequences[$activeId][$pass] = new ilTestSequenceDynamicQuestionSet(
126 $this->db,
127 $questionSet,
128 $activeId
129 );
130
131 #$this->testSequence->setPreventCheckedQuestionsFromComingUpEnabled(
132 # $this->testOBJ->isInstantFeedbackAnswerFixationEnabled()
133 #); // checked questions now has to come up any time, so they can be set to unchecked right at this moment
134
135 break;
136 }
137 }
138
139 return $this->testSequences[$activeId][$pass];
140 }
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set

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

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 | ilTestSessionDynamicQuestionSet$testSession
Returns
ilTestSequence|ilTestSequenceDynamicQuestionSet

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

78 {
79 return $this->getSequenceByActiveIdAndPass($testSession->getActiveId(), $testSession->getPass());
80 }
getSequenceByActiveIdAndPass($activeId, $pass)
creates and returns an instance of a test sequence that corresponds to the current test mode and give...

References getSequenceByActiveIdAndPass().

+ Here is the call graph for this function:

Field Documentation

◆ $db

ilTestSequenceFactory::$db = null
private

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

Referenced by __construct().

◆ $lng

ilTestSequenceFactory::$lng = null
private

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

Referenced by __construct().

◆ $pluginAdmin

ilTestSequenceFactory::$pluginAdmin = null
private

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

Referenced by __construct().

◆ $refinery

ilTestSequenceFactory::$refinery
protected

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

Referenced by __construct().

◆ $testOBJ

ilTestSequenceFactory::$testOBJ = null
private

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

Referenced by __construct().

◆ $testSequences

ilTestSequenceFactory::$testSequences = array()
private

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


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