ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestFixedQuestionSetConfig Class Reference
+ Inheritance diagram for ilTestFixedQuestionSetConfig:
+ Collaboration diagram for ilTestFixedQuestionSetConfig:

Public Member Functions

 isQuestionSetConfigured ()
 returns the fact wether a useable question set config exists or not More...
 
 doesQuestionSetRelatedDataExist ()
 returns the fact wether a useable question set config exists or not More...
 
 removeQuestionSetRelatedData ()
 removes all question set config related data More...
 
 resetQuestionSetRelatedTestSettings ()
 resets all test settings that depends on a non changed question set config More...
 
 cloneQuestionSetRelatedData (ilObjTest $cloneTestOBJ)
 removes all question set config related data for cloned/copied test More...
 
 loadFromDb ()
 loads the question set config for current test from the database More...
 
 saveToDb ()
 saves the question set config for current test to the database More...
 
 reindexQuestionOrdering ()
 
 cloneToDbForTestId ($testId)
 saves the question set config for test with given id to the database More...
 
 deleteFromDb ()
 deletes the question set config for current test from the database More...
 
 isResultTaxonomyFilterSupported ()
 
- Public Member Functions inherited from ilTestQuestionSetConfig
 __construct (ilTree $tree, ilDBInterface $db, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
 
 loadFromDb ()
 loads the question set config for current test from the database More...
 
 saveToDb ()
 saves the question set config for current test to the database More...
 
 cloneToDbForTestId ($testId)
 saves the question set config for test with given id to the database More...
 
 deleteFromDb ()
 deletes the question set config for current test from the database More...
 
 areDepenciesInVulnerableState ()
 
 getDepenciesInVulnerableStateMessage (ilLanguage $lng)
 
 areDepenciesBroken ()
 
 getDepenciesBrokenMessage (ilLanguage $lng)
 
 isValidRequestOnBrokenQuestionSetDepencies ($nextClass, $cmd)
 
 getHiddenTabsOnBrokenDepencies ()
 
 isQuestionSetConfigured ()
 
 doesQuestionSetRelatedDataExist ()
 checks wether question set config related data exists or not More...
 
 removeQuestionSetRelatedData ()
 removes all question set config related data More...
 
 resetQuestionSetRelatedTestSettings ()
 resets all test settings that depends on a non changed question set config More...
 
 cloneQuestionSetRelatedData (ilObjTest $cloneTestOBJ)
 removes all question set config related data for cloned/copied test More...
 
 getQuestionPoolPathString ($poolId)
 
 getFirstQuestionPoolRefIdByObjId (int $pool_obj_id)
 
 isResultTaxonomyFilterSupported ()
 

Additional Inherited Members

- Protected Attributes inherited from ilTestQuestionSetConfig
 $tree = null
 
 $db = null
 
 $pluginAdmin = null
 
 $testOBJ = null
 

Detailed Description

Definition at line 14 of file class.ilTestFixedQuestionSetConfig.php.

Member Function Documentation

◆ cloneQuestionSetRelatedData()

ilTestFixedQuestionSetConfig::cloneQuestionSetRelatedData ( ilObjTest  $cloneTestOBJ)

removes all question set config related data for cloned/copied test

Parameters
ilObjTest$cloneTestOBJ

Reimplemented from ilTestQuestionSetConfig.

Definition at line 76 of file class.ilTestFixedQuestionSetConfig.php.

77 {
78 global $DIC;
79 $ilLog = $DIC['ilLog'];
80
81 require_once 'Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
82 require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
83
85
86 foreach ($this->testOBJ->questions as $key => $question_id) {
87 $question = assQuestion::_instanciateQuestion($question_id);
88 $cloneTestOBJ->questions[$key] = $question->duplicate(true, null, null, null, $cloneTestOBJ->getId());
89
90 $original_id = assQuestion::_getOriginalId($question_id);
91
92 $question = assQuestion::_instanciateQuestion($cloneTestOBJ->questions[$key]);
93 $question->saveToDb($original_id);
94
95 // Save the mapping of old question id <-> new question id
96 // This will be used in class.ilObjCourse::cloneDependencies to copy learning objectives
97 $originalKey = $this->testOBJ->getRefId() . '_question_' . $question_id;
98 $mappedKey = $cloneTestOBJ->getRefId() . '_question_' . $cloneTestOBJ->questions[$key];
99 $cwo->appendMapping($originalKey, $mappedKey);
100 $ilLog->write(__METHOD__ . ": Added question id mapping $originalKey <-> $mappedKey");
101 }
102 }
static _getOriginalId($question_id)
Returns the original id of a question.
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getRefId()
get reference id @access public
getId()
get object id @access public
$key
Definition: croninfo.php:18
global $DIC
Definition: saml.php:7

References $DIC, $ilLog, $key, ilCopyWizardOptions\_getInstance(), assQuestion\_getOriginalId(), assQuestion\_instanciateQuestion(), ilObject\getId(), ilObject\getRefId(), and ilObjTest\getTmpCopyWizardCopyId().

+ Here is the call graph for this function:

◆ cloneToDbForTestId()

ilTestFixedQuestionSetConfig::cloneToDbForTestId (   $testId)

saves the question set config for test with given id to the database

Parameters
$testId

Reimplemented from ilTestQuestionSetConfig.

Definition at line 162 of file class.ilTestFixedQuestionSetConfig.php.

163 {
164 // TODO: Implement saveToDbByTestId() method.
165 }

◆ deleteFromDb()

ilTestFixedQuestionSetConfig::deleteFromDb ( )

deletes the question set config for current test from the database

Reimplemented from ilTestQuestionSetConfig.

Definition at line 170 of file class.ilTestFixedQuestionSetConfig.php.

171 {
172 // TODO: Implement deleteFromDb() method.
173 }

◆ doesQuestionSetRelatedDataExist()

ilTestFixedQuestionSetConfig::doesQuestionSetRelatedDataExist ( )

returns the fact wether a useable question set config exists or not

Returns
boolean

Reimplemented from ilTestQuestionSetConfig.

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

36 {
37 return $this->isQuestionSetConfigured();
38 }
isQuestionSetConfigured()
returns the fact wether a useable question set config exists or not

References isQuestionSetConfigured().

+ Here is the call graph for this function:

◆ isQuestionSetConfigured()

ilTestFixedQuestionSetConfig::isQuestionSetConfigured ( )

returns the fact wether a useable question set config exists or not

Returns
boolean

Reimplemented from ilTestQuestionSetConfig.

Definition at line 21 of file class.ilTestFixedQuestionSetConfig.php.

22 {
23 if (count($this->testOBJ->questions)) {
24 return true;
25 }
26
27 return false;
28 }

Referenced by doesQuestionSetRelatedDataExist().

+ Here is the caller graph for this function:

◆ isResultTaxonomyFilterSupported()

ilTestFixedQuestionSetConfig::isResultTaxonomyFilterSupported ( )

Reimplemented from ilTestQuestionSetConfig.

Definition at line 175 of file class.ilTestFixedQuestionSetConfig.php.

176 {
177 return false;
178 }

◆ loadFromDb()

ilTestFixedQuestionSetConfig::loadFromDb ( )

loads the question set config for current test from the database

Reimplemented from ilTestQuestionSetConfig.

Definition at line 107 of file class.ilTestFixedQuestionSetConfig.php.

108 {
109 // TODO: Implement loadFromDb() method.
110 }

◆ reindexQuestionOrdering()

ilTestFixedQuestionSetConfig::reindexQuestionOrdering ( )
Returns
ilTestReindexedSequencePositionMap

Definition at line 123 of file class.ilTestFixedQuestionSetConfig.php.

124 {
125 $query = "
126 SELECT question_fi, sequence FROM tst_test_question
127 WHERE test_fi = %s
128 ORDER BY sequence ASC
129 ";
130
131 $res = $this->db->queryF(
132 $query,
133 array('integer'),
134 array($this->testOBJ->getTestId())
135 );
136
137 $sequenceIndex = 0;
138
139 require_once 'Modules/Test/classes/class.ilTestReindexedSequencePositionMap.php';
140 $reindexedSequencePositionMap = new ilTestReindexedSequencePositionMap();
141
142 while ($row = $this->db->fetchAssoc($res)) {
143 $sequenceIndex++; // start with 1
144
145 $reindexedSequencePositionMap->addPositionMapping($row['sequence'], $sequenceIndex);
146
147 $this->db->update(
148 'tst_test_question',
149 array('sequence' => array('integer', $sequenceIndex)),
150 array('question_fi' => array('integer', $row['question_fi']))
151 );
152 }
153
154 return $reindexedSequencePositionMap;
155 }
$row
$query
foreach($_POST as $key=> $value) $res

References $query, $res, and $row.

◆ removeQuestionSetRelatedData()

ilTestFixedQuestionSetConfig::removeQuestionSetRelatedData ( )

removes all question set config related data

Reimplemented from ilTestQuestionSetConfig.

Definition at line 43 of file class.ilTestFixedQuestionSetConfig.php.

44 {
45 $res = $this->db->queryF(
46 "SELECT question_fi FROM tst_test_question WHERE test_fi = %s",
47 array('integer'),
48 array($this->testOBJ->getTestId())
49 );
50
51 while ($row = $this->db->fetchAssoc($res)) {
52 $this->testOBJ->removeQuestion($row["question_fi"]);
53 }
54
55 $this->db->manipulateF(
56 "DELETE FROM tst_test_question WHERE test_fi = %s",
57 array('integer'),
58 array($this->testOBJ->getTestId())
59 );
60
61 $this->testOBJ->questions = array();
62
63 $this->testOBJ->saveCompleteStatus($this);
64 }

References $res, and $row.

◆ resetQuestionSetRelatedTestSettings()

ilTestFixedQuestionSetConfig::resetQuestionSetRelatedTestSettings ( )

resets all test settings that depends on a non changed question set config

Reimplemented from ilTestQuestionSetConfig.

Definition at line 66 of file class.ilTestFixedQuestionSetConfig.php.

67 {
68 // nothing to do
69 }

◆ saveToDb()

ilTestFixedQuestionSetConfig::saveToDb ( )

saves the question set config for current test to the database

Reimplemented from ilTestQuestionSetConfig.

Definition at line 115 of file class.ilTestFixedQuestionSetConfig.php.

116 {
117 // TODO: Implement saveToDb() method.
118 }

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