oat-sa/extension-tao-sync

TAO synchronisation for offline client data.

Installs: 3 136

Dependents: 2

Suggesters: 0

Security: 0

Stars: 1

Watchers: 46

Forks: 1

Open Issues: 0

Type:tao-extension

v9.2.3 2023-08-10 16:18 UTC

This package is auto-updated.

Last update: 2024-12-16 16:43:21 UTC


README

TAO Logo

GitHub GitHub release GitHub commit activity

The purpose of this extension is to synchronize a local and a remote server.

All types of data and results can be synchronized. All HTTP requests are required to be signed following the OAuth 2 standard, also are all data encrypted.

Important note: While this article uses American spelling, some of the command line instructions are in British spelling for historical reasons, e. g. synchronisation instead of synchronization!

Installation instructions

These instructions assume that you already have a TAO installation on your system. If you don't, go to package/tao and follow the installation instructions.

Add the extension to your TAO composer and to the autoloader:

composer require oat-sa/extension-tao-sync

Install the extension on the CLI from the project root:

Linux:

sudo php tao/scripts/installExtension oat-sa/extension-tao-sync

Windows:

php tao\scripts\installExtension oat-sa/extension-tao-sync

As a system administrator you can also install it through the TAO Extension Manager:

  • Settings (the gears on the right-hand side of the menu) -> Extension manager
  • Select taoSync on the right-hand side, check the box and hit install

Synchronization

Data synchronization

In preparation of a delivery execution, the synchronization process needs to fetch data objects of the following types from the central server:

  • test-center
  • administrator
  • proctor
  • test-taker
  • eligibility
  • delivery

Set the chunkSize parameter in the taoSync/syncService configuration to define the amount of data per request, $type refers to the list above, e. g. test-center

$ sudo -u www-data php index.php '\oat\taoSync\scripts\tool\synchronisation\SynchronizeData' [--type=$type]

When a delivery is published it exports a sanpshot of a QTI test package. This snapshot will be used during synchronization.

Result synchronization

Once the Client Server has the delivery result, a script sends it to the Central Server. Only completed delivery executions will be sent, results will be submitted only once. When a delivery execution is sent, the synchronization history will be updated to log the action. You can set the deleteAfterSend parameter to true to delete results after the synchronization.

To configure the amount of data per request, use the chunkSize parameter in the taoSync/resultService configuration.

Execute the following command to synchronize the result:

$ sudo -u www-data php index.php '\oat\taoSync\scripts\tool\synchronisation\SynchronizeResult'

Synchronizing all data and results

To synchronize data and results at the same time, use the following command:

$ sudo -u www-data php index.php '\oat\taoSync\scripts\tool\synchronisation\SynchronizeAll'

OAuth credentials

Generating credentials to allow a user to connect to the platform

This command creates a consumer with OAuth credentials.

$ sudo -u www-data php index.php '\oat\taoSync\scripts\tool\OAuth\GenerateOAuthCredentials'

The output of this command will contain the following data:

  • key
  • secret
  • tokenUrl

Note: Add the -cmd flag to this command to execute it on the Client Server.

Importing OAuth credentials to Client Server

The following command will import the consumer you have created above into the Client Server. The arguments are the output from the previous command, $rootUrl is the domain name of the host server.

$ sudo -u www-data php index.php 'oat\taoSync\scripts\tool\OAuth\ImportOAuthCredentials' -k $key -s $secret -tu $tokenUrl -u $rootUrl

Scoping synchronization to a test center identifier

To be able to bind a synchronization to the organzition ID of a test center, the platform needs to register a test-center property. The SyncService has also to register new synchronizers to process by organisation id.

$ sudo -u www-data php index.php '\oat\taoSync\scripts\tool\RegisterSyncServiceByOrgId'

Note The test center organization id is http://www.taotesting.com/ontologies/synchro.rdf#organisationId_