ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
class.ilTestQuestionSetConfigFactory.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
13 {
19  private $testQuestionSetConfig = null;
20 
26  private $tree = null;
27 
33  private $db = null;
34 
40  private $pluginAdmin = null;
41 
47  private $testOBJ = null;
48 
55  {
56  $this->tree = $tree;
57  $this->db = $db;
58  $this->pluginAdmin = $pluginAdmin;
59  $this->testOBJ = $testOBJ;
60  }
61 
68  public function getQuestionSetConfig()
69  {
70  return $this->getQuestionSetConfigByType( $this->testOBJ->getQuestionSetType() );
71  }
72 
79  public function getQuestionSetConfigByType($questionSetType)
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  }
115 }
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
__construct(ilTree $tree, ilDB $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
constructor
Administration class for plugins.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
getQuestionSetConfig()
creates and returns an instance of a test question set config that corresponds to the test&#39;s current ...
Database Wrapper.
Definition: class.ilDB.php:28
getQuestionSetConfigByType($questionSetType)
creates and returns an instance of a test question set config that corresponds to the passed question...
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)