ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilTestSequenceFactory.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
5 
15 {
21  private $testSequences = array();
22 
28  private $db = null;
29 
35  private $lng = null;
36 
40  protected $refinery;
41 
47  private $pluginAdmin = null;
48 
54  private $testOBJ = null;
55 
62  {
63  $this->db = $db;
64  $this->lng = $lng;
65  $this->refinery = $refinery;
66  $this->pluginAdmin = $pluginAdmin;
67  $this->testOBJ = $testOBJ;
68  }
69 
77  public function getSequenceByTestSession($testSession)
78  {
79  return $this->getSequenceByActiveIdAndPass($testSession->getActiveId(), $testSession->getPass());
80  }
81 
90  public function getSequenceByActiveIdAndPass($activeId, $pass)
91  {
92  if ($this->testSequences[$activeId][$pass] === null) {
93  switch ($this->testOBJ->getQuestionSetType()) {
95 
96  require_once 'Modules/Test/classes/class.ilTestSequenceFixedQuestionSet.php';
97  $this->testSequences[$activeId][$pass] = new ilTestSequenceFixedQuestionSet(
98  $activeId,
99  $pass,
100  $this->testOBJ->isRandomTest()
101  );
102  break;
103 
105 
106  require_once 'Modules/Test/classes/class.ilTestSequenceRandomQuestionSet.php';
107  $this->testSequences[$activeId][$pass] = new ilTestSequenceRandomQuestionSet(
108  $activeId,
109  $pass,
110  $this->testOBJ->isRandomTest()
111  );
112  break;
113 
115 
116  require_once 'Modules/Test/classes/class.ilTestSequenceDynamicQuestionSet.php';
117  require_once 'Modules/Test/classes/class.ilTestDynamicQuestionSet.php';
118  $questionSet = new ilTestDynamicQuestionSet(
119  $this->db,
120  $this->lng,
121  $this->refinery,
122  $this->pluginAdmin,
123  $this->testOBJ
124  );
125  $this->testSequences[$activeId][$pass] = new ilTestSequenceDynamicQuestionSet(
126  $this->db,
127  $questionSet,
128  $activeId
129  );
130 
131  #$this->testSequence->setPreventCheckedQuestionsFromComingUpEnabled(
132  # $this->testOBJ->isInstantFeedbackAnswerFixationEnabled()
133  #); // checked questions now has to come up any time, so they can be set to unchecked right at this moment
134 
135  break;
136  }
137  }
138 
139  return $this->testSequences[$activeId][$pass];
140  }
141 }
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
Class ChatMainBarProvider .
__construct(ilDBInterface $db, ilLanguage $lng, \ILIAS\Refinery\Factory $refinery, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
constructor
Administration class for plugins.
getSequenceByTestSession($testSession)
creates and returns an instance of a test sequence that corresponds to the current test mode and the ...
getSequenceByActiveIdAndPass($activeId, $pass)
creates and returns an instance of a test sequence that corresponds to the current test mode and give...
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)