Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit; communication action placeholders added; #1466

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
'label' => 'QTI test model',
'description' => 'TAO QTI test implementation',
'license' => 'GPL-2.0',
'version' => '32.3.2',
'version' => '32.4.0',
'author' => 'Open Assessment Technologies',
'requires' => array(
'taoQtiItem' => '>=18.0.0',
Expand Down
43 changes: 43 additions & 0 deletions models/classes/runner/synchronisation/action/GetAllItems.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?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) 2019 (original work) Open Assessment Technologies SA ;
*/

namespace oat\taoQtiTest\models\runner\synchronisation\action;

use oat\taoQtiTest\models\runner\synchronisation\TestRunnerAction;

/**
* @package oat\taoQtiTest\models\runner\synchronisation\action
*/
class GetAllItems extends TestRunnerAction
{
/**
* Get item data by identifier
*
* Validate required fields.
* Get item data by given identifier
*
* @return array
* @throws
*/
public function process()
{

}

}
43 changes: 43 additions & 0 deletions models/classes/runner/synchronisation/action/GetFirstItem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?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) 2019 (original work) Open Assessment Technologies SA ;
*/

namespace oat\taoQtiTest\models\runner\synchronisation\action;

use oat\taoQtiTest\models\runner\synchronisation\TestRunnerAction;

/**
* @package oat\taoQtiTest\models\runner\synchronisation\action
*/
class GetFirstItem extends TestRunnerAction
{
/**
* Get item data by identifier
*
* Validate required fields.
* Get item data by given identifier
*
* @return array
* @throws
*/
public function process()
{

}

}
43 changes: 43 additions & 0 deletions models/classes/runner/synchronisation/action/Init.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?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) 2019 (original work) Open Assessment Technologies SA ;
*/

namespace oat\taoQtiTest\models\runner\synchronisation\action;

use oat\taoQtiTest\models\runner\synchronisation\TestRunnerAction;

/**
* @package oat\taoQtiTest\models\runner\synchronisation\action
*/
class Init extends TestRunnerAction
{
/**
* Get item data by identifier
*
* Validate required fields.
* Get item data by given identifier
*
* @return array
* @throws
*/
public function process()
{

}

}
8 changes: 7 additions & 1 deletion scripts/install/SetSynchronisationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
namespace oat\taoQtiTest\scripts\install;

use oat\oatbox\extension\InstallAction;
use oat\taoQtiTest\models\runner\synchronisation\action\GetAllItems;
use oat\taoQtiTest\models\runner\synchronisation\action\ExitTest;
use oat\taoQtiTest\models\runner\synchronisation\action\GetFirstItem;
use oat\taoQtiTest\models\runner\synchronisation\action\Init;
use oat\taoQtiTest\models\runner\synchronisation\action\Move;
use oat\taoQtiTest\models\runner\synchronisation\action\Pause;
use oat\taoQtiTest\models\runner\synchronisation\action\Skip;
Expand Down Expand Up @@ -64,7 +67,10 @@ public function __invoke($params)
'skip' => Skip::class,
'storeTraceData' => StoreTraceData::class,
'timeout' => Timeout::class,
'getNextItemData' => NextItemData::class
'getNextItemData' => NextItemData::class,
'init' => Init::class,
'getFirstItem' => GetFirstItem::class,
'getAllItems' => GetAllItems::class,
];

$service->setAvailableActions(array_merge($actions, $newActions));
Expand Down
28 changes: 28 additions & 0 deletions scripts/update/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
use oat\taoQtiTest\models\runner\OfflineQtiRunnerService;
use oat\taoQtiTest\models\runner\rubric\QtiRunnerRubric;
use oat\taoQtiTest\models\runner\StorageManager;
use oat\taoQtiTest\models\runner\synchronisation\action\GetAllItems;
use oat\taoQtiTest\models\runner\synchronisation\action\GetFirstItem;
use oat\taoQtiTest\models\runner\synchronisation\action\Init;
use oat\taoQtiTest\models\runner\synchronisation\action\Pause;
use oat\taoQtiTest\models\runner\synchronisation\action\NextItemData;
use oat\taoQtiTest\models\runner\synchronisation\SynchronisationService;
Expand Down Expand Up @@ -1778,5 +1781,30 @@ public function update($initialVersion) {
}

$this->skip('32.1.0', '32.3.2');

if ($this->isVersion('32.3.2')) {

$synchronisationService = $this->getServiceManager()->get(SynchronisationService::SERVICE_ID);
$actions = $synchronisationService->getAvailableActions();

$actions['init'] = Init::class;
$actions['getFirstItem'] = GetFirstItem::class;
$actions['getAllItems'] = GetAllItems::class;

$synchronisationService->setAvailableActions($actions);
$this->getServiceManager()->register(SynchronisationService::SERVICE_ID, $synchronisationService);


$extension = $this->getServiceManager()->get(\common_ext_ExtensionsManager::SERVICE_ID)->getExtensionById('taoQtiTest');
$config = $extension->getConfig('testRunner');
$config['bootstrap']['communication']['syncActions'][] = 'init';
$config['bootstrap']['communication']['syncActions'][] = 'getFirstItem';
$config['bootstrap']['communication']['syncActions'][] = 'getAllItems';
$extension->setConfig('testRunner', $config);


$this->setVersion('32.4.0');
}

}
}