ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestQuestionSetConfigFactory Class Reference
+ Collaboration diagram for ilTestQuestionSetConfigFactory:

Public Member Functions

 __construct (ilTree $tree, ilDBInterface $db, ilComponentRepository $component_repository, ilObjTest $testOBJ)
 
 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 ()
 creates and returns an instance of a test question set config that corresponds to the passed question set type (test mode) More...
 

Private Attributes

ilTree $tree
 
ilDBInterface $db
 
ilComponentRepository $component_repository
 
ilObjTest $testOBJ
 
ilTestQuestionSetConfig $testQuestionSetConfig = null
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestQuestionSetConfigFactory::__construct ( ilTree  $tree,
ilDBInterface  $db,
ilComponentRepository  $component_repository,
ilObjTest  $testOBJ 
)

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

References $component_repository, $db, $testOBJ, and $tree.

40  {
41  $this->tree = $tree;
42  $this->db = $db;
43  $this->component_repository = $component_repository;
44  $this->testOBJ = $testOBJ;
45  }

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)

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

References getQuestionSetConfigByType().

52  {
53  return $this->getQuestionSetConfigByType();
54  }
getQuestionSetConfigByType()
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 ( )

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

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

References $testQuestionSetConfig.

Referenced by getQuestionSetConfig().

61  {
62  if ($this->testQuestionSetConfig === null) {
63  if ($this->testOBJ->isFixedTest()) {
64  $this->testQuestionSetConfig = new ilTestFixedQuestionSetConfig(
65  $this->tree,
66  $this->db,
67  $this->component_repository,
68  $this->testOBJ
69  );
70  }
71  if ($this->testOBJ->isRandomTest()) {
72  $this->testQuestionSetConfig = new ilTestRandomQuestionSetConfig(
73  $this->tree,
74  $this->db,
75  $this->component_repository,
76  $this->testOBJ
77  );
78  }
79 
80  if ($this->testOBJ->isDynamicTest()) {
81  $this->testQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig(
82  $this->tree,
83  $this->db,
84  $this->component_repository,
85  $this->testOBJ
86  );
87  }
88 
89  $this->testQuestionSetConfig->loadFromDb();
90  }
91 
93  }
+ Here is the caller graph for this function:

Field Documentation

◆ $component_repository

ilComponentRepository ilTestQuestionSetConfigFactory::$component_repository
private

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

Referenced by __construct().

◆ $db

ilDBInterface ilTestQuestionSetConfigFactory::$db
private

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

Referenced by __construct().

◆ $testOBJ

ilObjTest ilTestQuestionSetConfigFactory::$testOBJ
private

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

Referenced by __construct().

◆ $testQuestionSetConfig

ilTestQuestionSetConfig ilTestQuestionSetConfigFactory::$testQuestionSetConfig = null
private

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

Referenced by getQuestionSetConfigByType().

◆ $tree

ilTree ilTestQuestionSetConfigFactory::$tree
private

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

Referenced by __construct().


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