This is one part of the Verona Online Assessment Standards. All messages are sent via the postMessage function of the html page. The editor takes the page root of its parent as target (parent.window), and the application binds the function call to the iframe element of the editor.
Most important, the message body carries as first parameter the operationId of the message.
The html page MUST contain a script-tag with metadata. The syntax and structure of this data are described here.
Ready Notification
The editor announces that it's code is loaded and initialized so the communication can start.
Accepts the following message:
{
"metadata": "string"
}
Start Command
The application sends parameters for editing the unit and commands the start of user interaction.
Accepts the following message:
{
"sessionId": "idk8ur5jf9ru5jk",
"unitDefinition": "iqb-scripted::1.4.0 title::Testscript Title2??Hilfetext2 multiple-choice::mc_var1::1::Multiple Choice Feld: ::Choice1##Choice2##Choice3??Hilfetext1 drop-down::dd_var1::1::Dropdown Feld: ::Choice1##Choice2##Choice3??Hilfetext1 checkbox::check_var1::0::Ja klick mal! if-start::dd_var1::1 input-text::java::sap oxa if-else input-text::java_22::sap oxa U text::NOT Choice1 if-end",
"unitDefinitionType": "iqb-scripted@1.4.0",
"editorConfig": {
"directDownloadUrl": "https://www.iqb-studio.de/download/iskeid-34e845-didmmemdkek",
"role": "guest"
}
}
Definition Changed Notification
The definition of the unit has changed.
Accepts the following message:
{
"sessionId": "idk8ur5jf9ru5jk",
"timeStamp": "2019-08-24T14:15:22Z",
"unitDefinition": "string",
"unitDefinitionType": "iqb-scripted@1.4.0",
"variables": [
{
"id": "string",
"alias": "string",
"type": "string",
"format": "text-selection",
"multiple": false,
"nullable": false,
"values": [
{
"value": "string",
"label": "string"
}
],
"valuePositionLabels": [
"string"
],
"valuesComplete": false,
"page": "string"
}
],
"dependenciesToPlay": [
{
"id": "GeoGebra.itcr.zip",
"type": "file"
}
],
"dependenciesToEdit": [
{
"id": "GeoGebra.itcr.zip",
"type": "file"
}
]
}
The session id flags all communication. If a message has no or empty session id, it's not processed. The session id is unique and was generated by the application. Any simple algorithm would work. The session id helps to link the correct unit with the data of the message. Using the id of the editor hosting html element is less reliable, because the element could be reused with another unit.