ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
83  switch( $questionSetType )
84  {
86 
87  require_once 'Modules/Test/classes/class.ilTestFixedQuestionSetConfig.php';
88  $this->testQuestionSetConfig = new ilTestFixedQuestionSetConfig(
89  $this->tree, $this->db, $this->pluginAdmin, $this->testOBJ
90  );
91  break;
92 
94 
95  require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetConfig.php';
96  $this->testQuestionSetConfig = new ilTestRandomQuestionSetConfig(
97  $this->tree, $this->db, $this->pluginAdmin, $this->testOBJ
98  );
99  break;
100 
102 
103  require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
104  $this->testQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig(
105  $this->tree, $this->db, $this->pluginAdmin, $this->testOBJ
106  );
107  break;
108  }
109 
110  $this->testQuestionSetConfig->loadFromDb();
111  }
112 
114  }
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: