4 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolQuestionList.php';
5 require_once
'Modules/TestQuestionPool/classes/class.ilQuestionPoolFactory.php';
6 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
110 $this->db, $this->pluginAdmin
113 $questionList->setTestObjId($this->testOBJ->getId());
114 $questionList->setTestId($this->testOBJ->getTestId());
115 $questionList->setPoolId($nonAvailablePool->
getId());
117 $questionList->loadQuestions();
119 $questions =
array();
121 foreach($questionList as $questionId)
133 if( strlen($nonAvailablePool->
getTitle()) )
135 $pool->setTitle($nonAvailablePool->
getTitle());
144 $poolQidByTestQidMap =
array();
146 foreach($questions as $questionOBJ)
150 $testQuestionId = $questionOBJ->getId();
151 $poolQuestionId = $questionOBJ->duplicate(
false,
'',
'', $this->
getOwnerId(), $pool->
getId());
153 $poolQidByTestQidMap[$testQuestionId] = $poolQuestionId;
156 return $poolQidByTestQidMap;
161 foreach($poolQidByTestQidMap as $testQid => $poolQid)
170 require_once
'Services/Taxonomy/classes/class.ilTaxNodeAssignment.php';
172 $filteredTaxIds =
array();
174 foreach($taxonomyIds as $taxonomyId)
177 $this->testOBJ->getType(), $this->testOBJ->getId(),
'quest', $taxonomyId
180 foreach($relatedQuestionIds as $questionId)
184 if( count($assignedTaxNodes) )
186 $filteredTaxIds[] = $taxonomyId;
193 return $filteredTaxIds;
198 require_once
'Modules/TestQuestionPool/classes/class.ilQuestionPoolTaxonomiesDuplicator.php';
200 $taxDuplicator->setSourceObjId($this->testOBJ->getId());
201 $taxDuplicator->setSourceObjType($this->testOBJ->getType());
202 $taxDuplicator->setTargetObjId($pool->
getId());
203 $taxDuplicator->setTargetObjType($pool->
getType());
204 $taxDuplicator->setQuestionIdMapping($poolQidByTestQidMap);
207 $taxDuplicator->getAllTaxonomiesForSourceObject(), array_keys($poolQidByTestQidMap)
210 return $taxDuplicator->getDuplicatedTaxonomiesKeysMap();
215 $originalTaxonomyFilter =
array();
217 foreach($mappedTaxonomyFilter as $testTaxonomyId => $testTaxNodes)
220 $originalTaxonomyFilter[$poolTaxonomyId] =
array();
222 foreach($testTaxNodes as $testTaxNode)
225 $originalTaxonomyFilter[$poolTaxonomyId][] = $poolTaxNode;
229 return $originalTaxonomyFilter;
236 if( $definition->getPoolId() != $nonAvailablePoolId )
241 $definition->setPoolId($derivedPoolId);
244 $taxKeysMap, $definition->getMappedTaxonomyFilter()
247 $definition->saveToDb();
static resetOriginalId($questionId)
updateTestQuestionStage($poolQidByTestQidMap)
getAssignmentsOfItem($a_item_id)
Get assignments for item.
Taxonomy node <-> item assignment.
copyQuestionsToPool(ilObjQuestionPool $pool, $questions)
getSourcePoolDefinitionList()
getMappedTaxonomyId($originalTaxonomyId)
derive(ilTestRandomQuestionSetNonAvailablePool $nonAvailablePool)
Administration class for plugins.
getId()
get object id public
$sourcePoolDefinitionList
duplicateTaxonomies($poolQidByTestQidMap, ilObjQuestionPool $pool)
setTargetContainerRef($targetContainerRef)
__construct(ilDBInterface $ilDB, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ)
getMappedTaxNodeId($originalTaxNodeId)
getQuestionsForPool(ilTestRandomQuestionSetNonAvailablePool $nonAvailablePool)
static saveOriginalId($questionId, $originalId)
getType()
get object type public
Create styles array
The data for the language used.
static _instantiateQuestion($question_id)
updateRelatedSourcePoolDefinitions(ilQuestionPoolDuplicatedTaxonomiesKeysMap $taxKeysMap, $derivedPoolId, $nonAvailablePoolId)
buildOriginalTaxonomyFilterForDerivedPool(ilQuestionPoolDuplicatedTaxonomiesKeysMap $taxKeysMap, $mappedTaxonomyFilter)
createNewPool(ilTestRandomQuestionSetNonAvailablePool $nonAvailablePool)
setSourcePoolDefinitionList($sourcePoolDefinitionList)
filterForQuestionRelatedTaxonomies($taxonomyIds, $relatedQuestionIds)