public function duplicate() { $poolTaxonomyIds = ilObjTaxonomy::getUsageOfObject($this->getSourceObjId()); foreach ($poolTaxonomyIds as $poolTaxId) { $this->duplicateTaxonomyFromPoolToTest($poolTaxId); $this->transferAssignmentsFromOriginalToDuplicatedTaxonomy($poolTaxId, $this->duplicatedTaxonomiesKeysMap->getMappedTaxonomyId($poolTaxId)); } }
/** * @param ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList * @param ilQuestionPoolDuplicatedTaxonomiesKeysMap $taxonomiesKeysMap * @param integer $sourcePoolId */ private function applyMappedTaxonomiesKeys(ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList, ilQuestionPoolDuplicatedTaxonomiesKeysMap $taxonomiesKeysMap, $sourcePoolId) { foreach ($sourcePoolDefinitionList as $definition) { /** @var ilTestRandomQuestionSetSourcePoolDefinition $definition */ if ($definition->getPoolId() == $sourcePoolId) { $definition->setMappedFilterTaxId($taxonomiesKeysMap->getMappedTaxonomyId($definition->getOriginalFilterTaxId())); $definition->setMappedFilterTaxNodeId($taxonomiesKeysMap->getMappedTaxNodeId($definition->getOriginalFilterTaxNodeId())); } } }