Skip to content

Commit

Permalink
Merge pull request #11 from oat-sa/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jbout authored Sep 15, 2016
2 parents a2b4a9f + 2e4a27c commit 3904851
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 173 deletions.
33 changes: 0 additions & 33 deletions controller/PciSamples.php

This file was deleted.

11 changes: 5 additions & 6 deletions manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,24 @@
* Copyright (c) 2015 (original work) Open Assessment Technologies;
*
*
*/
*/
use oat\pciSamples\scripts\install\RegisterPci;

return array(
'name' => 'pciSamples',
'label' => 'QTI PCI samples',
'description' => '',
'license' => 'GPL-2.0',
'version' => '0.2.1',
'version' => '1.0.0',
'author' => 'Open Assessment Technologies',
'requires' => array('qtiItemPci' => '>=0.1'),
// for compatibility
'dependencies' => array('qtiItemPci'),
'requires' => array('qtiItemPci' => '>=1.0.0'),
'managementRole' => 'http://www.tao.lu/Ontologies/generis.rdf#pciSamplesManager',
'acl' => array(
array('grant', 'http://www.tao.lu/Ontologies/generis.rdf#pciSamplesManager', array('ext'=>'pciSamples')),
),
'install' => array(
'php' => array(
dirname(__FILE__).'/scripts/install/addHook.php'
RegisterPci::class
)
),
'update' => 'oat\\pciSamples\\scripts\\update\\Updater',
Expand Down
51 changes: 0 additions & 51 deletions model/CreatorHook.php

This file was deleted.

44 changes: 0 additions & 44 deletions model/CreatorRegistry.php

This file was deleted.

48 changes: 48 additions & 0 deletions scripts/install/RegisterPci.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?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) 2016 (original work) Open Assessment Technologies SA;
*
* */

namespace oat\pciSamples\scripts\install;

use common_ext_action_InstallAction;
use oat\oatbox\service\ServiceManager;
use oat\taoQtiItem\model\portableElement\exception\PortableElementVersionIncompatibilityException;
use oat\taoQtiItem\model\portableElement\PortableElementService;

class RegisterPci extends common_ext_action_InstallAction
{
public function __invoke($params)
{
$service = new PortableElementService();
$service->setServiceLocator(ServiceManager::getServiceManager());

$viewDir = \common_ext_ExtensionsManager::singleton()->getExtensionById('pciSamples')->getConstant('DIR_VIEWS');

try {
$sourceTextReader = $viewDir.implode(DIRECTORY_SEPARATOR, ['js', 'pciCreator', 'dev', 'textReaderInteraction']);
$service->registerFromDirectorySource($sourceTextReader);
} catch (PortableElementVersionIncompatibilityException $e) {
\common_Logger::i($e->getMessage());
}



return new \common_report_Report(\common_report_Report::TYPE_SUCCESS, 'Portable Element Plugins for Qti Creator added to Tao Qti Item extension');
}
}
23 changes: 0 additions & 23 deletions scripts/install/addHook.php

This file was deleted.

12 changes: 10 additions & 2 deletions scripts/update/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@

namespace oat\pciSamples\scripts\update;

use oat\pciSamples\scripts\install\RegisterPci;
use oat\taoQtiItem\model\HookRegistry;

class Updater extends \common_ext_ExtensionUpdater
class Updater extends \common_ext_ExtensionUpdater
{

/**
Expand All @@ -37,7 +39,13 @@ public function update($initialVersion) {
$this->setVersion('0.2.1');
}

if($this->isVersion('0.2.1')){
$registerPci = new RegisterPci();
$registerPci([]);

return null;
HookRegistry::getRegistry()->remove('pciSamplesCreator');

$this->setVersion('1.0.0');
}
}
}
7 changes: 3 additions & 4 deletions views/js/pciCreator/dev/textReaderInteraction/pciCreator.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/*global define*/
define([
'./creator/widget/Widget',
'taoQtiItem/qtiCreator/editor/customInteractionRegistry',
'textReaderInteraction/creator/widget/Widget',
'textReaderInteraction/runtime/js/renderer',
'tpl!./runtime/tpl/markup',
'tpl!textReaderInteraction/creator/tpl/markup',
'tpl!textReaderInteraction/creator/tpl/pages',
'tpl!textReaderInteraction/creator/tpl/navigation'
], function (Widget, registry, Renderer, markupTpl, pagesTpl, navigationTpl) {
], function (Widget, Renderer, markupTpl, pagesTpl, navigationTpl) {
'use strict';
var _typeIdentifier = 'textReaderInteraction';

Expand Down
38 changes: 28 additions & 10 deletions views/js/pciCreator/dev/textReaderInteraction/pciCreator.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,9 @@
"typeIdentifier": "textReaderInteraction",
"label": "Text reader",
"description": "The Paging widget combines a scrolling widget with additional paging controls.",
"version": "0.1",
"version": "0.2.0",
"author": "Aleh Hutnikau",
"email": "contact@taotesting.com",
"libraries": [
"IMSGlobal/jquery_2_1_1",
"./runtime/js/renderer",
"./runtime/js/tabs"
],
"css": [
"./runtime/css/textReaderInteraction.css"
],
"entryPoint": "./runtime/textReaderInteraction.js",
"tags": [
"reader",
"paging"
Expand All @@ -23,5 +14,32 @@
"response": {
"baseType": "boolean",
"cardinality": "single"
},
"runtime" : {
"hook" : "./runtime/textReaderInteraction.js",
"libraries" : [
"IMSGlobal/jquery_2_1_1",
"./runtime/js/renderer.js",
"./runtime/js/tabs.js"
],
"stylesheets" : [
"./runtime/css/textReaderInteraction.css"
]
},
"creator" : {
"icon": "./creator/media/icon.svg",
"hook": "./pciCreator.js",
"libraries" : [
"./creator/tpl/markup.tpl",
"./creator/tpl/propertiesForm.tpl",
"./creator/tpl/navigation.tpl",
"./creator/tpl/pages.tpl",
"./creator/widget/Widget.js",
"./creator/widget/states/Question.js",
"./creator/widget/states/states.js"
],
"stylesheets" : [
"./creator/css/textReaderInteraction.css"
]
}
}

0 comments on commit 3904851

Please sign in to comment.