/** * * @param string $initialVersion * @return string $versionUpdatedTo */ public function update($initialVersion) { $this->setVersion($initialVersion); if ($this->isVersion('0.1.0')) { $registry = QtiCreatorClientConfigRegistry::getRegistry(); $registry->registerPlugin('xmlResponseProcessing', 'xmlEditQtiDebugger/qtiCreator/plugins/menu/xmlEditor', 'menu'); $this->setVersion('0.2.0'); } }
/** * * @param string $initialVersion * @return string $versionUpdatedTo */ public function update($initialVersion) { $this->setVersion($initialVersion); if ($this->isVersion('0.1.0')) { $registry = QtiCreatorClientConfigRegistry::getRegistry(); $registry->registerPlugin('xmlResponseProcessing', 'xmlEditRp/qtiCreator/plugins/panel/xmlResponseProcessing', 'panel'); $this->setVersion('0.2.0'); } $this->skip('0.2.0', '0.3.0'); }
public function __invoke($params) { $registry = QtiCreatorClientConfigRegistry::getRegistry(); $registry->registerPlugin('xmlResponseProcessing', 'xmlEditRp/qtiCreator/plugins/panel/xmlResponseProcessing', 'panel'); return new \common_report_Report(\common_report_Report::TYPE_SUCCESS, 'Plugins added to the creator\'s configuration'); }
public function __invoke($params) { $registry = QtiCreatorClientConfigRegistry::getRegistry(); $registry->registerPlugin('pciManager', 'qtiItemPci/qtiCreator/plugins/panel/pciManager', 'panel'); return new \common_report_Report(\common_report_Report::TYPE_SUCCESS, 'Portable Element Plugins for Qti Creator added to Tao Qti Item extension'); }
public function __invoke($params) { $registry = QtiCreatorClientConfigRegistry::getRegistry(); $registry->registerPlugin('back', 'taoQtiItem/qtiCreator/plugins/navigation/back', 'navigation'); return new \common_report_Report(\common_report_Report::TYPE_SUCCESS, 'Qti Creator\'s Plugins settings added to Tao Qti Item extension'); }
/** * * @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'); }