ILIAS  release_8 Revision v8.24
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 $clone_test_obj)
 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, ilComponentRepository $component_repository, 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
ilTree $tree
 
ilDBInterface $db
 
ilComponentRepository $component_repository
 
ilObjTest $testOBJ
 

Detailed Description

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

Member Function Documentation

◆ cloneQuestionSetRelatedData()

ilTestFixedQuestionSetConfig::cloneQuestionSetRelatedData ( ilObjTest  $clone_test_obj)

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

Parameters
ilObjTest$cloneTestOBJ

Reimplemented from ilTestQuestionSetConfig.

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

86 {
87 global $DIC;
88 $ilLog = $DIC['ilLog'];
89
91
92 foreach ($this->testOBJ->questions as $key => $question_id) {
93 $question = assQuestion::instantiateQuestion($question_id);
94
95 $clone_test_obj->questions[$key] = $question->duplicate(true, '', '', '', $clone_test_obj->getId());
96
97 $original_id = assQuestion::_getOriginalId($question_id);
98
99 $question = assQuestion::instantiateQuestion($clone_test_obj->questions[$key]);
100 $question->saveToDb($original_id);
101
102 // Save the mapping of old question id <-> new question id
103 // This will be used in class.ilObjCourse::cloneDependencies to copy learning objectives
104 $originalKey = $this->testOBJ->getRefId() . '_question_' . $question_id;
105 $mappedKey = $clone_test_obj->getRefId() . '_question_' . $clone_test_obj->questions[$key];
106 $cwo->appendMapping($originalKey, $mappedKey);
107 $ilLog->write(__METHOD__ . ": Added question id mapping $originalKey <-> $mappedKey");
108 }
109 }
static _getOriginalId(int $question_id)
static instantiateQuestion(int $question_id)
static _getInstance(int $a_copy_id)
global $DIC
Definition: feed.php:28
string $key
Consumer key/client ID value.
Definition: System.php:193

References $DIC, ILIAS\LTI\ToolProvider\$key, ilCopyWizardOptions\_getInstance(), assQuestion\_getOriginalId(), ilObject\getId(), ilObject\getRefId(), ilObjTest\getTmpCopyWizardCopyId(), and assQuestion\instantiateQuestion().

+ 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 165 of file class.ilTestFixedQuestionSetConfig.php.

166 {
167 // TODO: Implement saveToDbByTestId() method.
168 }

◆ deleteFromDb()

ilTestFixedQuestionSetConfig::deleteFromDb ( )

deletes the question set config for current test from the database

Reimplemented from ilTestQuestionSetConfig.

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

174 {
175 // TODO: Implement deleteFromDb() method.
176 }

◆ doesQuestionSetRelatedDataExist()

ilTestFixedQuestionSetConfig::doesQuestionSetRelatedDataExist ( )

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

Returns
boolean

Reimplemented from ilTestQuestionSetConfig.

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

47 : bool
48 {
49 return $this->isQuestionSetConfigured();
50 }
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 34 of file class.ilTestFixedQuestionSetConfig.php.

34 : bool
35 {
36 if ($this->testOBJ->getQuestionCountWithoutReloading() > 0) {
37 return true;
38 }
39 return false;
40 }

Referenced by doesQuestionSetRelatedDataExist().

+ Here is the caller graph for this function:

◆ isResultTaxonomyFilterSupported()

ilTestFixedQuestionSetConfig::isResultTaxonomyFilterSupported ( )

Reimplemented from ilTestQuestionSetConfig.

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

178 : bool
179 {
180 return false;
181 }

◆ loadFromDb()

ilTestFixedQuestionSetConfig::loadFromDb ( )

loads the question set config for current test from the database

Reimplemented from ilTestQuestionSetConfig.

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

115 {
116 // TODO: Implement loadFromDb() method.
117 }

◆ reindexQuestionOrdering()

ilTestFixedQuestionSetConfig::reindexQuestionOrdering ( )

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

128 {
129 $query = "
130 SELECT question_fi, sequence FROM tst_test_question
131 WHERE test_fi = %s
132 ORDER BY sequence ASC
133 ";
134
135 $res = $this->db->queryF(
136 $query,
137 ['integer'],
138 [$this->testOBJ->getTestId()]
139 );
140
141 $sequenceIndex = 0;
142
143 $reindexedSequencePositionMap = new ilTestReindexedSequencePositionMap();
144
145 while ($row = $this->db->fetchAssoc($res)) {
146 $sequenceIndex++; // start with 1
147
148 $reindexedSequencePositionMap->addPositionMapping((int) $row['sequence'], $sequenceIndex);
149
150 $this->db->update(
151 'tst_test_question',
152 ['sequence' => ['integer', $sequenceIndex]],
153 ['question_fi' => ['integer', $row['question_fi']]]
154 );
155 }
156
157 return $reindexedSequencePositionMap;
158 }
$res
Definition: ltiservices.php:69
$query

References $query, and $res.

◆ removeQuestionSetRelatedData()

ilTestFixedQuestionSetConfig::removeQuestionSetRelatedData ( )

removes all question set config related data

Reimplemented from ilTestQuestionSetConfig.

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

52 : void
53 {
54 $res = $this->db->queryF(
55 'SELECT question_fi FROM tst_test_question WHERE test_fi = %s',
56 ['integer'],
57 [$this->testOBJ->getTestId()]
58 );
59
60 while ($row = $this->db->fetchAssoc($res)) {
61 $this->testOBJ->removeQuestion((int) $row['question_fi']);
62 }
63
64 $this->db->manipulateF(
65 'DELETE FROM tst_test_question WHERE test_fi = %s',
66 ['integer'],
67 [$this->testOBJ->getTestId()]
68 );
69
70 $this->testOBJ->questions = [];
71
72 $this->testOBJ->saveCompleteStatus($this);
73 }

References $res.

◆ resetQuestionSetRelatedTestSettings()

ilTestFixedQuestionSetConfig::resetQuestionSetRelatedTestSettings ( )

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

Reimplemented from ilTestQuestionSetConfig.

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

76 {
77 // nothing to do
78 }

◆ saveToDb()

ilTestFixedQuestionSetConfig::saveToDb ( )

saves the question set config for current test to the database

Reimplemented from ilTestQuestionSetConfig.

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

123 {
124 // TODO: Implement saveToDb() method.
125 }

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