Copying of application instances

While using your application in their courses, teachers might want to reuse it several times without sharing with others or creating a common instance in their libraries (which has been the only way to make a copy for a while).

Copying means not only duplicating instances on itslearning side but also recreating any related content on the side of the application itself.

For example, if you implemented a quiz app, copying of a quiz instance would mean creating one more instance with all questions and choice options copied as well, so any changes in the target quiz would not affect the source one, and vice versa.

In order for your app to support this, you can implement CopyInstanceService.

To turn the service on, you need to set up Services URL and check “Copy” option in Supported services for your application (see Register your application for more details).

Thus, whenever itslearning is requested to create an extension instance copy, it

  • checks whether the extension is configured with a proper Services URL and supports copying,

  • creates a new instance on its side to represent the copied content.

After that, another request is sent from itslearning to the extension's web services. This calls upon the logic responsible for copying the extension's instance. The logic is enclosed within the methods that have to be written by the extension's author.

When done, the extension should send a valid response back to itslearning informing that operation either successfully completed or failed.
In the latter case, itslearning is responsible for rolling any newly created instances back and warning the user about the failure.

More about implementation of the additional services for can be found here .

Remember that the services belonging to your extension should be properly secured. You need to ensure, that CopyInstanceService will work only with authorized input coming from itslearning:

  • All incoming messages will have a header added to the message containing a signature and a timestamp of the message.

  • All incoming messages should be checked for a valid signature and the timestamp of the message is checked against the lifetime.

Authorization process is thoroughly described in Extend your application with import abilities.

For more details of implementation please see CopyInstanceService methods and messages.