Caveon’s Scorpion allows vendors to provide skills based assessments through Scorpion’s ‘external’ item type. Using this item type, vendors can use skills based assessments on their own systems to test a candidate’s knowledge. Vendors can use mock scenarios to assess if a candidate can operate in real situations, or perhaps offer puzzles or other forms of logic testing that are beyond the current capabilities of Scorpion.
There are two ways to integrate external items: server side, and client side. With server side items, responses are submitted to an external application server, optionally scored, and then the server sends the response and (optional) score to Scorpion through the API. Client side items send responses to the Scorpion parent window through the browser.
Server Side
Items integrated with Scorpion through the server side method require an application server to serve content, accept responses, optionally score these responses, and then send response and (optional) score to Scorpion through the API. The endpoint you’ll use is POST https://sei.caveon.com/api/set_response/<response_id>. Typically, Scorpion will wait to receive a response from the external server before proceeding with a test. Please see the documentation for required and optional inputs.
An example of a server side item can be found in the SEI Examples GutHub repository.
Client Side
The advantage to client side items is that they can be served as static files and require no application server. They use window.postMessage()
to communicate with Scorpion. A javascript utility to interface with Scorpion easily is available as an npm package or you can download the minified file from the GitHub repository.
Examples of client side items can be found in the SEI Examples GutHub repository.
Include/Import the file
You can include the file in your html with a <script>
tag after downloading it from the repository as below:
- <script type="text/javascript" src="/path/to/SeiMessenger.min.js"></script>
You can also import/include the file in a bundling process as. First of all install the package using npm
- npm install sei-messenger
Then you can include the file in your javascript using a common module system as below:
- // ES6
- import SeiMessenger from 'sei-messenger';
- // requireJS
- var SeiMessenger = require("sei-messenger");
Construct Class Instance and Send Message
To use the library, simply instantiate a new instance. Then to communicate with Scorpion, call the sendMessage()
method with the message as a string.
- var messenger = new SeiMessenger();
- messenger.sendMessage('Your message to Scorpion here.');
Explanation and Advanced Options
Constructor Arguments
The library automatically does three things when it is instantiated.
- The query param
response_id
is pulled from the address bar and stored. - It stores the target Scorpion window in case the item is in nested
<iframe>
tags. - It set’s the target origin to
scorpion.caveon.com
In the event that the item is loaded in a different location than the inputted item URL in Scropion, you can pull the response_id
query param yourself and provide it to the constructor. In addition, if you are working with SEI in a non-production environment, or if you are confident that you do not need to set a destination origin, you can provide a separate one to the constructor.
- var targetOrigin = '*'; // Not secure, never use in production environment
- var storedResponseId = '1234abcd';
- var messenger = new SeiMessenger(targetOrigin, storedResponseId);
The Meta Object
Along with your message, you may also provide a meta
object. This can contain anything that you would like to pass to Scorpion in addition to the response string.
- var candidateResponse = 'string response to be sent to SEI';
- var metaInformation = {
- testForm: 'three',
- timeElapsed: 310
- }
- messenger.sendMessage(candidateResponse, metaInformation)
Comments
0 comments
Article is closed for comments.