/** * * @return array */ public function fileAccessProviders() { $ext = common_ext_ExtensionsManager::singleton()->getExtensionById('tao'); if (is_null(self::$fileSystem)) { self::$fileSystem = tao_models_classes_FileSourceService::singleton()->addLocalSource('test FS', $ext->getConstant('DIR_VIEWS')); } return array(array(DirectWebSource::spawnWebsource(self::$fileSystem, $ext->getConstant('BASE_WWW'))), array(TokenWebSource::spawnWebsource(self::$fileSystem)), array(ActionWebSource::spawnWebsource(self::$fileSystem))); }
/** * * @return array */ public function fileAccessProviders() { $ext = common_ext_ExtensionsManager::singleton()->getExtensionById('tao'); if (is_null(self::$fileSystem)) { $serviceManager = ServiceManager::getServiceManager(); $fsm = $serviceManager->get(FileSystemService::SERVICE_ID); $fsId = core_kernel_uri_UriService::singleton()->generateUri(); $fsm->registerLocalFileSystem($fsId, $ext->getConstant('DIR_VIEWS')); $serviceManager->register(FileSystemService::SERVICE_ID, $fsm); self::$fileSystem = new core_kernel_fileSystem_FileSystem($fsId); } return array(array(DirectWebSource::spawnWebsource(self::$fileSystem->getUri(), $ext->getConstant('BASE_WWW'))), array(TokenWebSource::spawnWebsource(self::$fileSystem->getUri(), self::$fileSystem->getPath())), array(ActionWebSource::spawnWebsource(self::$fileSystem->getUri()))); }
/** * Install script */ public function __invoke($params) { if ($this->getServiceLocator()->has(PortableElementFileStorage::SERVICE_ID)) { return new \common_report_Report(\common_report_Report::TYPE_SUCCESS, 'Portable file storage already registered, skipped.'); } $fsm = $this->getServiceLocator()->get(FileSystemService::SERVICE_ID); $fsPortableElement = $fsm->createFileSystem('portableElementStorage', 'portableElement'); if ($fsPortableElement->getAdapter() instanceof Local) { $websource = TokenWebSource::spawnWebsource('portableElementStorage', $fsPortableElement->getAdapter()->getPathPrefix()); } else { $websource = FlyTokenWebSource::spawnWebsource('portableElementStorage', ''); } $portableElementStorage = new PortableElementFileStorage(array(PortableElementFileStorage::OPTION_FILESYSTEM => 'portableElementStorage', PortableElementFileStorage::OPTION_WEBSOURCE => $websource->getId())); $this->getServiceManager()->register(PortableElementFileStorage::SERVICE_ID, $portableElementStorage); $this->getServiceLocator()->register(FileSystemService::SERVICE_ID, $fsm); return new \common_report_Report(\common_report_Report::TYPE_SUCCESS, 'Portable file storage registered.'); }
public function __invoke($params) { $publicDataPath = FILES_PATH . 'tao' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR; $privateDataPath = FILES_PATH . 'tao' . DIRECTORY_SEPARATOR . 'private' . DIRECTORY_SEPARATOR; if (file_exists($publicDataPath)) { helpers_File::emptyDirectory($publicDataPath); } if (file_exists($privateDataPath)) { helpers_File::emptyDirectory($privateDataPath); } $fsService = $this->getServiceLocator()->get(FileSystemService::SERVICE_ID); $fsService->createFileSystem('public', 'tao/public'); $fsService->createFileSystem('private', 'tao/private'); $this->registerService(FileSystemService::SERVICE_ID, $fsService); $websource = TokenWebSource::spawnWebsource('public', $publicDataPath); $service = new tao_models_classes_service_FileStorage(array(tao_models_classes_service_FileStorage::OPTION_PUBLIC_FS => 'public', tao_models_classes_service_FileStorage::OPTION_PRIVATE_FS => 'private', tao_models_classes_service_FileStorage::OPTION_ACCESS_PROVIDER => $websource->getId())); $this->registerService(tao_models_classes_service_FileStorage::SERVICE_ID, $service); }
<?php /** * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; under version 2 * of the License (non-upgradable). * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Copyright (c) 2015 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); * * @author lionel * @license GPLv2 * @package package_name * @subpackage * */ use oat\tao\model\ThemeRegistry; use oat\tao\model\websource\TokenWebSource; $itemThemesDataPath = FILES_PATH . 'tao' . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR; $itemThemesDataPathFs = \tao_models_classes_FileSourceService::singleton()->addLocalSource('Theme FileSource', $itemThemesDataPath); $websource = TokenWebSource::spawnWebsource($itemThemesDataPathFs); ThemeRegistry::getRegistry()->setWebSource($websource->getId());
* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg (under the project TAO & TAO2); * 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER); * 2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV); * */ /* * This post-installation script creates a new local file source for file uploaded * by end-users through the TAO GUI. */ $publicDataPath = FILES_PATH . 'tao' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR; $privateDataPath = FILES_PATH . 'tao' . DIRECTORY_SEPARATOR . 'private' . DIRECTORY_SEPARATOR; if (file_exists($publicDataPath)) { helpers_File::emptyDirectory($publicDataPath); } if (file_exists($privateDataPath)) { helpers_File::emptyDirectory($privateDataPath); } $publicFs = tao_models_classes_FileSourceService::singleton()->addLocalSource('public service storage', $publicDataPath); $privateFs = tao_models_classes_FileSourceService::singleton()->addLocalSource('private service storage', $privateDataPath); $websource = TokenWebSource::spawnWebsource($publicFs); tao_models_classes_service_FileStorage::configure($privateFs, $publicFs, $websource);
/** * * @param string $initialVersion * @return string */ public function update($initialVersion) { $currentVersion = $initialVersion; //add portable shared libraries: $libBasePath = ROOT_PATH . 'taoQtiItem/views/js/portableSharedLibraries'; $libRootUrl = ROOT_URL . 'taoQtiItem/views/js/portableSharedLibraries'; $installBasePath = ROOT_PATH . 'taoQtiItem/install/scripts/portableSharedLibraries'; $registry = new SharedLibrariesRegistry($libBasePath, $libRootUrl); //migrate from 2.6 to 2.7.0 if ($currentVersion == '2.6') { $registry->registerFromFile('IMSGlobal/jquery_2_1_1', $installBasePath . '/IMSGlobal/jquery_2_1_1.js'); $registry->registerFromFile('OAT/lodash', $installBasePath . '/OAT/lodash.js'); $registry->registerFromFile('OAT/async', $installBasePath . '/OAT/async.js'); $registry->registerFromFile('OAT/raphael', $installBasePath . '/OAT/raphael.js'); $registry->registerFromFile('OAT/scale.raphael', $installBasePath . '/OAT/scale.raphael.js'); $registry->registerFromFile('OAT/util/xml', $installBasePath . '/OAT/util/xml.js'); $registry->registerFromFile('OAT/util/math', $installBasePath . '/OAT/util/math.js'); $registry->registerFromFile('OAT/util/html', $installBasePath . '/OAT/util/html.js'); $registry->registerFromFile('OAT/util/EventMgr', $installBasePath . '/OAT/util/EventMgr.js'); $registry->registerFromFile('OAT/util/event', $installBasePath . '/OAT/util/event.js'); $currentVersion = '2.7.0'; } //migrate from 2.7.0 to 2.7.1 if ($currentVersion == '2.7.0') { $registry->registerFromFile('OAT/sts/common', $installBasePath . '/OAT/sts/common.js'); $registry->registerFromFile('OAT/interact', $installBasePath . '/OAT/interact.js'); $registry->registerFromFile('OAT/interact-rotate', $installBasePath . '/OAT/interact-rotate.js'); $currentVersion = '2.7.1'; } //migrate from 2.7.0 to 2.7.1 if ($currentVersion == '2.7.1') { $registry->registerFromFile('OAT/sts/transform-helper', $installBasePath . '/OAT/sts/transform-helper.js'); $currentVersion = '2.7.2'; } //migrate from 2.7.2 to 2.7.3 if ($currentVersion == '2.7.2') { $registry->registerFromFile('IMSGlobal/jquery_2_1_1', $installBasePath . '/IMSGlobal/jquery_2_1_1.js'); $registry->registerFromFile('OAT/lodash', $installBasePath . '/OAT/lodash.js'); $registry->registerFromFile('OAT/async', $installBasePath . '/OAT/async.js'); $registry->registerFromFile('OAT/raphael', $installBasePath . '/OAT/raphael.js'); $registry->registerFromFile('OAT/scale.raphael', $installBasePath . '/OAT/scale.raphael.js'); $registry->registerFromFile('OAT/util/xml', $installBasePath . '/OAT/util/xml.js'); $registry->registerFromFile('OAT/util/math', $installBasePath . '/OAT/util/math.js'); $registry->registerFromFile('OAT/util/html', $installBasePath . '/OAT/util/html.js'); $registry->registerFromFile('OAT/util/EventMgr', $installBasePath . '/OAT/util/EventMgr.js'); $registry->registerFromFile('OAT/util/event', $installBasePath . '/OAT/util/event.js'); $registry->registerFromFile('OAT/sts/common', $installBasePath . '/OAT/sts/common.js'); $registry->registerFromFile('OAT/interact', $installBasePath . '/OAT/interact.js'); $registry->registerFromFile('OAT/interact-rotate', $installBasePath . '/OAT/interact-rotate.js'); $registry->registerFromFile('OAT/sts/transform-helper', $installBasePath . '/OAT/sts/transform-helper.js'); $currentVersion = '2.7.3'; } //migrate from 2.7.3 to 2.7.4 if ($currentVersion == '2.7.3') { $registry->registerFromFile('OAT/handlebars', $installBasePath . '/OAT/handlebars.js'); $currentVersion = '2.7.4'; } if ($currentVersion == '2.7.4') { $ext = \common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiItem'); $ext->setConfig('qtiCreator', array('multi-column' => false)); $currentVersion = '2.7.5'; } if ($currentVersion == '2.7.5') { $registry->registerFromFile('OAT/sts/stsEventManager', $installBasePath . '/OAT/sts/stsEventManager.js'); $currentVersion = '2.7.6'; } if ($currentVersion == '2.7.6') { $registry->registerFromFile('OAT/sts/common', $installBasePath . '/OAT/sts/common.js'); $currentVersion = '2.7.7'; } if ($currentVersion == '2.7.7') { $itemThemesDataPath = FILES_PATH . 'tao' . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR; $itemThemesDataPathFs = \tao_models_classes_FileSourceService::singleton()->addLocalSource('Theme FileSource', $itemThemesDataPath); $websource = TokenWebSource::spawnWebsource($itemThemesDataPathFs); ThemeRegistry::getRegistry()->setWebSource($websource->getId()); ThemeRegistry::getRegistry()->createTarget('items', 'taoQtiItem/views/css/qti-runner.css'); ThemeRegistry::getRegistry()->registerTheme('tao', 'TAO', 'taoQtiItem/views/css/themes/default.css', array('items')); ThemeRegistry::getRegistry()->setDefaultTheme('items', 'tao'); $currentVersion = '2.7.8'; } if ($currentVersion == '2.7.8') { $clientLibRegistry = ClientLibRegistry::getRegistry(); $clientLibRegistry->register('qtiCustomInteractionContext', '../../../taoQtiItem/views/js/runtime/qtiCustomInteractionContext'); $clientLibRegistry->register('qtiInfoControlContext', '../../../taoQtiItem/views/js/runtime/qtiInfoControlContext'); $currentVersion = '2.7.9'; } if ($currentVersion == '2.7.9') { $currentVersion = '2.8.0'; } if ($currentVersion == '2.8.0') { $currentVersion = '2.8.1'; $registry->registerFromFile('OAT/sts/common', $installBasePath . '/OAT/sts/common.js'); } if ($currentVersion == '2.8.1') { $qtiItem = \common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiItem'); $qtiItem->setConfig('userScripts', array()); $currentVersion = '2.9.0'; } if ($currentVersion === '2.9.0') { $registry->registerFromFile('OAT/waitForMedia', $installBasePath . '/OAT/waitForMedia.js'); $currentVersion = '2.9.1'; } if ($currentVersion === '2.9.1') { $currentVersion = '2.10.0'; } if ($currentVersion === '2.10.0') { $currentVersion = '2.11.0'; } return $currentVersion; }
/** * * @param string $initialVersion * @return string */ public function update($initialVersion) { $currentVersion = $initialVersion; //add portable shared libraries: $libBasePath = ROOT_PATH . 'taoQtiItem/views/js/portableSharedLibraries'; $libRootUrl = ROOT_URL . 'taoQtiItem/views/js/portableSharedLibraries'; $installBasePath = ROOT_PATH . 'taoQtiItem/install/scripts/portableSharedLibraries'; $sharedLibRegistry = new SharedLibrariesRegistry($libBasePath, $libRootUrl); //migrate from 2.6 to 2.7.0 if ($currentVersion == '2.6') { $sharedLibRegistry->registerFromFile('IMSGlobal/jquery_2_1_1', $installBasePath . '/IMSGlobal/jquery_2_1_1.js'); $sharedLibRegistry->registerFromFile('OAT/lodash', $installBasePath . '/OAT/lodash.js'); $sharedLibRegistry->registerFromFile('OAT/async', $installBasePath . '/OAT/async.js'); $sharedLibRegistry->registerFromFile('OAT/raphael', $installBasePath . '/OAT/raphael.js'); $sharedLibRegistry->registerFromFile('OAT/scale.raphael', $installBasePath . '/OAT/scale.raphael.js'); $sharedLibRegistry->registerFromFile('OAT/util/xml', $installBasePath . '/OAT/util/xml.js'); $sharedLibRegistry->registerFromFile('OAT/util/math', $installBasePath . '/OAT/util/math.js'); $sharedLibRegistry->registerFromFile('OAT/util/html', $installBasePath . '/OAT/util/html.js'); $sharedLibRegistry->registerFromFile('OAT/util/EventMgr', $installBasePath . '/OAT/util/EventMgr.js'); $sharedLibRegistry->registerFromFile('OAT/util/event', $installBasePath . '/OAT/util/event.js'); $currentVersion = '2.7.0'; } //migrate from 2.7.0 to 2.7.1 if ($currentVersion == '2.7.0') { $sharedLibRegistry->registerFromFile('OAT/sts/common', $installBasePath . '/OAT/sts/common.js'); $sharedLibRegistry->registerFromFile('OAT/interact', $installBasePath . '/OAT/interact.js'); $sharedLibRegistry->registerFromFile('OAT/interact-rotate', $installBasePath . '/OAT/interact-rotate.js'); $currentVersion = '2.7.1'; } //migrate from 2.7.0 to 2.7.1 if ($currentVersion == '2.7.1') { $sharedLibRegistry->registerFromFile('OAT/sts/transform-helper', $installBasePath . '/OAT/sts/transform-helper.js'); $currentVersion = '2.7.2'; } //migrate from 2.7.2 to 2.7.3 if ($currentVersion == '2.7.2') { $sharedLibRegistry->registerFromFile('IMSGlobal/jquery_2_1_1', $installBasePath . '/IMSGlobal/jquery_2_1_1.js'); $sharedLibRegistry->registerFromFile('OAT/lodash', $installBasePath . '/OAT/lodash.js'); $sharedLibRegistry->registerFromFile('OAT/async', $installBasePath . '/OAT/async.js'); $sharedLibRegistry->registerFromFile('OAT/raphael', $installBasePath . '/OAT/raphael.js'); $sharedLibRegistry->registerFromFile('OAT/scale.raphael', $installBasePath . '/OAT/scale.raphael.js'); $sharedLibRegistry->registerFromFile('OAT/util/xml', $installBasePath . '/OAT/util/xml.js'); $sharedLibRegistry->registerFromFile('OAT/util/math', $installBasePath . '/OAT/util/math.js'); $sharedLibRegistry->registerFromFile('OAT/util/html', $installBasePath . '/OAT/util/html.js'); $sharedLibRegistry->registerFromFile('OAT/util/EventMgr', $installBasePath . '/OAT/util/EventMgr.js'); $sharedLibRegistry->registerFromFile('OAT/util/event', $installBasePath . '/OAT/util/event.js'); $sharedLibRegistry->registerFromFile('OAT/sts/common', $installBasePath . '/OAT/sts/common.js'); $sharedLibRegistry->registerFromFile('OAT/interact', $installBasePath . '/OAT/interact.js'); $sharedLibRegistry->registerFromFile('OAT/interact-rotate', $installBasePath . '/OAT/interact-rotate.js'); $sharedLibRegistry->registerFromFile('OAT/sts/transform-helper', $installBasePath . '/OAT/sts/transform-helper.js'); $currentVersion = '2.7.3'; } //migrate from 2.7.3 to 2.7.4 if ($currentVersion == '2.7.3') { $sharedLibRegistry->registerFromFile('OAT/handlebars', $installBasePath . '/OAT/handlebars.js'); $currentVersion = '2.7.4'; } if ($currentVersion == '2.7.4') { $ext = \common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiItem'); $ext->setConfig('qtiCreator', array('multi-column' => false)); $currentVersion = '2.7.5'; } if ($currentVersion == '2.7.5') { $sharedLibRegistry->registerFromFile('OAT/sts/stsEventManager', $installBasePath . '/OAT/sts/stsEventManager.js'); $currentVersion = '2.7.6'; } if ($currentVersion == '2.7.6') { $sharedLibRegistry->registerFromFile('OAT/sts/common', $installBasePath . '/OAT/sts/common.js'); $currentVersion = '2.7.7'; } if ($currentVersion == '2.7.7') { $itemThemesDataPath = FILES_PATH . 'tao' . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR; $itemThemesDataPathFs = \tao_models_classes_FileSourceService::singleton()->addLocalSource('Theme FileSource', $itemThemesDataPath); $websource = TokenWebSource::spawnWebsource($itemThemesDataPathFs); ThemeRegistry::getRegistry()->setWebSource($websource->getId()); ThemeRegistry::getRegistry()->createTarget('items', 'taoQtiItem/views/css/qti-runner.css'); ThemeRegistry::getRegistry()->registerTheme('tao', 'TAO', 'taoQtiItem/views/css/themes/default.css', array('items')); ThemeRegistry::getRegistry()->setDefaultTheme('items', 'tao'); $currentVersion = '2.7.8'; } if ($currentVersion == '2.7.8') { $clientLibRegistry = ClientLibRegistry::getRegistry(); $clientLibRegistry->register('qtiCustomInteractionContext', '../../../taoQtiItem/views/js/runtime/qtiCustomInteractionContext'); $clientLibRegistry->register('qtiInfoControlContext', '../../../taoQtiItem/views/js/runtime/qtiInfoControlContext'); $currentVersion = '2.7.9'; } if ($currentVersion == '2.7.9') { $currentVersion = '2.8.0'; } if ($currentVersion == '2.8.0') { $currentVersion = '2.8.1'; $sharedLibRegistry->registerFromFile('OAT/sts/common', $installBasePath . '/OAT/sts/common.js'); } if ($currentVersion == '2.8.1') { $qtiItem = \common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiItem'); $qtiItem->setConfig('userScripts', array()); $currentVersion = '2.9.0'; } if ($currentVersion === '2.9.0') { $sharedLibRegistry->registerFromFile('OAT/waitForMedia', $installBasePath . '/OAT/waitForMedia.js'); $currentVersion = '2.9.1'; } if ($currentVersion === '2.9.1') { $currentVersion = '2.10.0'; } if ($currentVersion === '2.10.0') { $currentVersion = '2.11.0'; } if ($currentVersion === '2.11.0') { $sharedLibRegistry->registerFromFile('OAT/util/asset', $installBasePath . '/OAT/util/asset.js'); $sharedLibRegistry->registerFromFile('OAT/util/tpl', $installBasePath . '/OAT/util/tpl.js'); $currentVersion = '2.12.0'; } $this->setVersion($currentVersion); if ($this->isBetween('2.12.0', '2.13.0')) { $itemQtiExt = \common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiItem'); $compilerClassConfig = 'oat\\taoQtiItem\\model\\QtiItemCompiler'; $itemQtiExt->setConfig('compilerClass', $compilerClassConfig); $this->setVersion('2.13.0'); } if ($this->isVersion('2.13.0')) { \oat\tao\model\ClientLibConfigRegistry::getRegistry()->register('taoQtiItem/qtiRunner/core/QtiRunner', array('inlineModalFeedback' => false)); $fs = \taoItems_models_classes_ItemsService::singleton()->getDefaultFileSource(); $itemUpdater = new ItemUpdateInlineFeedback($fs->getPath()); $itemUpdater->update(true); $this->setVersion('2.14.0'); } $this->skip('2.14.0', '2.15.1'); if ($this->isVersion('2.15.1')) { $ext = \common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiItem'); $validation = array('default' => array(__DIR__ . '/../../model/qti/data/imscp_v1p1.xsd', __DIR__ . '/../../model/qti/data/apipv1p0/Core_Level/Package/apipv1p0_imscpv1p2_v1p0.xsd')); $ext->setConfig('manifestValidation', $validation); $this->setVersion('2.16.0'); } if ($this->isVersion('2.16.0')) { $ext = \common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiItem'); $validation = array('http://www.imsglobal.org/xsd/imsqti_v2p0' => array(__DIR__ . '/../../model/qti/data/qtiv2p0/imsqti_v2p0.xsd'), 'http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p1' => array(__DIR__ . '/../../model/qti/data/apipv1p0/Core_Level/Package/apipv1p0_qtiitemv2p1_v1p0.xsd'), 'default' => array(__DIR__ . '/../../model/qti/data/qtiv2p1/imsqti_v2p1.xsd')); $ext->setConfig('contentValidation', $validation); $this->setVersion('2.17.0'); } if ($this->isVersion('2.17.0')) { $this->setVersion('2.17.1'); } if ($this->isVersion('2.17.1')) { $service = new addValidationSettings(); $service([]); $this->setVersion('2.17.2'); } $this->skip('2.17.2', '2.19.0'); if ($this->isVersion('2.19.0')) { if (!$this->getServiceManager()->has(SimpleExporter::SERVICE_ID)) { $service = new ItemExporter(array('fileSystem' => 'taoQtiItem', 'fileLocation' => 'export' . DIRECTORY_SEPARATOR . 'export.csv', 'extractors' => array('OntologyExtractor' => new OntologyExtractor(), 'QtiExtractor' => new QtiExtractor()), 'columns' => array('label' => array('extractor' => 'OntologyExtractor', 'parameters' => array('property' => RDFS_LABEL)), 'type' => array('extractor' => 'QtiExtractor', 'parameters' => array('callback' => 'getInteractionType')), 'nb choice' => array('extractor' => 'QtiExtractor', 'parameters' => array('callback' => 'getNumberOfChoices')), 'BR' => array('extractor' => 'QtiExtractor', 'parameters' => array('callback' => 'getRightAnswer', 'callbackParameters' => array('delimiter' => '|'))), 'choiceInteraction' => array('extractor' => 'QtiExtractor', 'parameters' => array('callback' => 'getChoices', 'valuesAsColumns' => true))))); $service->setServiceManager($this->getServiceManager()); $this->getServiceManager()->register(SimpleExporter::SERVICE_ID, $service); $createExportDirectoryScript = new createExportDirectory(); $createExportDirectoryScript([]); } $this->setVersion('2.20.0'); } $this->skip('2.20.0', '2.22.0'); if ($this->isVersion('2.22.0')) { $simpleExporter = $this->getServiceManager()->get(SimpleExporter::SERVICE_ID); $columns = $simpleExporter->getOption('columns'); $responseIdentifier['responseIdentifier'] = array('extractor' => 'QtiExtractor', 'parameters' => array('callback' => 'getResponseIdentifier')); $offset = array_search('BR', array_keys($columns)); $columns = array_slice($columns, 0, $offset, true) + $responseIdentifier + array_slice($columns, $offset, NULL, true); $simpleExporter->setOption('columns', $columns); $simpleExporter->setServiceManager($this->getServiceManager()); $this->getServiceManager()->register(SimpleExporter::SERVICE_ID, $simpleExporter); $this->setVersion('2.23.0'); } if ($this->isVersion('2.23.0')) { $simpleExporter = $this->getServiceManager()->get(SimpleExporter::SERVICE_ID); $columns = $simpleExporter->getOption('columns'); $columns['BR'] = array('extractor' => 'QtiExtractor', 'parameters' => array('callback' => 'getRightAnswer', 'callbackParameters' => array('delimiter' => '|'), 'valuesAsColumns' => true)); $simpleExporter->setOption('columns', $columns); $simpleExporter->setServiceManager($this->getServiceManager()); $this->getServiceManager()->register(SimpleExporter::SERVICE_ID, $simpleExporter); $this->setVersion('2.24.0'); } $this->skip('2.24.0', '2.25.0'); if ($this->isVersion('2.25.0')) { QtiCreatorClientConfigRegistry::getRegistry()->registerPlugin('back', 'taoQtiItem/qtiCreator/plugins/navigation/back', 'navigation'); $this->setVersion('2.26.0'); } if ($this->isVersion('2.26.0')) { AclProxy::applyRule(new AccessRule('grant', 'http://www.tao.lu/Ontologies/TAOItem.rdf#AbstractItemAuthor', QtiPreview::class)); AclProxy::applyRule(new AccessRule('grant', 'http://www.tao.lu/Ontologies/TAOItem.rdf#AbstractItemAuthor', QtiCreator::class)); AclProxy::applyRule(new AccessRule('grant', 'http://www.tao.lu/Ontologies/TAOItem.rdf#AbstractItemAuthor', QtiCssAuthoring::class)); $this->setVersion('2.27.0'); } $this->skip('2.27.0', '2.28.2'); if ($this->isVersion('2.28.2')) { $setDragAndDropConfig = new SetDragAndDropConfig(); $setDragAndDropConfig([]); $this->setVersion('2.29.0'); } $this->skip('2.29.0', '2.30.1'); if ($this->isVersion('2.30.1')) { $setDragAndDropConfig = new SetDragAndDropConfig(); $setDragAndDropConfig([]); $this->setVersion('2.31.0'); } $this->skip('2.31.0', '5.1.2'); if ($this->isVersion('5.1.2')) { $sharedLibRegistry->registerFromFile('OAT/jquery.qtip', $installBasePath . '/OAT/jquery.qtip.js'); $this->setVersion('5.2.0'); } $this->skip('5.2.0', '5.3.0'); if ($this->isVersion('5.3.0')) { $sharedLibRegistry->registerFromFile('OAT/customEvent', $installBasePath . '/OAT/customEvent.js'); $this->setVersion('5.4.0'); } $this->skip('5.4.0', '5.7.0'); if ($this->isVersion('5.7.0')) { $eventManager = $this->getServiceManager()->get(\oat\oatbox\event\EventManager::CONFIG_ID); $eventManager->attach(\oat\taoItems\model\event\ItemRdfUpdatedEvent::class, array(\oat\taoQtiItem\model\Listener\ItemUpdater::class, 'catchItemRdfUpdatedEvent')); $this->getServiceManager()->register(\oat\oatbox\event\EventManager::CONFIG_ID, $eventManager); $this->setVersion('5.7.1'); } $this->skip('5.7.1', '5.7.3'); if ($this->isVersion('5.7.3')) { $categoriesService = new ItemCategoriesService(array('properties' => array())); $categoriesService->setServiceManager($this->getServiceManager()); $this->getServiceManager()->register(ItemCategoriesService::SERVICE_ID, $categoriesService); $this->setVersion('5.8.0'); } $this->skip('5.8.0', '6.3.0'); }