ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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
13{
19 private $testSequence = null;
20
26 private $db = null;
27
33 private $lng = null;
34
40 private $pluginAdmin = null;
41
47 private $testOBJ = null;
48
55 {
56 $this->db = $db;
57 $this->lng = $lng;
58 $this->pluginAdmin = $pluginAdmin;
59 $this->testOBJ = $testOBJ;
60 }
61
69 public function getSequence($testSession)
70 {
71 return $this->getSequenceByPass($testSession, $testSession->getPass());
72 }
73
82 public function getSequenceByPass($testSession, $pass)
83 {
84 if($this->testSequence === null)
85 {
86 switch( $this->testOBJ->getQuestionSetType() )
87 {
89
90 require_once 'Modules/Test/classes/class.ilTestSequenceFixedQuestionSet.php';
91 $this->testSequence = new ilTestSequenceFixedQuestionSet(
92 $testSession->getActiveId(), $pass, $this->testOBJ->isRandomTest()
93 );
94 break;
95
97
98 require_once 'Modules/Test/classes/class.ilTestSequenceRandomQuestionSet.php';
99 $this->testSequence = new ilTestSequenceRandomQuestionSet(
100 $testSession->getActiveId(), $pass, $this->testOBJ->isRandomTest()
101 );
102 break;
103
105
106 require_once 'Modules/Test/classes/class.ilTestSequenceDynamicQuestionSet.php';
107 require_once 'Modules/Test/classes/class.ilTestDynamicQuestionSet.php';
108 $questionSet = new ilTestDynamicQuestionSet(
109 $this->db, $this->lng, $this->pluginAdmin, $this->testOBJ
110 );
111 $this->testSequence = new ilTestSequenceDynamicQuestionSet(
112 $this->db, $questionSet, $testSession->getActiveId()
113 );
114
115 #$this->testSequence->setPreventCheckedQuestionsFromComingUpEnabled(
116 # $this->testOBJ->isInstantFeedbackAnswerFixationEnabled()
117 #); // checked questions now has to come up any time, so they can be set to unchecked right at this moment
118
119 break;
120 }
121 }
122
123 return $this->testSequence;
124 }
125}
Database Wrapper.
Definition: class.ilDB.php:29
language handling
const QUESTION_SET_TYPE_DYNAMIC
type setting value for dynamic question set (continues testing mode)
const QUESTION_SET_TYPE_RANDOM
type setting value for random question set
const QUESTION_SET_TYPE_FIXED
type setting value for fixed question set
Administration class for plugins.
getSequenceByPass($testSession, $pass)
creates and returns an instance of a test sequence that corresponds to the current test mode and give...
__construct(ilDB $db, ilLanguage $lng, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
constructor
getSequence($testSession)
creates and returns an instance of a test sequence that corresponds to the current test mode and the ...