/** * ensures an existing page object with giben type/id * * @access protected */ protected function ensurePageObjectExists($pageObjectType, $pageObjectId) { include_once "./Modules/TestQuestionPool/classes/class.ilAssHintPage.php"; if (!ilAssHintPage::_exists($pageObjectType, $pageObjectId)) { $pageObject = new ilAssHintPage(); $pageObject->setParentId($this->questionOBJ->getId()); $pageObject->setId($pageObjectId); $pageObject->createFromXML(); } }
protected function duplicateQuestionHints($originalQuestionId, $duplicateQuestionId) { require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintList.php'; $hintIds = ilAssQuestionHintList::duplicateListForQuestion($originalQuestionId, $duplicateQuestionId); if ($this->isAdditionalContentEditingModePageObject()) { require_once 'Modules/TestQuestionPool/classes/class.ilAssHintPage.php'; foreach ($hintIds as $originalHintId => $duplicateHintId) { $originalPageObject = new ilAssHintPage($originalHintId); $originalXML = $originalPageObject->getXMLContent(); $duplicatePageObject = new ilAssHintPage(); $duplicatePageObject->setId($duplicateHintId); $duplicatePageObject->setParentId($this->getId()); $duplicatePageObject->setXMLContent($originalXML); $duplicatePageObject->createFromXML(); } } }