36 if ($this->testOBJ->getQuestionCountWithoutReloading() > 0) {
54 $res = $this->db->queryF(
55 'SELECT question_fi FROM tst_test_question WHERE test_fi = %s',
57 [$this->testOBJ->getTestId()]
60 while ($row = $this->db->fetchAssoc(
$res)) {
61 $this->testOBJ->removeQuestion((
int) $row[
'question_fi']);
64 $this->db->manipulateF(
65 'DELETE FROM tst_test_question WHERE test_fi = %s',
67 [$this->testOBJ->getTestId()]
70 $this->testOBJ->questions = [];
72 $this->testOBJ->saveCompleteStatus($this);
88 $ilLog = $DIC[
'ilLog'];
92 foreach ($this->testOBJ->questions as
$key => $question_id) {
95 $clone_test_obj->questions[
$key] = $question->duplicate(
true,
'',
'',
'', $clone_test_obj->
getId());
100 $question->saveToDb($original_id);
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");
130 SELECT question_fi, sequence FROM tst_test_question 132 ORDER BY sequence ASC 135 $res = $this->db->queryF(
138 [$this->testOBJ->getTestId()]
145 while ($row = $this->db->fetchAssoc(
$res)) {
148 $reindexedSequencePositionMap->addPositionMapping((
int) $row[
'sequence'], $sequenceIndex);
152 [
'sequence' => [
'integer', $sequenceIndex]],
153 [
'question_fi' => [
'integer', $row[
'question_fi']]]
157 return $reindexedSequencePositionMap;
isResultTaxonomyFilterSupported()
isQuestionSetConfigured()
returns the fact wether a useable question set config exists or not
static _getOriginalId(int $question_id)
doesQuestionSetRelatedDataExist()
returns the fact wether a useable question set config exists or not
saveToDb()
saves the question set config for current test to the database
static instantiateQuestion(int $question_id)
cloneQuestionSetRelatedData(ilObjTest $clone_test_obj)
removes all question set config related data for cloned/copied test
resetQuestionSetRelatedTestSettings()
loadFromDb()
loads the question set config for current test from the database
removeQuestionSetRelatedData()
deleteFromDb()
deletes the question set config for current test from the database
static _getInstance(int $a_copy_id)
reindexQuestionOrdering()
cloneToDbForTestId($testId)
saves the question set config for test with given id to the database