*/ abstract class AbstractInteractionRegistry extends AbstractRegistry { /** * * @author Lionel Lecaque, lionel@taotesting.com */ abstract protected function getInteractionClass(); /** * Register a new custom interaction * * @param string $qtiClass * @param string $phpClass * @throws common_exception_Error */ public function set($qtiClass, $phpClass) { if (! class_exists($phpClass)) { throw new common_exception_Error('Custom interaction class ' . $phpClass . ' not found'); } if (! is_subclass_of($phpClass, $this->getInteractionClass())) { throw new common_exception_Error('Class ' . $phpClass . ' not a subclass of ' . $this->getInteractionClass()); } parent::set($qtiClass, $phpClass); } /** * * @author Lionel Lecaque, lionel@taotesting.com * @return \common_ext_Extension */ protected function getExtension() { return common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiItem'); } }