ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestSequenceFactory Class Reference
+ Collaboration diagram for ilTestSequenceFactory:

Public Member Functions

 __construct (ilDB $db, ilLanguage $lng, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
 constructor More...
 
 getSequence ($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...
 
 getSequenceByPass ($testSession, $pass)
 creates and returns an instance of a test sequence that corresponds to the current test mode and given pass More...
 

Private Attributes

 $testSequence = null
 
 $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 ( ilDB  $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

◆ getSequence()

ilTestSequenceFactory::getSequence (   $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 getSequenceByPass().

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

◆ getSequenceByPass()

ilTestSequenceFactory::getSequenceByPass (   $testSession,
  $pass 
)

creates and returns an instance of a test sequence that corresponds to the current test mode and given pass

Parameters
ilTestSession | ilTestSessionDynamicQuestionSet$testSession
integer$pass
Returns
ilTestSequence|ilTestSequenceDynamicQuestionSet

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

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

Referenced by getSequence().

83  {
84  if($this->testSequence === null)
85  {
86  switch( $this->testOBJ->getQuestionSetType() )
87  {
89 
90  require_once 'Modules/Test/classes/class.ilTestSequenceFixedQuestionSet.php';
91  $this->testSequence = new ilTestSequenceFixedQuestionSet(
92  $testSession->getActiveId(), $pass, $this->testOBJ->isRandomTest()
93  );
94  break;
95 
97 
98  require_once 'Modules/Test/classes/class.ilTestSequenceRandomQuestionSet.php';
99  $this->testSequence = new ilTestSequenceRandomQuestionSet(
100  $testSession->getActiveId(), $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->testSequence = new ilTestSequenceDynamicQuestionSet(
112  $this->db, $questionSet, $testSession->getActiveId()
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->testSequence;
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:

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().

◆ $testSequence

ilTestSequenceFactory::$testSequence = null
private

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

Referenced by getSequenceByPass().


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