| Date Issued: | 1 June 2017 |
| Latest version: | https://www.imsglobal.org/assessment/interactions.html |
IPR and Distribution Notices
Recipients of this document are requested to submit, with their comments, notification of any relevant patent claims or other intellectual property rights of which they may be aware that might be infringed by any implementation of the specification set forth in this document, and to provide supporting documentation.
IMS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on IMS's procedures with respect to rights in IMS specifications can be found at the IMS Intellectual Property Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.
Copyright © 2017 IMS Global Learning Consortium. All Rights Reserved.
Use of this specification to develop products or services is governed by the license with IMS found on the IMS website: http://www.imsglobal.org/speclicense.html.
Permission is granted to all parties to use excerpts from this document as needed in producing requests for proposals.
The limited permissions granted above are perpetual and will not be revoked by IMS or its successors or assigns.
THIS SPECIFICATION IS BEING OFFERED WITHOUT ANY WARRANTY WHATSOEVER, AND IN PARTICULAR, ANY WARRANTY OF NONINFRINGEMENT IS EXPRESSLY DISCLAIMED. ANY USE OF THIS SPECIFICATION SHALL BE MADE ENTIRELY AT THE IMPLEMENTER'S OWN RISK, AND NEITHER THE CONSORTIUM, NOR ANY OF ITS MEMBERS OR SUBMITTERS, SHALL HAVE ANY LIABILITY WHATSOEVER TO ANY IMPLEMENTER OR THIRD PARTY FOR ANY DAMAGES OF ANY NATURE WHATSOEVER, DIRECTLY OR INDIRECTLY, ARISING FROM THE USE OF THIS SPECIFICATION.
Public contributions, comments and questions can be posted here: https://www.imsglobal.org/forums/ims-glc-public-forums-and-resources/question-test-interoperability-public-forum.
© 2017 IMS Global Learning Consortium, Inc.
All Rights Reserved.
Trademark information: http://www.imsglobal.org/copyright.html
The IMS Logo is a trademark of the IMS Global Learning Consortium, Inc. in the United States and/or other countries.
Document Name: IMS Portable Custom Interactions
Revision: 1 June 2017
1. Introduction
1.2 Terminology
1.3 References
2. Portable Custom Interactions Solution
2.3 Custom Interaction Support
2.5 Configuration
2.6 Lifecycle
2.7 Accessibility
2.8 Packaging
Appendix A - Base Types
Appendix B - Module Resolution Configuration Format
The IMS Global Question and Test Interoperability (QTI) specification [QTI, 16] describes an interoperable format for assessment content and results. The focus of the standard is to provide interoperability between components in an assessment system. The standard supports a myriad of item interaction types. Technology Enhanced Items (TEI) that extend beyond the defined interaction types can still be supported by the QTI specification and in the related Accessible Portable Item Protocol (APIP) specification [APIP, 12] by making use of the custom interactions feature. Interoperability between different components and platforms rendering TEIs provides a unique challenge, because the shape and functionality of these custom interactions are unknown outside of the system that originated it.
This best practice outlines a method that allows an author to define an almost unlimited variety of custom interaction types, while still keeping the item portable between different systems. This is achieved by making use of common web technologies combined with an agreement about how to communicate the results of a learner's interaction to a QTI/APIP delivery engine. By following the best practice documented here, most TEIs and assessment components can increase their value by supporting interoperability.
Custom interactions are an extension point in the QTI specification, but do not provide guidelines on implementation, causing an issue of interoperability between different assessment components and platforms.
Over time and through the use of the guidance described in this document, certain interactions or TEIs will very likely be established and become standard through the IMS assessment community. Details about sharing custom interactions are provided here: http://www.imsglobal.org/assessment/interactions.html.
|
Term |
Definition |
|---|---|
|
AMD |
The Asynchronous Module Definition (AMD) API specifies a mechanism for defining modules such that the module and its dependencies can be asynchronously loaded. |
|
Custom Interaction |
An item interaction defined in the QTI specification as an extension. |
|
Delivery Engine |
The process that coordinates the rendering and delivery of the assessment item(s) and the evaluation of the responses to produce scores and Feedback. |
|
Portable Custom Interaction |
An item interaction defined in the QTI specification as an extension that references all of the code that is required to run the item that contains the portable custom interaction. |
|
RFC 2119 Keywords |
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119]. |
[APIP, 12] G.Driscoll, T.Hoffmann, W.Ostler, M.Russell, M.McKell and C.Smythe, Accessible Portable Item Protocol (APIP) v1.0 Best Practices and Implementation Guide Candidate Final Release, IMS Global, Inc., March 2012. http://www.imsglobal.org/apip/index.html
[RFC 2119] S.Bradner, Network Working Group, Request for Comments: 2119, March 1997. http://www.ietf.org/rfc/rfc2119.txt
[QTI, 16] C.Smythe, M.McKell, W.Kraan, IMS Question & Test Interoperability Overview v2.2.1 Final Release, IMS Global, Inc., August 2016. http://www.imsglobal.org/question/index.html
[STRICT] © Ecma International 2016 http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf (see section 4.2.2)
The solution outlines minor adjustments to item development and delivery system to support the rendering and runtime management of custom interactions. Depending on the intended use of the solution any XML may be used, but HTML5 is preferred. This standard requires a delivery system capable of rendering HTML and executing JavaScript. In order to provide maximum accessibility of custom interactions, delivery systems are expected to support HTML5 and WAI-ARIA. At the time of this writing, HTML5 lacks a formal XML specification. Unexpected results may occur in systems not fully supporting HTML5 additions. The use of Adobe Flash, Silverlight, or other plug-in technologies may be incorporated into this solution, but are highly discouraged in order to keep interactions portable and accessible.
Portable custom interactions are a special type of QTI custom interaction. However, unlike items with conventional QTI custom interactions, items with portable custom interactions include the code that is required to run those portable custom interactions. That means that where conventional custom interactions assume tools that have been specially modified for each custom interaction type, tools that support portable custom interactions only need to implement the additional standardized interfaces outlined in this document in order to support an essentially unlimited number of interaction types.
The rendering of custom interactions requires a communication bridge between the interaction and the delivery engine. The communication bridge provides state information, configuration, and results to be exchanged. Portable custom interactions are based on the following assumptions:
The delivery engine supports portable custom interactions by injecting, via AMD, an object which supports the following contract which will allow interactions to register themselves and exchange state and configuration settings with the delivery engine. It will provide this via a standard AMD definition of 'qtiCustomInteractionContext' which the portable custom interaction can require in its AMD module.
As an alternate discovery method the qtiCustomInteractionContext MUST be assigned to the window object before the PCI is loaded. If a delivery engine support composite interactions the qtiCustomInteractionContext register method may be called more than once for different PCI types and it’s getInstance method may be called multiple times to construct more than one PCI interaction in the assessmentItem.
|
Required Method |
|
|
register(customInteractionHook) The custom interaction uses this method to register its customInteractionHook |
|
|
getInstance(typeIdentifier, dom, configuration, state) |
|
|
Construct a new custom interaction instance object by calling getInstance on the customInteractionHook object.
The markup from the portableCustomInteraction should have been copied to the DOM and the containing element of the markup passed as the parameter ‘dom’ to the getInstance call.The state parameter is optional. It can be passed to recreate a previous interaction state of the item. The value of state, if provided, should have been previously returned by the same interaction type. The configuration object should contain the following: |
|
|
properties |
An object containing all of the key/value pairs from the pci properties |
|
templateVariables |
An object containing all of the template variables referenced in the portableCustomInteraction and their current values |
|
boundTo |
The response variable this qti-custom-interaction is bound to and its value |
|
onready |
Callback method for the PCI instance to call when it is fully constructed and ready for interaction |
|
ondone |
Callback method which the custom interaction can optionally call if the interaction identifies that e.g. the attempt should be ended |
|
status |
Optional. Specify the item status (as per Section 4.1 of the QTI 2.2 Information Model). If not specified it should default to "interacting" |
Custom interactions support the delivery engine by registering a hook with the AMD injected qtiCustomInteractionContext object. The hook allows the delivery engine to construct a custom interaction instance which can return result and state information for the custom item. The following methods are required:
|
Required Method |
|
|
getInstance(dom, configuration, state) Create a new instance of the custom interaction with the supplied configuration and state. |
|
|
getResponse() This method may be called zero or more times. The type of the response data must correspond with the baseType and cardinality defined in the QTI response declaration of the response variable the qti-custom-interaction is bound to (via the responseIdentifier attribute).The value returned must follow the formats defined in Appendix A. If the user has not yet interacted with the interaction or the response is not valid for any reason then getResponse should return undefined. |
|
|
getState() This method can be used to retrieve the current state of the custom interaction which can be later used to re-initialize the custom interaction to that state. This may for example be used by delivery engines when a student navigates away from the current item to another item and later returns to resume their interaction with the item |
|
|
onready(customInteraction, state) If set the onready callback will be called when the custom interaction has fully constructed itself and is ready for user interaction. It passes itself and the current state of the item to the callback (this could be later used by the delivery engine to reinitialize the interaction to an initial state). |
|
|
ondone(customInteraction, response, state, status) If set the ondone callback will optionally be called by the custom interaction if the user interaction indicates that the user is finished with that interaction. It will pass the following parameters: |
|
|
customInteraction |
The PCI instance, which should support the interface defined here |
|
response |
the response variable the custom interaction is bound to with the value to use for that response variable in response processing |
|
state |
the current state of the interaction |
|
status |
optionally the status of the interaction (as per Section 4.1 of the QTI 2.2 Information Model) |
|
typeIdentifier This should have the same value as the customInteractionTypeIdentifier attribute in the portableCustomInteraction element. |
|
To enable portability and to align with the QTI specification, a child element is used to define the portable custom interaction. This child element provides type identification, template variable bindings, interaction configuration settings and the initial HTML5 markup to add to the DOM and pass to the portable custom interaction on initialization.
<?xml version="1.0" encoding="UTF-8"?> <assessmentItem xmlns="http://www.imsglobal.org/xsd/imsqti_v2p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/imsqti_v2p2.xsd" identifier="SimpleExample" title="Example" adaptive="false" timeDependent="false"> <stylesheet href="css/graph.css" type="text/css"/> <responseDeclaration baseType="point" cardinality="single" identifier="RESPONSE" /> <templateDeclaration baseType="integer" cardinality="single" identifier="X" defaultValue="1"/> <templateDeclaration baseType="integer" cardinality="single" identifier="Y" defaultValue="1"/> <itemBody> <customInteraction responseIdentifier="RESPONSE" id="graph1" xmlns="http://www.imsglobal.org/xsd/portableCustomInteraction_v1"> <portableCustomInteraction customInteractionTypeIdentifier="vnd.Example.Graph" > <templateVariable templateIdentifier="X" /> <templateVariable templateIdentifier="Y" /> <properties> <property key="literal">0</property> <property key="scale">5</property> <property key="labelX">Average precipitation</property> <property key="labelY">Month</property> </properties> <modules primaryConfiguration="https://imsglobal.org/pci/1.0.15.modules.js" fallbackConfiguration="modules/config.js"> <module id="chart"/> <module id="graph" primaryPath="https://example.com/content/modules/1.5/graph" fallbackPath="modules/graph"/> </modules> <markup xmlns="http://www.w3.org/1999/xhtml"> <div id="graph1_box" class="graph" style="width:500px; height:500px;"></div> </markup> </portableCustomInteraction> </customInteraction> </itemBody> </assessmentItem> |
Configuration of portable custom interactions may leverage QTI templateDeclaration elements and/or properties defined in the portableCustomInteraction's property elements. The configuration data is set during system initialization and passed to the PCI module via a call to getInstance.
QTI template variables may be leveraged to provide configuration data to custom interactions by template variable binding. The delivery system must read the mapping and provide configuration data before interaction initialization. QTI template variables are transcribed into JSON data by the delivery system.
The JSON data is passed into the custom interaction object on creation via the getInstance method. Refer to the “Appendix” for the JSON representation of template variables. This example item in Section 2.4 above binds two template variables (X and Y) to this interaction, so that the value of these two variables will be passed by the delivery engine into the configuration in the templateVariables property when the custom interaction object is created.
The diagram here illustrates the basic lifecycle of a PCI.
Figure 2.1: PCI Lifecycle sequence diagram.
If we take the example in Section 2.4 above a typical set of lifecycle events would be:
{ "waitSeconds": 60, "paths": { "jquery": "https://code.jquery.com/jquery-1.10.2", "mobile": "https://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0", "chart": "https://cdnjs.com/libraries/chart.js" } }
e.g. { "literal": "0", "scale": "5", "labelX": "Average precipitation", "labelY": "Month" }
e.g. { "properties": { "literal": "0", "scale": "5", "labelX": "Average precipitation", "labelY": "Month" }, "templateVariables": { "X": { "base": { "integer": 1} }, "Y", { "base": { "integer": 1} } }, "boundTo": { "RESPONSE": { "base": { "point": null } } }, "onready": this.onPCIReady.bind(this), "ondone": this.onPCICompleted(this), "status": "interacting" }
e.g. var pciElement = this.createPCIMarkup(...); var customInteractionHook = this.getPCIHook(customInteractionTypeIdentifier); customInteractionHook.getInstance(customInteractionTypeIdentifier, pciElement, { "properties": { "literal": "0", "scale": "5", "labelX": "Average precipitation", "labelY": "Month" }, "templateVariables": { "X": { "base": { "integer": 1} }, "Y", { "base": { "integer": 1} } }, "boundTo": { "RESPONSE": { "base": { "point": null } } }, "onready": this.onPCIReady.bind(this), "ondone": this.onPCICompleted(this), "status": "interacting" }); // No saved state being passed as this is an initial construction
e.g. destroyItem: function () {
for (var i = 0; i < this.pciInteractions.length; i++) {
this.pciInteractions[i].oncompleted(); }
}
e.g. var responseValue = this.pciInteractions[currentInteraction].getResponse();
this.setResponseValue(currentInteraction, responseValue);
where responseValue = { "base": { "point": [ 23, 19 ] }}
It is possible to make portable custom interactions accessible. However, ensuring accessibility of custom interactions may require additional practices beyond those required for defined (i.e., non-custom) interactions. Best practices for accessibility of custom interactions are in the process of being developed and should become available in later versions of this and other documents.
Custom interactions should rely, to the extent possible, on existing standards, including two specifications of the World Wide Web Consortium (W3C) -- the Web Content Accessibility Guidelines version 2 (WCAG) (a W3C recommendation) and WAI-ARIA accessibility guidelines (a W3C candidate recommendation).
The WAI-ARIA guidelines describe semantics to identify user interface controls, dynamically changing content regions, and events. Reviewing http://www.w3.org/WAI/intro/aria provides the reader with the published guidelines and best practices to follow. Below is also a list of JavaScript libraries working to align with the WAI-ARIA guidelines:
In order to increase the consistency of how these standards are applied and interpreted across vendors, interested vendors are encouraged to share their accessibility practices and approaches around custom interactions with others through the APMG.
When the custom interaction part of the item content involves XHTML-like elements with clear identifying attributes, it is suggested to provide APIP accessibility information linked to that content by id. More information on APIP’s standard approach to connecting content and accessibility metadata can be found in the linked portion of the APIP Best Practices document [APIP, 12].
It should also be noted that the APIP standard is focused on ensuring the proper exchange of accessibility information but does not specify all significant aspects of assessment delivery. This is true for both custom and defined (non-custom) interactions. Implementers may find, for example, that while the APIP specification defines the basic information needed for accessible drag-and-drop assessment items, it does not define all important issues that would be needed to make drag-and-drop assessment items usable by some people with disabilities. For example, implementers need to determine how to address the needs of individuals who cannot use a mouse (e.g., who are blind or have fine motor disabilities) or who may prefer other input modalities (e.g., keyboard).
Packaging of portable custom interactions does not require any adjustments to IMS Global packaging specifications. The resource element defined by the specifications will suffice for linking artifacts. This is an excerpt from a manifest describing the packaging of a portable custom interaction:
<resources>
<resource identifier="GI" type="imsqti_apipitem_xmlv2p2" href="items/graphItem.xml">
<lom xmlns="http://ltsc.ieee.org/xsd/apipv1p0/LOM/resource">
<general>
<identifier>
<entry>GraphItem</entry>
</identifier>
<title />
</general>
<lifeCycle>
<contribute />
<version>
<string>Final 1.89</string>
</version>
</lifeCycle>
<educational>
<description>
<string>Graphing Question.</string>
</description>
</educational>
<qtiMetadata xmlns="http://www.imsglobal.org/xsd/apip/apipv1p0/qtimetadata/imsqti_v2p2">
<interactionType>customInteraction</interactionType>
<feedbackType>none</feedbackType>
<solutionAvailable>false</solutionAvailable>
</qtiMetadata>
</lom>
<file href="items/graphItem.xml" />
<file href="items/graph.js" />
<file href="items/graph.css" />
</resource>
</resources>
|
The following is a list of examples showing QTI base types and cardinality represented by a JSON example. The representations are the expected format when dealing with response data.
Table A.1 QTI Base Types to JSON Representation
|
QTI Base Type |
JSON Representation |
|
NULL |
{ "base" : null } |
|
Boolean |
{ "base" : {"boolean" : true } } |
|
Integer |
{ "base" : {"integer" : 123 } } |
|
Float |
{ "base" : {"float" : 23.23 } } |
|
String |
{ "base" : {"string" : "string" } } |
|
Point |
{ "base" : {"point" : [10, 20] } } |
|
Pair |
{ "base" : {"pair" : ["A", "B"] } } |
|
Directed Pair |
{ "base" : {"directedPair" : ["a", "b"] } } |
|
Duration |
{ "base" : {"duration" : "P10Y3M20DT4H30M25S" } } |
|
File |
{ "base" : {"file" : {"data":"cGxlYXN1cmUu", "mime":"text/plain", } } |
|
URI |
{ "base" : {"uri" : "file:///somewhere.txt" } } |
|
IntOrIdentifier |
{ "base" : {"intOrIdentifier" : 123456 } } |
|
Identifier |
{ "base" : {"identifier" : "_identifier" } } |
Duration expresses the value using ISO 8601 durations to comply with JSON schema
Table A.2 QTI Multiple and Ordered Cardinality to JSON Representation
|
QTI Multiple / Ordered Cardinality |
JSON Representation |
|
Boolean |
"{ "list": { "boolean" : [true, false, true, true] } } |
|
Integer |
{ “list” : {“integer” : [2, 3, 5, 7, 11, 13] } } |
|
Float |
{ “list” : {“float” : [3.1415926, 12.34, 98.76] } } |
|
String |
{ “list” : {“string” : [“Another”, “And Another”] } } |
|
Point |
{ “list” : {“point” : [ [123, 456], [640, 480] ] } } |
|
Pair |
{ “list” : {“pair” : [ [“A”, ”B”], [“D”, ”C”] ] } } |
|
Directed Pair |
{ “list” : {“directedPair”: [ [”A”, ”B”], [”C”, ”D”] ] } |
|
Duration |
{ “list” : {“duration” : ["P10Y3M20DT4H30M25S”] } } |
|
File |
{ “list” : {“file”:[{“data":”cGxlYXN1cmUu”,”mime”:”text/plain”}]}} |
|
URI |
{ “list” : {“uri” : [“file:///aFile.txt”, “file:///abc.txt”] } } |
|
IntOrIdentifier |
{ “list” : {“intOrIdentifier” : [2, “_id”] } } |
|
Identifier |
{ “list” : {“identifier” : [“_id1”, “id2”, “ID3”] } } |
Table A.3 QTI Record Cardinality to JSON Representation
|
QTI Record Cardinality |
JSON Representation |
|
Record |
{"record": [ { "name": "rock", "base": { "boolean": true } }, { "name": "paper", "list": { "string": ["p","a","p","e","r"] } }, { "name": "scissors", "list": { "integer": [1, 2, 3, 4] } }, { "name": null } ] } |
This config file is a JSON document like the following example { "waitSeconds": 15, "paths": { "graph": "https://example.com/js/modules/graph1.01/graph.js", "foo": "https://foobar.com/foo/bar1.2/foo.js" } }
The waitSeconds property sets the timeout to use when attempting to download AMD Javascript modules. If not set the delivery engine may select the timeout to use.
The paths property provides a simple mapping between module ids (e.g. "graph" and "foo") and the URL to use to download the module.
| Title: | IMS Portable Custom Interactions Specification |
| Editors: | Colin Smythe, IMS Global (UK) Pádraig O'hiceadha, HMH (UK) Mark McKell, IMS Global (USA) |
| Version: | 1.0 |
| Version Date: | 1 June 2017 |
| Status: | IMS Final Release |
| Summary: | The Portable Custom Interactions specification defines an interoperable format for assessment content and results for technology enhanced or interactive items. This document contains the best
practice recommendations for adopting the specification. |
| Revision Information: | First final release of this specification. |
| Purpose: | For public adoption. |
| Document Location: | www.imsglobal.org/assessment/interactions.html |
The following individuals contributed to the development of this document:
| Arjan Aarnink | Cito (The Netherlands) |
| Michael Aumock | Origami3 (USA) |
| Jérôme Bogaerts | OAT (Luxemburg) |
| Gary Driscoll | ETS (USA) |
| Paul Grudnitski | Pearson (USA) |
| Thomas Hoffmann | ETS (USA) |
| Rob Howard | NWEA (USA) |
| Wilbert Kraan | CETIS (UK) |
| Justin Marks | NWEA (USA) |
| Mark McKell | IMS Global (USA) |
| Mark Molenaar | OAT (Luxemburg) |
| Pádraig O'hiceadha | HMH (UK) |
| Zachary Pierce | Measured Progress (USA) |
| Michelle Richard | Pearson (USA) |
| Somsack Sipasseuth | OAT (Luxemburg) |
| Colin Smythe | IMS Global (UK) |
| Tjeerd Hans Terpstra | Cito (The Netherlands) |
|
Version No. |
Release Date |
Comments |
|
v1.0 Candidate Final |
April 2013 |
Initial Draft of the PCI specification. |
|
v1.0 Final Release |
1 June 2017 |
First Final Release of the PCI specification. |
IMS Global Learning Consortium, Inc. ("IMS Global") is publishing the information contained in this IMS Portable Custom Interactions Specification ("Specification") for purposes of scientific, experimental, and scholarly collaboration only.
IMS Global makes no warranty or representation regarding the accuracy or completeness of the Specification.
This material is provided on an "As Is" and "As Available" basis.
The Specification is at all times subject to change and revision without notice.
It is your sole responsibility to evaluate the usefulness, accuracy, and completeness of the Specification as it relates to you.
IMS Global would appreciate receiving your comments and suggestions.
Please contact IMS Global through our website at http://www.imsglobal.org
Please refer to Document Name: IMS Portable Custom Interactions Specification v1.0
Date: 1 June 2017