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

Public Member Functions

 __construct (ilTree $tree, ilDBInterface $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
 constructor More...
 
 getQuestionSetConfig ()
 creates and returns an instance of a test question set config that corresponds to the test's current question set type (test mode) More...
 
 getQuestionSetConfigByType ($questionSetType)
 creates and returns an instance of a test question set config that corresponds to the passed question set type (test mode) More...
 

Private Attributes

 $testQuestionSetConfig = null
 
 $tree = null
 
 $db = null
 
 $pluginAdmin = null
 
 $testOBJ = null
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestQuestionSetConfigFactory::__construct ( ilTree  $tree,
ilDBInterface  $db,
ilPluginAdmin  $pluginAdmin,
ilObjTest  $testOBJ 
)

Member Function Documentation

◆ getQuestionSetConfig()

ilTestQuestionSetConfigFactory::getQuestionSetConfig ( )

creates and returns an instance of a test question set config that corresponds to the test's current question set type (test mode)

Returns
ilTestQuestionSetConfig

Definition at line 68 of file class.ilTestQuestionSetConfigFactory.php.

References getQuestionSetConfigByType().

69  {
70  return $this->getQuestionSetConfigByType($this->testOBJ->getQuestionSetType());
71  }
getQuestionSetConfigByType($questionSetType)
creates and returns an instance of a test question set config that corresponds to the passed question...
+ Here is the call graph for this function:

◆ getQuestionSetConfigByType()

ilTestQuestionSetConfigFactory::getQuestionSetConfigByType (   $questionSetType)

creates and returns an instance of a test question set config that corresponds to the passed question set type (test mode)

Returns
ilTestQuestionSetConfig

Definition at line 79 of file class.ilTestQuestionSetConfigFactory.php.

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

Referenced by getQuestionSetConfig().

80  {
81  if ($this->testQuestionSetConfig === null) {
82  switch ($questionSetType) {
84 
85  require_once 'Modules/Test/classes/class.ilTestFixedQuestionSetConfig.php';
86  $this->testQuestionSetConfig = new ilTestFixedQuestionSetConfig(
87  $this->tree,
88  $this->db,
89  $this->pluginAdmin,
90  $this->testOBJ
91  );
92  break;
93 
95 
96  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetConfig.php';
97  $this->testQuestionSetConfig = new ilTestRandomQuestionSetConfig(
98  $this->tree,
99  $this->db,
100  $this->pluginAdmin,
101  $this->testOBJ
102  );
103  break;
104 
106 
107  require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
108  $this->testQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig(
109  $this->tree,
110  $this->db,
111  $this->pluginAdmin,
112  $this->testOBJ
113  );
114  break;
115  }
116 
117  $this->testQuestionSetConfig->loadFromDb();
118  }
119 
121  }
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

ilTestQuestionSetConfigFactory::$db = null
private

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

Referenced by __construct().

◆ $pluginAdmin

ilTestQuestionSetConfigFactory::$pluginAdmin = null
private

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

Referenced by __construct().

◆ $testOBJ

ilTestQuestionSetConfigFactory::$testOBJ = null
private

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

Referenced by __construct().

◆ $testQuestionSetConfig

ilTestQuestionSetConfigFactory::$testQuestionSetConfig = null
private

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

Referenced by getQuestionSetConfigByType().

◆ $tree

ilTestQuestionSetConfigFactory::$tree = null
private

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

Referenced by __construct().


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