QTI v3 Best Practices and Implementation Guide

Question & Test Interoperability (QTI) 3.0 Best Practices and Implementation Guide

IMS Final Release
Spec Version 3.0
IMS Final Release
Document Version: 1.0
Date Issued: 1 May 2022
Status: This document is made available for adoption by the public community at large.
This version: https://www.imsglobal.org/spec/qti/v3p0/impl/

IPR and Distribution Notice

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.

1EdTech takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain 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 webpage: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf .

The following participating organizations have made explicit license commitments to this specification:

Org name Date election made Necessary claims Type
CITO March 11, 2022 No RF RAND (Required & Optional Elements)
HMH March 11, 2022 No RF RAND (Required & Optional Elements)

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: http://www.imsglobal.org/forums/ims-glc-public-forums-and-resources .

© 2023 IMS Global Learning Consortium, Inc. All Rights Reserved.

Trademark information: http://www.imsglobal.org/copyright.html

Abstract

The IMS Question and Test Interoperability® (QTI®) specification is a technical standard for digital interchange of assessment content (items and tests), assessment usage data and results reporting. Use of QTI 3.0 enables assessment materials to be exchanged digitally among a wide variety of products, such as item/test authoring products, item banks, and test delivery systems [QTI-OVIEW-30].

QTI 3.0 is based on the well established QTI standard that has been used internationally for two decades and IMS Accessible Portable Item Protocol® (APIP®). QTI 3.0 adds support of digital delivery options for a range of common accessibility needs and enables transform-free authoring to delivery workflow. Implementations of QTI 3.0 may require use of related standards, including the IMS Content Packaging 1.0 specification, and the AccessForAll® (AfA) 3.0 specification.

This document is the QTI 3.0 Best Practices and Implementation Guide (BPIG). The BPIG consists of six sections describing the various structures and features of QTI and how to best implement them in your assessment products.

1. Introduction

The main purpose of the Question and Test Interoperability® (QTI®) specification is to define an information model and associated binding that can be used to represent and exchange assessment content. While the QTI specification is the primary method of interoperability, QTI 3 introduces a greater amount of delivery interoperability through new formatting and behavioral expectations for interactions.

This document contains examples of QTI 3. Many of the examples are illustrated by screenshots or rendered views of the items, which are designed to illustrate how a system might implement the specification. This is a guide to best practices for QTI 3 implementation, and examples are for illustrative purposes.

Each section of this document introduces a new aspect or feature of the specification, starting with the simplest constructions and continuing to more intricate examples.

1.1 Scope and Context

The IMS QTI work specifically relates to content providers (that is, question and test authors and publishers), developers of authoring and content management tools, assessment delivery systems and learning management systems. The data model for representing question-based content is suitable for targeting users in learning, education, and training across all age ranges and national contexts.

Common acronyms and terms with definitions related to assessment are included in the QTI Terms and Definitions document [QTI-TERM-30].

1.1.1 Relationship to IMS Global Standards

QTI 3 brings together QTI 2.x and Accessible Portable Item Protocol® (APIP®) [APIP-IMPL-10] accessibility and accommodation features into a single assessment specification.

QTI 3 uses an IMS Content Packaging [CP-12] specification profile to package and exchange assessment content. IMS AccessForAll™ [AFA-30] specifications are used to support accessibility functionality.

The QTI 3 project group has also produced an assessment metric profile in connection to the IMS Caliper Analytics® [CALIPER-11] specification.

The IMS Competencies and Academic Standards Exchange® (CASE®) [CASE-10] specification is used to exchange information about learning and education competencies. CASE can also transmit information about rubrics, criteria for performance tasks, which may or may not be aligned to competencies. An example of CASE being used with a QTI package is included in BPIG section 6.

In QTI, Learning Tool Interoperability® (LTI®) [LTI-13] can be used to launch a specific interactive experience for candidates. However, externally launched tools may be blocked during assessment sessions depending on the security protocols of the assessment. The recommended practice is to use LTI only when standardized QTI approaches have been exhausted.

1.1.3 Interoperability in QTI 3

The QTI 3 standard is intended to foster interoperability of assessment-based content packages. The QTI 3 standard is comprised of a collection of specification documents designed to ensure that the exchangeable package of assessment content adheres to a rigorous set of file structure expectations. QTI 3 introduces new assessment, section, and item specifications as well as a new QTI 3 Content Package profile (based on the 1.2 version of the IMS Content Package specification).

This revised item specification is enforced by a newer, more rigorous conformance process. User experience interoperability will enable content authors to produce questions and tests that render and behave consistently across systems implementing QTI 3. The resulting specification eases adoption by adding unambiguous content structural markup and accessibility information to QTI 3. The use of web-based markup (HTML5) describes assessment content and semantics, and CSS can describe how the content will be displayed to candidates, in terms of layout, colors, and animations. This helps eliminate rendering inconsistencies across platforms, and enable content authors to communicate specific formatting and rendering expectations for assessment delivery interfaces.

Delivery systems are expected to use the information supplied in the QTI 3 standardized exchange formats, but can elect to use proprietary or other delivery-focused formats during content rendering and data collection.

Within the content package exchange, there may be interoperability issues surrounding specific file formats (e.g., mime types) for some supporting media files or custom interaction code. The QTI 3 standard allows for the use of any media type at this time, so interoperability between vendors may require agreement on the provision of specific file formats. Likely areas where that would occur within the content are pre-recorded media files (audio or video-only, or audio with video) as part of an item stimulus or prompt, or as alternative or supplemental support content for specific support needs. The QTI 3 standard allows for the provision of multiple file formats, which could reduce run-time file-format incompatibility issues.

QTI 3 supports bi-directional text, Ruby Markup https://www.w3.org/International/articles/ruby/  , and vertical text (via CSS) to support internationalization.

Interoperability for QTI 3 is also supported by the use of an IMS governed conformance and certification process, which employs IMS provided online automated validation tools, and requires certified systems to demonstrate validation. The validation tools assist organizations by examining exchange files for structural consistency against the QTI 3 standard. (See the QTI 3 Conformance and Certification [QTI-CERT-30] documentation.)

1.1.4 Packaging

QTI uses the IMS Content Packaging specification for organizing, describing, and exchanging assessment content. Section 6 of this document provides examples of IMS Content Packaging for metadata and variants.

1.1.5 Usage of Alternative XSDs

The physical exchange of QTI-based resources uses a zip file of the set of QTI-XML files, support asset files (e.g. images, video, etc) and a manifest file that defines and describes the relationships between the full set of files. This zip file is known as a QTI Package (this package is based upon the 1EdTech Common Cartridge 1.3 specification).

Validation of ALL of the QTI-XML resources is achieved using the primary ASI XSD ('imsqti_asiv3p0p1_v1p0.xsd'). The construction of the QTI Package requires that each QTI resource is supplied in its own XML file. Therefore, to enable validation of each type of QTI-XML resource we have supplied an XSD specific to that type. The list of XSDs and their intended validation usage is listed in the following Table.

XSD Name Validation Purpose
imsqti_asiv3p0p1_v1p0.xsd Validation of all of the QTI-XML files.
imsqti_testv3p0p1_v1p0.xsd Validation of the Test structure only. All of the used Sections must be accessed using the reference mechanism.
imsqti_sectionv3p0p1_v1p0.xsd Validation of the Section structure only. All of the used Sections and/or Items must be accessed using the reference mechanism.
imsqti_itemv3p0p1_v1p0.xsd Validation of the Item structure only. All of the used Stimuli must be accessed using the reference mechanism.
imsqti_stimulusv3p0p1_v1p0.xsd Validation of the Stimulus structure only.
imsqti_outcomev3p0p1_v1p0.xsd Validation of an Outcome Declaration only. Separate Outcome Declarations are used to align the corresponding learning standards through the QTI Package.
imsqti_responseprocessingv3p0p1_v1p0.xsd Validation of a Response Processing structure. This enables reusability of a response processing algorithm.

There is NO preferred validation method. Whichever approach is used the validations results are consistent. If any problems are encountered using the 1EdTech XSDs and/or validator then please use the 1EdTech Support Portal at: https://support.imsglobal.org/support/home .

1.1.6 Future Scope

The IMS members contributing to the development of the QTI 3 specification regard this version 3 as a definitive set of features and functionality relating to Web and accessibility standards that should not require significant iterative updates or changes. Correction of errors is an expected part of any specification maintenance, but the QTI project group hopes version 3 meets market demands and will not require major additions or changes in scope.

1.2 Structure of this document

This Best Practices and Implementation Guide is organized to provide an introduction to implementing QTI, constructing a QTI 3 open standards-based solution, a description of the Item and Test models at the core of QTI content, how the content interacts with the Personal Needs and Preferences of students, and how packaging brings it all together. Example markup, screenshots of rendered QTI, and details about best practices in adopting the standard are provided in this best practices guide.

1.3 Conformance Statements

This document is an informative resource in the Document Set of the IMS Question & Test Interoperability (QTI) v3.0 specification [QTI-OVIEW-30]. As such, it does not include any normative requirements. Occurrences in this document of terms such as MAY, MUST, MUST NOT, SHOULD or RECOMMENDED have no impact on the conformance criteria for implementors of this specification.

2. Structure of QTI 3 Assessment Content

The purpose of this section is to give a broad overview of the structure and conventions used when constructing a QTI 3 solution. The specifics of the various QTI 3 features are enumerated in the sections that follow.

The exchange of QTI 3 content can vary significantly in scope, ranging from the exchange of a package containing a single assessment item to multiple tests with various subsections, thousands of assessment items, and shared stimulus content.

QTI 3 Assessment content is exchanged in a content package, using the standardized structure of the assessment structures, including tests, sections, test-parts, shared-stimulus, and items, as well as any of the content resources (like images and media), metadata, usagedata and stylesheet references. See Section 6 for more information on content packaging for QTI 3.

Given the complexity of assessment content, the QTI 3 standard allows for fairly simple interactions and content, as well as more complex interactions and assessment structures. The needs of the assessment program generally dictate which of the many QTI 3 features are used in the exchanged content. Conformance and certification for QTI 3 features is discussed in separate documentation, QTI 3 Conformance and Certification [QTI-CERT-30].

An assessment program can optionally create content that includes additional, dormant content that is selectively presented to candidates based on their user profile. In these cases, there is a dependency between the authoring systems creating the additional content, registration systems that allow for candidates to indicate their assessment needs and preferences, and the delivery system which uses the candidate profiles to present the dormant assessment content to specific candidates.

Figure 1 Figure showing a person sitting at a computer taking a test.
Figure showing a person sitting at a computer taking a test, with a label that says DELIVERY.
        Feeding into the delivery are two branches. The first branch is for Authoring Tools, where they export
        Accessible QTI content. The second branch is for Rostering Tools, that provide PNP information about
        the candidate. The content and the PNP information are used to personalize the candidate's user experience.

See AccessForAll 3.0 and the QTI 3 Profile Section 5: Personal Needs and Preferences for more information on personalizing the assessment experience for candidates.

An QTI 3 assessment delivery system presents assessment content to candidates using QTI 3 for presentation of content, instructions for data collection, response processing, and scoring. There are many different ways to configure a delivery system, and QTI 3 does not dictate the architecture of these systems. The purpose of QTI 3 is to provide standardized content exchange and some basic user experience delivery expectations.

QTI 3 content is exchanged in standardized files using XML structure, where candidate-facing content is represented using a combination of HTML and XML (for the interactions). The content files may also contain template information, feedback content, or additional dormant content for specific candidates based on their Personal Needs and Preferences (PNP). QTI 3 content may reference external "web content" files, such as images, video, or audio files, which can be packaged with the QTI 3 content files to create a QTI 3 content package.

The test structures may include further information about the structure of test, including the order of possible parts, sections, and items, or even adaptive testing information, as well as outcomes processing information. The test structure may also include instructions or information which is intended to be delivered to the candidate. All tests must contain at least one test part, and all parts must contain at least one section. Sections can contain further sections, which is referred to as "nested sections" in QTI. Adaptive testing includes staged adaptive by using preconditions and branch-rules or by using an external (IRT-based) adaptive algorithm (newly introduced in QTI 3). See Section 4 for more information on the Test structure. See Section 4.3 and 4.4 for more specifics around test parts and sections.

Assessment items contain the bulk of the content that is presented to candidates, and it is the only structure which allows for candidates to respond to questions via interactions. The assessment items also contain the response processing and outcome variables which provide the correct (or partially correct) responses and how to score those responses. See Section 3 for a complete description of the assessment item structure.

Assessment items often relate to a common, shared stimulus. This shared stimulus is contained in a stimulus structure, and is referenced from an assessment item.  See Section 3.7.7 for more specific information on Shared Stimulus content.

The sequence and structure of any valid QTI 3 file (tests, parts, sections, items, and stimulus) included in a content package is regulated by its associated XML Schema Definition (XSD). QTI 3 does leverage a number of W3C standards (HTML, MathML, CSS, SSML to name a few) which cannot be completely validated using the IMS validators. When using these related standards, the expectation is that implementers will follow the best practices recommended for each of the standards.

The content package also provides the mechanism for resolving hrefs used in QTI content to the actual resources providing that content. In many cases the content package may resolve a href (e.g. "items/item1.xml") to a URL relative to the base href of the content package, but there are some advanced content packaging use cases which may resolve the href to a variant of the resource (e.g. a file with the item translated to a different language) or may indicate that the resource is not directly rendered by the delivery engine, but must instead be LTI launched. For more information on QTI content packages see Section 6.

2.1 Metadata

QTI 3 makes use of the following metadata standards: QTI, Learning Object Metadata (LOM), and curriculum standards.

2.1.1 QTI Metadata

This allows metadata specific to QTI 3 to be added to a QTI 3 item resource in the imsmanifest.xml file.

Full details of the QTI 3 metadata model can be found in the IMS QTI Metadata Information Model and XSD Binding Version 3.0 document, but some of the defined metadata fields cover:

  • the interaction types used in the item
  • whether the item is a composite item
  • whether the item is time dependant or not
  • whether the item is adaptive or not
  • whether the item will generate feedback or not, and if the feedback is adaptive
  • whether the item makes a model solution available
  • whether the item is a concrete instance or a template used to create a concrete instance
  • how the item will be scored, by QTI response processing, by a human or by some form of external machine scoring
  • some information on the tool used to author the item

2.1.2 LOM Metadata

Metadata following the IMS QTI 3 profile of IEEE LOM can also be included, as well as the LOM metadata which can be applied to learning resources generally. This profile provides some rules on how to map QTI concepts to standard LOM fields. For example, that the test or item identifier should be present as an identifier in the LOM metadata. This profile also adds some additional QTI specific vocabularies as an extension to LOM. For example, it supports the Resource Discovery Network Resource Type Vocabulary (RDN/LTSN).

2.1.3 Curriculum Standards Metadata

This allows learning standards and IMS CASE (Competencies and Academic Standards Exchange) identifiers to be associated with a test or item. See the example in section 6.4 on support for CASE in QTI.

2.2 Markup Languages

2.2.1 XML

The QTI Information Model [QTI-INFO-30] is defined as an eXtensible Markup Language (XML) instance and bound by a set of XML Schema Definition (XSD) files. XML is a W3C Recommendation designed to store and transport data and provides the flexibility and extensibility necessary for QTI assessment content or data to be easily organized and exchanged.

2.2.2 HTML5

Beginning in version 2.2, QTI added a select group of HTML5 elements to the standard. These elements were primarily chosen to increase the accessibility of the assessment content. QTI 3 continues to use a subset of the the complete HTML5 specification to maintain the interoperability of the content being exchanged.

In QTI 3, there is an increased emphasis on the use of HTML5 markup. While the class attribute has been available in previous versions, the use of specific QTI standardized presentation classes was developed to increase rendering interoperability. This new approach uses classes where appropriate: for specifying styling information (presentation). An enumerated, shared vocabulary of styles (prefixed by the qti- prefix) will be maintained outside of the QTI specification (schema) to improve interoperability of styling information. See Section 3 for more details.

If a certain style does not exist in the shared vocabulary while authoring assessment content, a custom one can be used; if this happens frequently for a specific style, the style is a candidate for inclusion in the shared vocabulary.

For specifying behavior (semantics) outside of the existing QTI attributes, custom data attributes ( data-) should be used. In case a certain data- attribute is used frequently, and becomes a best  practice, it is a candidate for promotion to a built-in attribute, part of the QTI schema.

The new standardized QTI presentation classes and attributes use a "qti" prefix in their naming in the hope of preventing class naming conflicts. For all standardized QTI presentation classes, the names begin with "qti-"; for example "qti-labels-decimal" (used for interaction choices). For standardized custom attributes related to presentation, the attribute names begin with "data-qti-"; for example "data-qti-max-selections-message."

The use of these QTI-specific classes and attributes is generally described in the interactions or features for which they are intended. A full list of all standardized QTI vocabulary is included in Appendix B, and the complete documentation and example CSS is found in the QTI 3 Standardized Shared Vocabulary and CSS Classes document.

Note that in XML, attributes MUST contain a value to be valid. HTML allows for some boolean attributes to leave out the values, for example <video controls> to indicate the video should include controls. The QTI 3 XML validator would flag this markup as invalid. In QTI 3, you should use a "true" value for HTML boolean attributes except in the following cases:

  1. For the audio and video elements in QTI 3 markup, the "controls" attribute MUST include a value for the attribute to be valid XML. As per the HTML 5 specification, the way to exclude controls is to explicitly not include the attribute in the audio or video element. In QTI 3, valid values to include controls are "controls" (as per the HTML specification) or "true" (the more traditional boolean value for XML). So <video> would mean the controls are not provided to the candidate (as in the example below), and <video controls="controls"> would indicate the candidate should be provided with media controls.
  2. For the "default" attribute, use default="default" (though "true" is also valid).

2.2.3 CSS3

QTI 3 does allow for the inclusion of Cascading Style Sheets (CSS) version 3 in content files to transfer the preferred rendering and behavior for test presentation. However, given the complexities of cascading styles, features such as @import and image references, and their possible conflict with delivery system default styles, the automatic acceptance of stylesheets is not required by certified QTI systems. Some assessment programs may, at their own discretion, create and demand support for their own stylesheets as part of the agreed upon scope of work for a particular contract or program.

Associating a stylesheet with an item, a test, a section, a rubric block, template block, feedback structure, or stimulus to control appearance involves using the QTI stylesheet element within the content structure.

There are specific sequential places within a given QTI XML file that can reference stylesheets, and some substructures within the XML files can also reference stylesheets. In each instance, multiple stylesheets can be listed, with the expectation that the styles "cascade" – where stylesheets listed after other stylesheets override previous stylesheets. However, there are instances where stylesheet references are made within nested nodes of the content, and the stylesheet within these nested nodes are meant to be scoped to that node only, and not intended to apply to any other content. For example, assessment items can contain references to stimulus, where the stimulus has a reference to a stylesheet. In this case, the stylesheet within the stimulus is intended only for that stimulus, and not applied to the item content. Similarly, if a stylesheet reference is made from within a rubric block within the qti-item-body node, the stylesheet for the rubric block is scoped only to that specific rubric block, and not for any other rubric blocks within that item, or the item content itself.

Adding a reference to a stylesheet is done by referencing the stylesheet from your file, as shown in the example below.

<qti-stylesheet href="style/custom/your-styles.css" type="text/css" />

Disclaimer: some systems will reject custom CSS as part of item content to maintain overall visual consistency. Only use custom CSS on the item-level as a last resort.

QTI 3 has adopted the "Shared Vocabulary" approach to improve the interoperability for the presentation of assessment content. Use the QTI 3 Standardized CSS Shared Vocabulary and CSS Classes document to reference the shared vocabulary for visual consistency. The use of these QTI-specific classes and data attributes is generally described in the interactions or features for which they are intended.

QTI 3 does not support the use of CSS 3 Speech.

For CSS introduced by item authors or QTI authoring systems via the stylesheet element, a qti-portable-custom-interaction would be able to dynamically insert CSS at run time into the HTML markup associated with the interaction. It is recommended that any such CSS generated be scoped to the interaction.

2.2.4 MathML

QTI 3 permits the use of MathML version 3 directly within the portions of the XML files that use HTML5 markup.

The simple example below illustrates the inclusion of a mathematical expression marked up with MathML into an item.

<!-- This example adapted from the PET Handbook,
  copyright University of Cambridge ESOL Examinations -->
<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/qti/imsqti_asiv3p0_v1p0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.imsglobal.org/xsd/qti/imsqti_itemv3p0_v1p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd" identifier="math"
title="Relativity" adaptive="false" time-dependent="false" xml:lang="en">
  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier">
    <qti-correct-response>
      <qti-value>E</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"/>
  <qti-item-body>
    <qti-choice-interaction response-identifier="RESPONSE" max-choices="1">
    <qti-prompt>Which famous scientist is popularly associated with the equation
        <div role="math" aria-label="E equals m c squared">
          <math xmlns="http://www.w3.org/1998/Math/MathML" >
            <mrow>
              <mi>E</mi>
              <mo>=</mo>
              <mi>m</mi>
              <msup>
                <mi>c</mi>
                <mn>2</mn>
              </msup>
            </mrow>
          </math>?
      </qti-prompt>
      <qti-simple-choice identifier="E">Einstein</qti-simple-choice>
      <qti-simple-choice identifier="G">Galileo</qti-simple-choice>
      <qti-simple-choice identifier="H">Hawking</qti-simple-choice>
      <qti-simple-choice identifier="N">Newton</qti-simple-choice>
    </qti-choice-interaction>
  </qti-item-body>
  <qti-response-processing
   template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/match_correct"/>
</qti-assessment-item>

1EdTech hosts schemas from external namespaces for efficient validation. Note that within this Guide, schema locations and namespaces may not be included in the examples here for ease of reading.

2.2.5 Other Specialized Markup Languages

Specialized markup languages such as Chemical Markup Language (CML) exist for many domains that have a need for computer aided assessment. For that reason, integrating such markup languages with QTI is desirable. Other markup languages include MathML, SVG, and SSML.

A markup language that is widely supported by browsers is Scalable Vector Graphics [SVG]. While direct markup is not supported in the QTI 3 qti-item-body structure at this time, it is easy to include via HTML's 'img' or  'object' tag. Domain specific languages such as CML can often be rendered as SVG, thus providing a convenient way to integrate material with QTI 3.

At present, QTI's qti-printed-variable can be used within MathML and HTML.

A feature that is under consideration for future inclusion is the use of SVG and other languages via HTML 5's 'embed' tag [html5]. The use of this tag is not currently supported either within or outside HTML's 'object' tag.

2.2.6 SSML & PLS

There are two different methods for providing pronunciation information in assessment content that could be consumed by Text-to-Speech (TTS) software (and by extension Screen Reader software) in QTI 3. They are:

  • PLS
  • SSML

See Section 5 for examples that use SSML & PLS pronunciation.

2.3 QTI 3 Conventions

2.3.1 Use of data- attributes

The custom data-* attribute extends QTI 3.0 to support additional features. When defining a custom attribute, the best practice is to utilize clear naming conventions that describe what the attribute does in order to support interoperability. Documentation for your items should also include detailed information about intended use of custom attributes. Below is an example item with documentation on how each custom attribute is intended to be used.

Example of possible use cases:

items/data-attributes.xml

In this example qti-hottext element:

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd" 
identifier="data-attribute-example" title="Use of data-attribute" 
adaptive="false" time-dependent="false" xml:lang="en-US">
  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier">
    <qti-correct-response>
      <qti-value>B</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float">
    <qti-default-value>
      <qti-value>0</qti-value>
    </qti-default-value>
  </qti-outcome-declaration>
  <qti-item-body>
    <p>Select the error in the following passage of text (or "No Error" if there is none).</p>
    <qti-hottext-interaction response-identifier="RESPONSE" max-choices="1"

      data-group-name="group1" data-deselection-allowed="false" data-dont-word-wrap="false" >

      <p>Sponsors of the Olympic Games <qti-hottext identifier="A">who bought</qti-hottext> 
      advertising time on United States television
        <qti-hottext identifier="B">includes</qti-hottext>
        <qti-hottext identifier="C">at least</qti-hottext> a dozen international firms
        <qti-hottext identifier="D">whose</qti-hottext> names are familiar to American consumers.<br/>
        <qti-hottext identifier="E">No error.</qti-hottext>
      </p>
    </qti-hottext-interaction>
  </qti-item-body>
  <qti-response-processing 
   template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/match_correct.xml"/>
</qti-assessment-item>

The data-group-name  allows for radio button group assignment.

The data-deselection-allowed  sets whether or not students can deselect that option.

The data-dont-word-wrap  defines if that option is allowed to wrap onto a new line.

2.3.2 Markup Styles and Conventions

QTI 3 introduces a limited number of shared CSS style names  and conventions for use by authoring and delivery systems. See the QTI 3 Standardized Shared Vocabulary and CSS Classes for complete documentation.

By implementing these shared styles and conventions, QTI 3 authoring and delivery platforms can safely import/export – or render – items while preserving certain presentation characteristics without using custom stylesheet injection. Note that all of the shared styles are prefaced by the "qti-" string so as to avoid collisions with a delivery platform's existing CSS.

2.3.3 Use of id and identifier in QTI Content

One attribute, "identifier", is about QTI and it has specific rules regarding format and the QTI information model. On the other hand, "id" is an HTML/XML attribute, and it has different formatting rules, as well as the expectation that an element's id must be unique within the document or else the DOM is considered broken.

2.4 Accessibility of QTI 3

QTI 3 has several methods for achieving accessibility, primarily through the use of W3C web accessibility standards (including selected HTML5 elements, WAI-ARIA 1.0, SSML 1.1, and PLS 1.0), and the use of a QTI 3 feature called "catalog" referencing.

Valid QTI 3 content many contain web accessibility markup, including Accessible Rich Internet Applications [wai-aria] 1.0 and Speech Synthesis Mark-up Language [speech-synthesis11] 1.1 in the text-based HTML content. QTI also allows for some additional HTML5 tags in the HTML markup, to aid in the structural intent of the content to aid Assistive Technology test takers. Content instances may also reference Pronunciation Lexicon Standard [pronunciation-lexicon] files to instruct Text-to-Speech Synthesis engines on pronunciation, emphasis, and timing.

In addition to promoting the use of international internet accessibility markup, QTI 3 has additional supports that may assist candidates in accessing assessment content, or receiving special assessment accommodations. The specific needs of candidates can be provided to delivery systems using the data provided in a candidate's Personal Needs & Preferences (PNP) file (see Section 5). Alternate or additional content can be authored and exchanged in QTI 3 files which is intended to be provided to candidates who specifically request this alternate or additional content (see Section 5).

2.4.1 Use of W3C Standards in QTI

Assessment delivery systems that use web delivery platforms can be made accessible to Assistive Technology audiences by using standardized accessible web markup. QTI v3 supports and encourages the use of W3C standards, including HTML5, WCAG 2.0, WAI-ARIA 1.0, SSML 1.1, MathML 3, CML, CSS3 (except CSS3 Speech), and PLS. The proper use of these standards will greatly increase the accessibility of the assessment content exchanged in a QTI 3 content package. For guidance around the proper use of the W3C standards for accessibility, use the extensive online W3C documentation .

While W3C recommended techniques are continuously being modified, the exchange of QTI 3 content may have more restricted markup, using fixed released versions and accepted best practices for content transfer. However, delivery systems may choose to adopt newer techniques for the candidate-facing code during presentation (a live assessment session). The methods that are most likely to give candidates access to content, and the ability to respond to interactions, are encouraged to be implemented as soon as they are available and robust enough to be practically implemented.

2.4.2 Candidate Profiles

QTI 3 is capable of using candidate profiles to offer assessment presentation modifications for specific candidates. QTI 3 uses the Access for All® (AfA®) 3.0 standard [AFA-30] for the exchange of candidate profiles, also known as Personal Needs & Preferences (PNP) profiles. The vocabulary used in AfA 3.0 is closely aligned with the predefined supports that can be provided in QTI 3 content.

Through the use of a candidate PNP, a delivery system can provide additional assessment tools for candidates, modify the assessment session parameters (e.g., time limits), or inform test proctors of any special needs of the candidate. Additionally, the assessment content can contain content alternatives or supplemental content that can be activated based on the specific support needs of the candidate.

A description of all the QTI 3 predefined supports can be found in Section 5 of this guide.

2.4.3 Using Catalogs to Store Support-Specific Content

QTI 3 uses a feature called "catalogs" to provide additional content for specific supports which can be activated for specific users, either based on their candidate PNP information or through other test administrative controls. Within an item, any element within the qti-item-body (including the qti-item-body element itself) can point to a referenced container called a "catalog" that contains one or more snippets of content that support the referencing content.

A general description of how to reference and use catalogs can be found in Section 3.7.10, and examples for each of the QTI 3 profile of the AfA 3.0 supports can be found in Section 5.

2.5 Use of Portable Custom Interactions (PCI)

QTI defines a rich set of interaction types but it is not possible for QTI to fully define all interaction types which may be required by educational organizations, particularly with growth in the use of technology enhanced items.

QTI 2 offered an extension mechanism, customInteraction, which allowed interaction content not defined in the QTI Assessment Test, Section and Item specifications to be included in a QTI assessment item, but such items are not in general inter-operable.

To address this interoperability gap, a best practice, known as the Portable Custom Interaction (PCI), was established for QTI 2, which standardizes the contents of a custom interaction element so that it can be utilized by any assessment engine which implements the Portable Content Interaction Best Practice.

In QTI 3 this has been superseded by the introduction of a new interaction type, qti-portable-custom-interaction which makes an enhanced version of this best practice part of the QTI specification. For more information see Section 3.2.23 and Section 3.7.12.

2.6 Results and Metrics: Caliper Assessment Metric Profile

In addition to using the Response Processing Templates in Section 3.4 to score items, there is now a QTI 3.0 Assessment Profile for Caliper Analytics® in development. Adopting this profile allows use of the IMS learning  Sensor API™to define basic learning events and to standardize and simplify the gathering of learning metrics across learning environments. Using Caliper to capture student activity during an assessment will allow for metrics that are unavailable from a simple score on each item. For more details on Caliper Analytics [CALIPER-11] please review the latest specification.

Review the  Results Reporting Specification [QTI-RR-30] for more information.

2.7 Internationalization

2.7.1 BI-directional Text and Content

Item authors might want to specify the base directionality of their item contents. This is done by the 'dir' attribute, enabling text and content bi-directionality (BIDI). Although the [UNICODE] specification supports directionality of characters, the 'dir' attribute enables item authors to specify the direction of texts but also other kinds of contents, such as tables or interactions. The Content Model described by QTI 3.0 Information Model obey to bidirectional algorithm, inheritance of text direction information, and direction of embedded text specified by the [html40] and [html5] specifications.

The following example is an Hebrew version of the Composition of Water item. An enclosing div' has a 'dir' attribute with a value of "rtl" (Right to Left). As a result, the 'rtl' directionality is in effect (by inheritance) for all nested block elements. The ChoiceInteraction and its content must be then displayed from right to left as well.

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd" 
identifier="choice_multiple_rtl_he" title="Composition of Water (Hebrew)" 
adaptive="false" time-dependent="false" xml:lang="he">
  <qti-response-declaration identifier="RESPONSE" cardinality="multiple" base-type="identifier">
    <qti-correct-response>
      <qti-value>H</qti-value>
      <qti-value>O</qti-value>
    </qti-correct-response>
    <qti-mapping lower-bound="0" upper-bound="2" default-value="-2">
      <qti-map-entry map-key="H" mapped-value="1"/>
      <qti-map-entry map-key="O" mapped-value="1"/>
      <qti-map-entry map-key="Cl" mapped-value="-1"/>
    </qti-mapping>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"/>
  <qti-item-body>
    <div dir="rtl">
      <qti-choice-interaction response-identifier="RESPONSE" shuffle="true" max-choices="0">
        <qti-prompt>איזה מהגורמים הבאים משמשים ליצירת מים</qti-prompt>
        <qti-simple-choice identifier="H" fixed="false">מימן</qti-simple-choice>
        <qti-simple-choice identifier="He" fixed="false">הליום</qti-simple-choice>
        <qti-simple-choice identifier="C" fixed="false">פחם</qti-simple-choice>
        <qti-simple-choice identifier="O" fixed="false">חמצן</qti-simple-choice>
        <qti-simple-choice identifier="N" fixed="false">חנקן</qti-simple-choice>
        <qti-simple-choice identifier="Cl" fixed="false">כלור</qti-simple-choice>
      </qti-choice-interaction>
    </div>
  </qti-item-body>
  <qti-response-processing template="https://www.imsglobal.org/question/qti_v3p0/rptemplates/map_response.xml"/>
</qti-assessment-item>
Figure 2 Composition of Water, Hebrew version (Illustration)
A sample orderInteraction item in Hebrew showing the possible answers to arrange in the proper order.

The next example describes the use of the bdo class to turn off the bidirectional algorithm for given text portions ("F1", "Rubens Barrichello", "Jenson Button", "Michael Schumacher").

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd" 
identifier="order_rtl_he" title="Grand Prix של בחריין" 
adaptive="false" time-dependent="false" xml:lang="he" >
  <qti-response-declaration identifier="RESPONSE" cardinality="ordered" base-type="identifier">
    <qti-correct-response>
      <qti-value>DriverC</qti-value>
      <qti-value>DriverA</qti-value>
      <qti-value>DriverB</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"/>
  <qti-item-body>
    <div dir="rtl">
      <qti-order-interaction response-identifier="RESPONSE" >
        <qti-prompt><bdo dir="ltr">F1</bdo> הנהגים הבאים סיימו על הפודיום בגרנד פרי בחריין
         הראשון אי פעם.אתה יכול לארגן אותם בסדר נכון הגמר?</qti-prompt>
        <qti-simple-choice identifier="DriverA"><bdo dir="ltr">Rubens Barrichello</bdo></qti-simple-choice>
        <qti-simple-choice identifier="DriverB"><bdo dir="ltr">Jenson Button</bdo></qti-simple-choice>
        <qti-simple-choice identifier="DriverC"><bdo dir="ltr">Michael Schumacher</bdo></qti-simple-choice>
      </qti-order-interaction>
      </div>
  </qti-item-body>
  <qti-response-processing 
   template="https://www.imsglobal.org/question/qti_v3p0/rptemplates/match_correct.xml"/>
</qti-assessment-item>
Figure 3 Grand Prix of Bahrain, Hebrew version (Illustration)
A sample orderInteraction item in Hebrew showing the possible answers to arrange in the proper order.

2.7.2 Ruby Markup

QTI 3.0 includes Ruby Markup support. Its intent is to provide a way to render small annotations rendered alongside base text. As explained in depth by the W3C Ruby Markup and Styling article, "Ruby is used in East Asian countries to describe characters that readers might not be familiar with, or describe the meaning of ideographic characters". [ruby] Markup in QTI 3.0 adheres to the description of W3C in [html5].

The item example below makes use of the ruby, rb and rt classes to annotate base text in paragraphs and choices. It uses the default Choice Interaction rendering of horizontally presented text from left-to-right.

<?xml version="1.0" encoding="UTF-8"?>
<!-- This example adapted from the PET Handbook, copyright University of Cambridge ESOL Examinations -->
<!-- The example combines shuffle with the fixation of one simpleChoice in place -->
<!-- Ruby markup is defined in NS hq5 (HTML5 for QTI), which is referenced in the main QTI 2.2 XSD -->

<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation=" http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd" 
identifier="choice_ruby" title="出身地" 
adaptive="false" time-dependent="false" xml:lang="ja" >
  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier">
    <qti-correct-response>
      <qti-value>ChoiceHK</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float">
    <qti-default-value>
      <qti-value>0</qti-value>
    </qti-default-value>
  </qti-outcome-declaration>
  <qti-item-body>
    <p>村田<ruby><rb></rb><rt>まこと</rt></ruby>の出身地はどこですか</p>
    <qti-choice-interaction response-identifier="RESPONSE" max-choices="1" class="qti-labels-cjk-ideographic" >
      <qti-prompt>選びなさい</qti-prompt>
      <qti-simple-choice identifier="ChoiceHK"><ruby><rb>北海道</rb><rt>ほっかいどう</rt></ruby></qti-simple-choice>
      <qti-simple-choice identifier="ChoiceTH">東北</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceHR">北陸</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceKT">関東</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceKST">甲信越</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceKK">近畿</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceKS">関西</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceSK">四国</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceTC">中国</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceKY">九州</qti-simple-choice>
    </qti-choice-interaction>
  </qti-item-body>
  <qti-response-processing 
   template="https://www.imsglobal.org/question/qti_v3p0/rptemplates/match_correct.xml"/>
</qti-assessment-item>
Figure 4 Ruby Example (Japanese) — default Choice Interaction rendering
A sample choiceInteraction item using Ruby Markup in Japanese characters.

In this next ruby example, the standardized shared vocabulary is used to show the text vertically from right to left. Go to the QTI 3 Standardized Shared Vocabulary and CSS Classes document for additional vertical text options.

<?xml version="1.0" encoding="UTF-8"?>
<!-- This example adapted from the PET Handbook, copyright University of Cambridge ESOL Examinations -->

<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation=" http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd" 
identifier="choice_ruby_i23n" title="出身地" 
adaptive="false" time-dependent="false" xml:lang="ja" >
  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier">
    <qti-correct-response>
      <qti-value>ChoiceHK</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float">
    <qti-default-value>
      <qti-value>0</qti-value>
    </qti-default-value>
  </qti-outcome-declaration>
  <qti-item-body>
  <div class="qti-height-96 qti-writing-mode-vertical-rl qti-float-right">
    <p>村田<ruby><rb></rb><rt>まこと</rt></ruby>の出身地はどこですか</p>
    <qti-choice-interaction response-identifier="RESPONSE" max-choices="1"
    class="qti-labels-cjk-ideographic qti-writing-orientation-vertical-lr" >
      <qti-prompt>選びなさい</qti-prompt>
      <qti-simple-choice identifier="ChoiceHK"><ruby><rb>北海道</rb><rt>ほっかいどう</rt></ruby></qti-simple-choice>
      <qti-simple-choice identifier="ChoiceTH">東北</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceHR">北陸</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceKT">関東</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceKST">甲信越</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceKK">近畿</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceKS">関西</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceSK">四国</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceTC">中国</qti-simple-choice>
      <qti-simple-choice identifier="ChoiceKY">九州</qti-simple-choice>
    </qti-choice-interaction>
    </div>
  </qti-item-body>
  <qti-response-processing 
   template="https://www.imsglobal.org/question/qti_v3p0/rptemplates/match_correct.xml"/>
</qti-assessment-item>
Figure 5 Ruby Example with Vertical Text, set Right-to-Left (Japanese)
A sample choiceInteraction item using Ruby Markup in Japanese characters.

3. Item Structure

Items are the essential building blocks of an assessment and make up the bulk of the test material. Items contain the assessment stimuli and prompts (the questions), and also the response areas (the interactions) and scoring instructions.

In order for organizations to exchange the assessment items, the item files may also need to contain a variety of data elements that support the item content. These data elements  are briefly explained in this subsection, and with greater details throughout Section 3 of this implementation guide. An assessment item encompasses the information that is presented to a candidate and information about how to score the item. Scoring takes place when candidate responses are transformed into outcomes by response processing rules.

3.1 The qti-assessment-item Element

The qti-assessment-item element contains all the other QTI 3 item structures, and the opening qti-assessment-item element contains the following attributes (* denotes the attribute is required):

  • All namespace declarations, including schema locations*
  • identifier*
  • title*
  • label
  • language (xml:lang)
  • tool name (tool-name)
  • tool version (tool-version)
  • adaptive item indicator (adaptive)
  • time dependent (time-dependent) item indicator*

The qti-assessment-item node must contain an "identifier" attribute with a non-null string to identify the item. It is used to identify the item as a unique entity within the context of the exchange of assessment content, so organizations may wish to add organizational prefixes to their identifier information to ensure uniqueness among multiple vendors.

The "title" is an additional required attribute, which generally contains a more human readable string of text that describes the item. It is often presented to authors and reviewers, sometimes to candidates.

You can optionally add a "label" as an attribute, in whatever way is meaningful as an organizational label for the item(s). The 'label' attribute is typically used to identify, or label, workflow or process aspects of the Item. Typically the value in 'label' is used to support various tools.

The "xml:lang" attribute is optional, though it should be included as a best practice, as the language is a primary accessibility support for web-based documents.

Both the "tool-name" and "tool-version" are optional elements, which usually indicate the tool name and version that generated the item.

The "adaptive" attribute is also optional, and the default value is false, where only boolean values (true/false) are permitted. By not including the adaptive attribute, the item will NOT be considered adaptive (changing to the responses of the candidate). The adaptive attribute is not related to adaptive assessments, where the sequence of the item within the context of an assessment is non-linear. See Section 3.7.2  for more information on item adaptivity.

The "time-dependent" attribute is a required attribute, where boolean values (true/false) are permitted. A time dependent item (time-dependent="true") is one in which time; i.e., the amount of time a candidate is provided by a delivery system to enter a response, is important for the psychometric properties - the calibration - of the item. Along with response evaluation, this attribute can also be used in conjunction with other Test attributes by delivery systems to enforce candidate attempt duration limits.

3.1.1 Structures within the qti-assessment-item Node

The QTI-specific XML structures are described in the QTI 3Item XSD. The QTI 3 Item XSD can be found at https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_itemv3p0_v1p0.xsd , which is a subset of the full QTI 3 XSD found at https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd. The namespace is http://www.imsglobal.org/xsd/imsqtiasi_v3p0

An item typically includes the following information:

  • Scoring data
  • The item content presented to the candidate, which itself contains:
  • Any directions/instructions
  • Any stimuli or references to stimuli
  • The prompt(s)
  • The interaction(s)
  • Feedback for the candidate
  • Supplemental content or references to supplemental content
  • Content displayed, voiced, or printed, contingent on the candidate's Access for All (AFA) Personal Needs and Preferences (PNP)

The above information is stored in specific QTI 3structures, and must be supplied in the sequence listed below :

  1. qti-context-declaration
  2. qti-response-declaration
  3. qti-outcome-declaration
  4. qti-template-declaration
  5. qti-template-processing
  6. qti-assessment-stimulus-ref
  7. qti-companion-materials-info
  8. qti-response-processing
  9. qti-modal-feedback

The inclusion or exclusion of the above structures depends on the complexity of the item, and on the needs of the assessment program using the assessment content.

Scoring an item can be quite complex, and the information used to provide the response information and the score(s)received (the outcome(s)) are possible using a combination of the following structures:

  1. qit-context-declaration
  2. qti-response-declaration
  3. qti-outcome-declaration
  4. qti-response-processing

Content (and content presentation data) to be presented to the candidate is supplied or referenced in a combination of these structures:

  1. qti-assessment-stimulus-ref
  2. qti-companion-materials-info
  3. qti-stylesheet
  4. qti-item-body

Content presented to candidates using variables use these structures:

  1. qti-template-declaration
  2. qti-template-processing
  3. qti-catalog-info
  4. qti-modal-feedback

A brief introduction to the AssessmentItem structures is provided below.

3.1.1.1 Context Declaration

The qti-context-declaration nodes are used to make "contextual" variable declarations that are global in scope to an item. When evaluating TemplateProcessing and ResponseProcessing instructions in an AssessmentItem, having contextual information available in the information model can improve the effectiveness, efficiency, and personalization of TemplateProcessing and ResponseProcessing instructions. Contextual information can include candidate information, test information, and system (or environmental) information. Context declarations are also permitted in tests.  See Section 3.7.11  for a longer description of context declarations.

3.1.1.2 Response Declaration

Response variables are declared using qti-response-declaration nodes. Interactions in the itemBody must be bound to one of these declared variables . The response declaration supplies the values for the scoring of the item. It may indicate what the correct response is, or the partially correct response(s). The base-type and cardinality defined for a response variable must match the types and cardinality required by the interactions bound to that response variable.

3.1.1.3 Outcome Declaration

Outcome variables are declared using qti-outcome-declaration nodes. The outcome variables represent the score that the candidate can receive for responding to, or not responding to, the item. The outcomes variables values are set either from a default given in the outcome declaration itself or by a ResponseRule during ResponseProcessing. See Section 3.5  for a longer description of outcome declarations.

3.1.1.4 Template Declaration

Use qti-template-declaration nodes to declare item variables that are to be used specifically for the purposes of cloning items. Template variables can have their value set only during TemplateProcessing. Template declarations are referred to within the qti-item-body in order to individualize the clone and possibly also within the ResponseProcessing rules if the cloning process affects the way the item is scored. See Section 3.7.4  for a longer description of using templates in items.

3.1.1.5 Template Processing

Use the qti-template-processing node for template processing. Template processing consists of one or more TemplateRules that are followed by a cloning engine or delivery system in order to assign values to the template variables. Template processing is identical in form to ResponseProcessing except that the purpose is to assign values to template variables, not outcome variables. See Section 3.7.4  for a description on using template processing in items.

Reference to a Shared Stimulus

The qti-assessment-stimulus-ref element can be used to associate one or more external; i.e., external to the qti-assessment-item XML, stimulus blocks with a particular item.  A common use case is to author and package a stimulus such as a passage, which can then be shared among multiple items. See Section 3.7.7  for more specifics on how to link items to a shared stimulus.

3.1.1.6 Companion Materials

The qti-companion-materials-info node is used to indicate if the item should be presented to candidates with other kinds of (built-in) assessment tools or materials (companion materials), including: calculators, protractors, rulers, digital materials, or physical materials. See Section 3.7.8  for a longer description of including companion materials in items.

3.1.1.7 Stylesheets

The qti-stylesheet nodes are used to associate external stylesheets for the item. QTI 3 supports CSS 2.1 and CSS 3.0 stylesheets (excluding speech). Any number of stylesheets can be included in an item. See Section 3.6  for examples of how to include stylesheets in items.

For conformance purposes, the use of stylesheets may be ignored by delivery systems, where support for stylesheets is not required for QTI applications.

For interoperability and implementation purposes, QTI shared vocabulary and CSS classes take precedence over CSS stylesheets. See the QTI 3 Standardized Shared Vocabulary and CSS Classes document for full details.

3.1.1.8 The Item Body

The qti-item-body node contains the text, graphics, media objects and interactions that describe the item's content and information about how it is structured. Only one qti-item-body node is allowed within an item. The qti-item-body is presented to candidates by combining the qti-item-body content with stylesheet information, either explicitly or implicitly using the default style rules of the delivery or authoring system. The ItemBody contains formatted, structured HTML content (see @@@ Section 2.3), as well as any prompt content (optionally contained within the qti-prompt nodes) and any interactions.

Composite items are items that contain more than one interaction within the ItemBody. Composite items may contain multiple instances of the same type of interaction or have a mixture of interaction types within the ItemBody. See Section 3.2  for documentation for specific QTI interactions, and Section 3.3  for the use of composite items. Note that while the qti-item-body node may contain multiple interactions, any interaction MUST NOT be nested or contained within other interactions. Items with nested interactions are not considered compliant to the QTI standard regardless of whether they pass validation or not.

Because ItemBody content is expected to be presented to candidates with a wide variance of perceptual, cognitive processing, physical capabilities, etc.; assessment content should be made as accessible as possible to the widest range of candidates. Guidance on how to provide accessible content is sprinkled throughout this implementation guide, but is certainly not the definitive nor complete documentation on providing accessible content to people. Implementers should stay current in methods and approaches that help increase access to assessment content for all users.

The ItemBody content must be presented to the candidate during an active assessment session. In the assessment session, the candidate must be able to interact with each of the presented interactions and therefore set or update the values of the associated response variables.

The ItemBody may be presented to the candidate when the item session is in the closed or review state. In these states, although the candidate's responses should be presented, the interactions must be disabled so as to prevent the candidate from setting or updating the values of the associated response variables.

The ItemBody may be presented to the candidate in the solution state, in which case the correct values of the response variables must be presented and the associated interactions disabled.

Adaptive items are a feature that allows an item to be scored adaptively over a sequence of attempts. This allows the candidate to alter their answer following feedback or to be posed additional questions based on their current answer.

The ItemBody may also contain rubric blocks (qti-rubric-block), which is content that may be presented to one of the possible audiences for the content, including the author, candidate, proctor, scorer, testConstructor, or tutor. This content would only be shown to the specified audience when the role of that audience is specifically known the system presenting the item. See Section 3.7.5  for more information on using rubric blocks in an assessmentItem.

3.1.1.9 Catalog Resources

The qti-catalog-info node holds one or more catalogs. The ItemBody content references specific catalogs within the qti-catalog-info node. Catalogs hold and reference item content that is presented to candidates based on their candidate profile (PNP) requirements. See Section 5 for a longer description of using catalogs to store support-specific content.  In addition to Section 5, there is an annotated item in Section 3.8.1  that includes the use of catalogs for encoding Glossaries and Keyword Translations.

3.1.1.10 Response Processing

Use the qti-response-processing node for response processing – the process by which a delivery engine assigns outcomes (the scores) based on the candidate's responses. Response processing can be achieved using either a response processing template (a reference to a common processing pattern), or by using customized response processing. See Section 3.4.2  for information on using response processing templates, and Section 3.7.1  for information on customized response processing.

3.2 Interaction Types

All QTI v2.2 interaction types are included in QTI 3. However, the interaction elements have been renamed to reflect a web component-friendly syntax which will enable QTI processors to render ItemBody interaction content - should they choose to do so – with web components, and without having to apply further interaction transformations.

The QTI 3 interaction web components-friendly vocabulary introduces the "qti-" prefix on every QTI element. Furthermore, camelcase elements and attributes are replaced with all-lowercase elements/attributes with hyphen separators. See the example below of a choice interaction with the QTI 3 web components-friendly vocabulary.

Example: qti-choice-interaction

<qti-assessment-item>
  . . .
  <qti-item-body>
    <p>Look at the text in the picture.</p>
    <p><img src="images/sign.png" alt="NEVER LEAVE LUGGAGE UNATTENDED" /></p>
    <qti-choice-interaction max-choices="1" response-identifier="RESPONSE">
      <qti-prompt>What does it say?</qti-prompt>
      <qti-simple-choice identifier="A">You must stay with your luggage at all times.</qti-simple-choice>
      <qti-simple-choice identifier="B">Do not let someone else look after your luggage.</qti-simple-choice>
      <qti-simple-choice identifier="C">Remember your luggage when you leave.</qti-simple-choice>
    </qti-choice-interaction>
  </qti-item-body>
</qti-assessment-item>

In another example (a hotspot interaction), note how the img element is considered an HTML element - and therefore not prefixed by "qti-" - even though it is a sub-element of an interaction.

Example: qti-hotspot-interaction

<qti-assessment-item>
  . . .
  <qti-item-body>
    <p>The picture below illustrates four of the most popular destinations for
    air travelers arriving in the United Kingdom: London, Manchester, Edinburgh and Glasgow.
    Please choose all of the cities Northof London.</p>
    <qti-hotspot-interaction max-choices="0" response-identifier="RESPONSE">

      <img src="ukair.png" height="280" width="206" alt="UK Map" />

      <qti-hotspot-choice identifier="A" shape="circle" coords="77,115,10" />
      <qti-hotspot-choice identifier="B" shape="circle" coords="118,184,10" />
      <qti-hotspot-choice identifier="C" shape="circle" coords="150,235,10" />
      <qti-hotspot-choice identifier="D" shape="circle" coords="96,114,10" />
    </qti-hotspot-interaction>
  </qti-item-body>
</qti-assessment-item>

QTI 3 includes the following standardized interactions:

  1. Choice (qti-choice-interaction): presents a set of choices to the candidate. The candidate's task is to select one or more of the choices, up to a maximum number of choices allowed. (See Section 3.2.2 )
  2. Text Entry (qti-text-entry-interaction): an inline interaction that accepts text from the candidate. (See Section 3.2.3 )
  3. Extended Text(qti-extended-text-interaction): a block interaction that allows the candidate to enter an extended amount of text.
  4. Gap Match (qti-gap-match-interaction): a block interaction that contains a number of gaps that the candidate can fill from an associated set of choices.
  5. Hot Spot(qti-hotspot-interaction): a graphical interaction with a corresponding set of choices that are defined as areas of the graphic image. The candidate's task is to select one or more of the areas (hotspots).
  6. Hot Text (qti-hot-text-interaction): presents a set of choices to the candidate represented as selectable runs of text embedded within a surrounding context, such as a passage of text.
  7. Inline Choice (qti-inline-choice-interaction): an inline interaction that presents the user with a set of choices, each of which is an answer option (usually text). The candidate's task is to select one of the choices.
  8. Match (qti-match-interaction): a block interaction that presents candidates with two sets of choices and allows them to create associations between pairs of choices in the two sets, but not between pairs of choices in the same set.
  9. Order (qti-order-interaction): the candidate's task is to reorder the choices, the order in which the choices are displayed initially is significant.
  10. Graphic Order(qti-graphic-order-interaction): A graphic order interaction is a graphic interaction with a corresponding set of hotspot choices that are defined as areas of the graphic image. The candidate's task is to impose an ordering on the areas (hotspots).
  11. Associate (qti-associate-interaction): a block interaction that presents candidates with a number of choices and allows them to create associations between them.
  12. Graphic Associate (qti-graphic-associate-interaction): a graphic interaction with a corresponding set of choices that are defined as areas of the graphic image. The candidate's task is to associate the areas (hotspots) with each other.
  13. Graphic Gap Match (qti-graphic-gap-match-interaction): a graphical interaction with a set of gaps that are defined as areas (hotspots) of the graphic image and an additional set of gap choices that are defined outside the image. The candidate must associate the gap choices with the gaps in the image and be able to review the image with the gaps filled in context, as indicated by their choices.
  14. Media (qti-media-interaction): allows more control over the way the candidate interacts with a time-based media object and allows the number of times the media object was experienced to be reported in the value of the associated response variable.
  15. Position Object (qti-position-object-interaction): consists of a single image which must be positioned on another graphic image (the stage) by the candidate.
  16. Select Point (qti-select-point-interaction): a graphic interaction in which the candidate's task is to select one or more points.
  17. Slider (qti-slider-interaction): presents the candidate with a control for selecting a numerical value between a lower and upper bound.
  18. Upload(qti-upload-interaction): allows the candidate to upload a pre-prepared file representing their response.
  19. Drawing(qti-drawing-interaction): allows the candidate to use drawing tools provided by the delivery system to modify a given graphical image (the canvas). The result is a file in the same format as the original image.
  20. Custom(qti-custom-interaction) and Portable Custom (qti-portable-custom-interaction): allow the item author to present an interaction with a custom user interface and behavior, supported by, respectively, delivery engine-specific or author-provided code.  Portable Custom Interactions (PCIs) allow the Javascript code implementing the interaction to be made available to delivery systems, with a standard Javascript interface, offering the potential for making PCIs more interoperable and portable between conforming delivery engines.
  21. End Attempt (qti-end-attempt-interaction): is a special interaction which immediately ends the current attempt on an assessment item.  It may be used, for example, to allow the candidate to request a hint or model solution, or in an adaptive item to let the candidate display feedback or to move to the next in a series of interactions in the item.

Each of the interactions described in the following sections can contain sub-elements and attributes. For full descriptions of these features, see the QTI 3 Information Model document.

3.2.1 Interoperability and Utilizing Shared Vocabularies

Previous versions of QTI lack specificity with respect to interaction presentation, styling, and behavior. Consequently, QTI authoring systems and delivery systems have implemented interactions with custom presentation/behavior definitions, which in turn have become an impediment to interoperability. To improve interaction presentation/behavior interoperability, QTI 3 introduces, "shared vocabularies" that describe more fine-grained presentation control and more semantically-explicit styling and behaviors.

There are two primary mechanisms of the QTI 3 interaction shared vocabularies:

  1. An interaction's class attribute, and
  2. An interaction's " data-" attributes.

In order to prevent collisions with existing classes, the QTI 3 interaction shared vocabularies  use classes with the "qti-" prefix.

Although the class and " data-" attributes already exist in QTI 2.2, the shared vocabularies explicitly define how to use these attributes to achieve certain agreed-upon rendered presentations. By agreeing to implement interaction styling and behaviors according to the definitions of the shared vocabularies, interaction interoperability may be greatly improved.

Implementers of custom presentations/behaviors should avoid using classes with the "qti-" prefix, and should also avoid using the QTI 3 established "data-" attributes from the shared vocabularies. Over time, it is the expectation that the shared vocabularies will evolve as common use-cases emerge.

When using classes that indicate that the presentation of content should be horizontal (qti-orientation-horizontal, qti-choices-stacking-2, etc.), it can force some of the choices outside the single width of the viewing portal, which can be problematic for candidates. For low-vision candidates using magnification (or text-appearance → font-size or word-spacing), the likelihood of horizontal scrolling is increased. When choices are placed off-screen, candidates can accidentally disregard the choices, candidates are required to use additional working memory to respond to the item, and it adds significant time for low-vision candidates.

If the candidate is known to have low-vision, and choices could be displayed beyond the width of a single viewport, presentation systems should consider presenting the choices vertically.

The 1EdTech QTI 3 Standardized Shared Vocabulary and CSS Classes document enumerates and details all of the currently adopted shared vocabulary.

3.2.2 Choice Interaction

The ChoiceInteraction.Type (qti-choice-interaction) interaction presents a collection of choices to the candidate. The candidate's task is to select one or more of the choices, up to a maximum of max-choices. The interaction is always initialized with no choices selected.

The ChoiceInteraction.Type must be bound to a response variable with a base-type of identifier and single or multiple cardinality.

In a choice interaction, it is considered best practice to use the shared vocabulary related to the layout of choices instead of using the optional orientation attribute. If both the shared vocabulary classes and the orientation attribute are used, the shared vocabulary classes take precedence over the orientation attribute value (including the default value of "vertical").

ChoiceInteraction Attributes (element: qti-choice-interaction)

Name Usage Value(s) Default
max-choices optional Non-negative integer 1
min-choices optional Non-negative integer 0 (unlimited)
orientation* optional Vocabulary:• horizontal• vertical vertical
shuffle optional boolean false

* Deprecated in favor of the shared vocabulary.

The choice interaction is made up of choices, which use the qti-simple-choice element (SimpleChoice.Type) to present an ordered list of choices to the candidate.

As noted in the table above, the "shuffle" attribute is optional and defaults to false.  However, if the shuffle attribute is set to "true", and the delivery engine supports the discretionary "shuffle" feature, the presentation system must randomize the order in which the choices are originally listed in the Assessment Item XML, subject to the value of the fixed attribute of each choice. If fixed is "true" for a choice then the position of this choice within the interaction must not be changed by the presentation system even if the immediately enclosing interaction supports the shuffling of choices. If no value is specified then the choice is free to be shuffled.

SimpleChoice (element: qti-simple-choice) Attributes

Name Usage Value(s) Default
identifier required Identifier
template-identifier optional Identifier
show-hide optional Vocabulary:• show• hide show
fixed optional boolean false

Here is an example of a choice interaction that allows the candidate to pick one choice (sometimes called single selection choice).

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item
 xmlns="http://www.imsglobal.org/xsd/qti/imsqtiasi_v3p0" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
 https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_itemv3p0_v1p0.xsd"
 identifier="beginnersguide007"
 title="BG true false example "
 time-dependent="false" 
 xml:lang="en-US">
 <qti-response-declaration base-type="identifier" cardinality="single" identifier="RESPONSE">
  <qti-correct-response>
   <qti-value>true</qti-value>
  </qti-correct-response>
 </qti-response-declaration>
 <qti-outcome-declaration base-type="float" cardinality="single" identifier="SCORE">
  <qti-default-value>
   <qti-value>1</qti-value>
  </qti-default-value>
 </qti-outcome-declaration>
 <qti-item-body>
  <p>This is a True/False question?</p>
  <qti-choice-interaction max-choices="1" response-identifier="RESPONSE">
    <qti-simple-choice identifier="true">True</qti-simple-choice>
    <qti-simple-choice identifier="false">False</qti-simple-choice>
  </qti-choice-interaction>
 </qti-item-body>
 <qti-response-processing
  template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/match_correct"/>
</qti-assessment-item>
Figure 6 Example of a Choice Interaction with a single choice permitted.
a choice interaction with two possible choices shown

Below is an example of a choice interaction that allows the candidate to select multiple response options to respond to the prompt.

Example: qti-choice-interaction (multiple cardinality)

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0
  https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
   identifier="QTI3multiplechoice2" title="QTI 3 Choice with Multiple Cardinality"
   xml:lang="en-US" time-dependent="false">
    <qti-response-declaration identifier="RESPONSE" cardinality="multiple" base-type="identifier">
      <qti-correct-response>
        <qti-value>H</qti-value>
        <qti-value>O</qti-value>
      </qti-correct-response>
    </qti-response-declaration>
    <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"/>
    <qti-item-body>
      <qti-choice-interaction response-identifier="RESPONSE" min-choices="1" max-choices="6">
        <qti-prompt>Which of the following elements are used to form water?</qti-prompt>
        <qti-simple-choice identifier="H">Hydrogen</qti-simple-choice>
        <qti-simple-choice identifier="He">Helium</qti-simple-choice>
        <qti-simple-choice identifier="C">Carbon</qti-simple-choice>
        <qti-simple-choice identifier="O">Oxygen</qti-simple-choice>
        <qti-simple-choice identifier="N">Nitrogen</qti-simple-choice>
        <qti-simple-choice identifier="Cl">Chlorine</qti-simple-choice>
      </qti-choice-interaction>
    </qti-item-body>
   <qti-response-processing 
    template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/match_correct"/>
  </qti-assessment-item>
Figure 7 Expected Rendering: Choices rendered in a single column, vertically oriented.
Question with 6 response options presented vertically (each option on a new line).

By default, in the absence of any shared vocabulary, the presentation of each choice control, label, label suffix, and description, is left to the implementer, with the only requirement that the choices are displayed in a single column, vertically oriented.

The qti-choice-interaction has a considerable amount of its shared vocabulary dedicated to the presentation/layout of the interaction's associated qti-simple-choices. Each qti-simple-choice consists of a collection of elements, displayed from left to right, defined as follows:

  1. A "control"; e.g., either a radio button or checkbox control, and
  2. A "label"; e.g., often an alphanumeric character such as, "A", "B", "1", "2", etc.
  3. A "label suffix"; e.g., a "." or ")" character after the label, and
  4. A "description"; e.g., the HTML content contained by a qti-simple-choice element

Go to the 1EdTech QTI 3 Standardized Shared and CSS Classes section on Choice Interaction classes for full details.

3.2.3 Text Entry Interaction

A Text Entry Interaction is an inline interaction that obtains a simple piece of text from the candidate. Like qti-inline-choice-interaction, the delivery engine must allow the candidate to review their choice within the context of the surrounding text.

The TextEntryInteraction.Type (qti-text-entry-interaction) must be bound to a response variable with single or record cardinality only. If the response variable has single cardinality the base-type must be one of string, integer or float; if it has record cardinality the permitted fields are 'stringValue', 'floatValue', etc.

TextEntryInteraction Attributes (element: qti-text-entry-interaction)

Name Usage Value(s) Default
response-identifier required Identifier
base optional xs:int Default is 10.
string-identifier optional Identifier of a qti-response-declaration with base-type=string
expected-length optional Non-negative integer
pattern-mask optional string
placeholder-text optional string
format optional Normalized string

Below is an example of a Text Entry Interaction:

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item 
 xmlns="http://www.imsglobal.org/xsd/qti/imsqtiasi_v3p0" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
 https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_itemv3p0_v1p0.xsd"
 identifier="bpig010"
 title="Text Entry example"
 time-dependent="false" 
 xml:lang="en-US">
 <qti-response-declaration identifier="RESPONSE" base-type="string" cardinality="single">
  <qti-correct-response>
   <qti-value>York</qti-value>
  </qti-correct-response>
  <qti-mapping default-value="0">
   <qti-map-entry map-key="York" mapped-value="1" case-sensitive="true" />
   <qti-map-entry map-key="york" mapped-value="0.5" />
  </qti-mapping>
 </qti-response-declaration>
 <qti-outcome-declaration base-type="float" cardinality="single" identifier="SCORE" />
 <qti-item-body>
  <p>Identify the missing word in this famous quote from Shakespeare's Richard III.</p>
  <div>
   <blockquote>
    <p>Now is the winter of our discontent<br/>
      Made glorious summer by this sun of <qti-text-entry-interaction response-identifier="RESPONSE" />;<br/>
      And all the clouds that lour'd upon our house<br/>
      In the deep bosom of the ocean buried.</p>
   </blockquote>
  </div>
 </qti-item-body>
 <qti-response-processing template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/map_response" />
</qti-assessment-item>

Which might look something like this when presented to candidates:

Figure 8 A sample text entry item as it might be presented during an assessment.
Four sentences are presented with the second sentence having a text entry box at the end of the line.

The scoring for this item could have just matched the correct response (in the response declaration) but actually uses a mapping to enable partial credit for an improperly capitalized city name (spelled without a capital letter, or all caps, or other capitilization error). When mapping strings the mapping, by default, is NOT case sensitive. This example also illustrates the use of the mapping when the response only has single cardinality.

The bulk of the shared vocabulary for the Text Entry interaction adds further definition to the presentation width of the input element by utilizing the class attribute. Go to the 1EdTech QTI 3 Standardized Shared and CSS Classes section on Text Entry Interaction classes for full details.

3.2.4 Extended Text Interaction

If an extended written response is required from the candidate then the Extended Text Interaction (qti-extended-text-interaction) is appropriate. An extended text interaction is a block Interaction that allows the candidate to enter an extended amount of text.

ExtendedTextInteraction Attributes (element: qti-extended-text-interaction)

Name Usage Value(s) Default
base optional xs:int 10
string-identifier optional Identifier of a response variable with base-type=string
expected-length optional Non-negative integer
pattern-mask optional xs:string
placeholder-text optional xs:string
max-strings optional Non-negative integer
min-strings optional Non-negative integer 0 (unlimited)
expected-lines optional Non-negative integer
format optional Vocabulary:
 • plain
 • preformatted
 • xhtml
plain

The qti-extended-text-interaction must be bound to a response variable of single, multiple, ordered or record cardinality. If the response variable has record cardinality the fields in the record must be 'stringValue', 'floatValue', etc. Otherwise it must have a base-type of string, integer or float. When bound to response variable with single cardinality a single string of text is required from the candidate. When bound to a response variable with multiple or ordered cardinality several separate text strings may be required.

The extended text interaction allows a candidate to supply a text string for a response. A basic example of the markup is shown below.

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item 
 xmlns="http://www.imsglobal.org/xsd/qti/imsqtiasi_v3p0" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
 https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_itemv3p0_v1p0.xsd"
 identifier="bpig009"
 title="Extended Text example"
 time-dependent="false" 
 xml:lang="en-US">
 <qti-response-declaration identifier="RESPONSE" base-type="string" cardinality="single" />
 <qti-outcome-declaration base-type="float" cardinality="single" identifier="SCORE" />
 <qti-item-body>
  <p>Read this postcard from your English pen-friend, Sam.</p> 
   <div>
    <blockquote class="postcard">
     <p>Here is a postcard of my town. Please send me<br/>
       A postcard from your town. What size is your Town?<br/>What is the nicest part of your town?<br/>
       Where do you go in the evenings?</p>
     <p>Sam</p>
    </blockquote>
   </div>
   <qti-extended-text-interaction response-identifier="RESPONSE">
    <qti-prompt>Write Sam a postcard. Answer the questions. Write 23–30 words</qti-prompt>
   </qti-extended-text-interaction>
 </qti-item-body>
</qti-assessment-item>
Figure 9 A sample item as it might be presented during an assessment.
Writing a Postcard Illustration

The cardinality of "single" in the qti-response-processing element means that a single string of text is used in the response, though it may include multiple words or paragraphs within that string.

The example does not include a response processing node, as automated scoring of extended text responses is beyond the scope of the QTI specification.

The shared vocabulary for the extended text interaction is intended to provide more precision when describing:

  1. Interaction height
  2. Character counter behavior
  3. Plain or Rich Text options
  4. A custom pattern-mask message
  5. Placeholder text

Responsive design implies that delivery systems should display an input area (typically, this will be a <textarea> or <div> html element) that has a width equal to 100% of the interaction's encapsulating container. Consequently, there is no shared vocabulary for overriding the width of this interaction.

Go to the 1EdTech QTI 3 Standardized Shared Vocabulary and CSS document for details related to the Extended Text Interaction.

3.2.5 Gap Match Interaction

A gap match interaction is a block Interaction that contains a number of gaps that the candidate can fill from an associated set of choices. The candidate must be able to review the content with the gaps filled in context, as indicated by their choices.

The GapMatchInteraction.Type (qti-gap-match-interaction)  is similar to Match Interaction (qti-match-interaction) except that the choices in the second set are gaps (qti-gap) in a given passage of text and the task involves selecting choices from the first set and using them to fill the gaps. The same attributes are involved in controlling which, and how many, pairings are allowed, though there is no match-max attribute for the gaps because they can only ever have one associated choice. The scoring is again done with a mapping.

GapMatchInteration Attributes (element: qti-gap-match-interaction)

Name Usage Value(s) Default
max-associations optional Non-negative number 1
min-associations optional Non-negative number
shuffle optional boolean false

Sub-elements include qti-gap-text (GapText.Type) and qti-gap-img (GapImg.Type).

GapText Attributes (element: qti-gap-text)

Name Usage Value(s) Default
identifier required Identifier
template-identifier optional Identifier of a template variable used to control the visibility of the qti-gap-text
show-hide optional Vocabulary:• show• hide show
match-group optional IdentifierList
match-max required Non-negative integer
match-min optional Non-negative integer 0 (unlimited)

The qti-gap-img contains a single HTML object element.

GapImg Attributes (element: qti-gap-img)

Name Usage Value(s) Default
identifier required Identifier
template-identifier optional Identifier of a template variable used to control the visibility of the qti-gap-img
show-hide optional Vocabulary:• show• hide show
match-group optional IdentifierList
match-max required Non-negative integer, 0 means unlimited
match-min optional Non-negative integer <= match-max 0
object-label optional string
top optional empty
left optional empty

Additional formatting may be applied within the qti-gap-text element allowing for a greater variation.' Allowed formats include:

'br', 'img', 'xi:include', 'm:math', 'object', 'qti-printed-variable', 'a', 'abbr', 'acronym', 'b', 'big', 'cite', 'code', 'dfn', 'em', 'qti-feedback-inline', 'i', 'kbd', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'tt', 'var', 'qti-template-inline', 'bdi', 'bdo', 'label', 'ruby', 'ssml11:*'.

The qti-gap-match-interaction must be bound to a response variable with base-type directedPair and either single or multiple cardinality, depending on the number of gaps. The choices represent the source of the pairing and gaps the targets. Each gap can have at most one choice associated with it. The maximum occurrence of the choices is controlled by the match-max attribute of qti-gap-text or qti-gap-img.

The following is an example of a gap match interaction:

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0
 https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd" 
 identifier="gap-match-example-1" title="Gap Match Example 1"
 time-dependent="false" xml:lang="en-US" >
  <qti-response-declaration identifier="RESPONSE" cardinality="multiple" base-type="directedPair">
    <qti-correct-response>
      <qti-value>W G1</qti-value>
      <qti-value>Su G2</qti-value>
    </qti-correct-response>
    <qti-mapping default-value="-1" lower-bound="0">
      <qti-map-entry map-key="W G1" mapped-value="1"/>
      <qti-map-entry map-key="Su G2" mapped-value="2"/>
    </qti-mapping>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"/>
  <qti-item-body>
    <qti-gap-match-interaction max-associations="0" response-identifier="RESPONSE"
    class="qti-choices-top" >
      <qti-prompt>Identify the missing words in this famous quote from Shakespeare's Richard III.</qti-prompt>
      <qti-gap-text identifier="W" match-max="1">winter</qti-gap-text>
      <qti-gap-text identifier="Sp" match-max="1">spring</qti-gap-text>
      <qti-gap-text identifier="Su" match-max="1">summer</qti-gap-text>
      <qti-gap-text identifier="A" match-max="1">autumn</qti-gap-text>
      <blockquote>
        <p>
          Now is the <qti-gap identifier="G1"/> of our discontent<br/>
          Made glorious <qti-gap identifier="G2"/> by this sun of York;<br/> 
          And all the clouds that lour'd upon our house<br/>
          In the deep bosom of the ocean buried.
        </p>
      </blockquote>
    </qti-gap-match-interaction>
  </qti-item-body>
  <qti-response-processing
   template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/map_response.xml"/>
</qti-assessment-item>
Figure 10 Expected Rendering: The gap choices are displayed above the passage text.
There are 4 words within scored rectangles set side-by-side with each other.
                        Below these boxed words are 4 lines of text including 2 inline rectangles (drop targets).

The shared vocabulary for the Gap Match Interaction is intended to provide more precision when describing:

  1. Positioning of the Gap Choices container with respect to the passage of text containing the Gaps.
  2. Gap Choices container width.
  3. Gap element widths.
  4. Custom max|min-associations message overrides.

The full list of the Gap Match Interaction vocabulary is enumerated in the 1EdTech QTI 3 Standardized Shared Vocabulary and CSS document.

3.2.6 Hotspot Interaction

A HotspotInteraction.Type (qti-hotspot-interaction) is a graphical interaction with a corresponding set of choices that are defined as areas of the graphic image. The candidate's task is to select one or more of the areas (hotspots).

The hotspot interaction should only be used when the spatial relationship of the choices with respect to each other (as represented by the graphic image) is important to the needs of the item. Otherwise, Choice Interaction should be used instead with separate material for each option.

The delivery engine must clearly indicate selected hotspots when such hotspots are selected.  If the Shared Vocabulary class qti-unselected-hidden is present, the delivery engine must hide the hotspots in their unselected and unfocused state.  If the qti-unselected-hidden is not present, indicating hotspots in their unselected and unfocused state is left to the delivery engine.

HotspotInteraction Attributes (element: qti-hotspot-interaction)

Name Usage Value(s) Default
max-choices optional Non-negative number 1
min-choices optional Non-negative number 0 (unlimited)

The sub-element sequence for the qti-hotspot-interaction:

  1. either img, picture, or object (must have only 1, note that the use of object is deprecated in QTI 3)
  2. qti-hotspot-choice (at least 1)

HotspotChoice Attributes (element: qti-hotspot-choice)

Name Usage Value(s) Default
identifier required Identifier
template-identifier optional Identifier of a template variable used to control the visibility of the qti-hotspot-choice
show-hide optional Vocabulary:• show• hide show
shape required Vocabulary:• circle• default• ellipse• poly• rect
coords required Coords.Type
hotspot-label optional string

The hotspot interaction must be bound to a response variable with a base-type of identifier and single or multiple cardinality.

The shared vocabulary for the Hotspot Interaction is intended to provide more precision when describing:

  1. Hotspot Selections theming.
  2. Custom max|min-choices message overrides.

All information related to the Hotspot Interaction shared vocabulary is enumerated in the 1EdTech QTI 3 Standardized Shared Vocabulary and CSS document.

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/qti/imsqtiasi_v3p0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.imsglobal.org/xsd/qti/imsqti_itemv3p0_v1p0
  https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
  identifier="QTI3-hotspot" title="hotspot" time-dependent="false" xml:lang="en-US">
  <qti-response-declaration identifier="RESPONSE" cardinality="single" baseType="identifier">
      <qti-correct-response>
        <qti-value>H</qti-value>
      </qti-correct-response>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" baseType="float" />
  <qti-item-body>
  <p>The picture illustrates four of the most popular lighthouses on outer Cape Cod, Massachusetts: 
   Chatham Lighthouse, Highland Lighthouse, Nauset Lighthouse, and Race Point Lighthouse.</p>
    <qti-hotspot-interaction response-identifier="RESPONSE" max-choices="1"">
      <qti-prompt>Which one is Highland Lighthouse?</qti-prompt>
      <img src="images/map_cape_cod.svg"  width="700"  height="550" 
       alt="a map of Cape Cod Massachusetts with 4 lighthouse icons distributed on the outer Cape" />
        <qti-hotspot-choice identifier="R" shape="circle" coords="418,29,40" />
        <qti-hotspot-choice identifier="H" shape="circle" coords="546,56,40" />
        <qti-hotspot-choice identifier="N" shape="circle" coords="596,182,40" />
        <qti-hotspot-choice identifier="C" shape="circle" coords="598,316,40" />
    </qti-hotspot-interaction>
  </qti-item-body>
  <qti-response-processing 
   template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/match_correct.xml"/>
</qti-assessment-item>
Figure 11 Example of a Hotspot Interaction from the above code.
A map of Cape Cod with 4 lighthouse symbols distributed across the outer Cape.

3.2.7 Hot Text Interaction

The HotTextInteraction.Type (qti-hottext-interaction) presents a set of choices to the candidate represented as selectable runs of text embedded within a surrounding context, such as a simple passage of text. Like Choice Interaction, the candidate's task is to select one or more of the choices, up to a maximum of max-choices.

The interaction is initialized from the qti-default-value of the associated response variable, a NULL value indicating that no choices are selected (the usual case).

HotTextInteraction Attributes (element: qti-hottext-interaction)

Name Usage Value(s) Default
min-choices optional Non-negative integer 0 (unlimited)
max-choices optional Non-negative integer 1

The qti-hottext-interaction must be bound to a response variable with a base-type of identifier and single or multiple cardinality.

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item   xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
  https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd" 
  identifier="hot-text-example-1" title="Q12 Hot-text Interaction - Single Cardinality" 
  adaptive="false" time-dependent="false" xml:lang="en-US">
  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier">
    <qti-correct-response>
      <qti-value>B</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float">
    <qti-default-value>
      <qti-value>0</qti-value>
    </qti-default-value>
  </qti-outcome-declaration>
  <qti-item-body>
    <p>
      Select the error in the following passage of text (or <em>No Error</em> if there is none).
    </p>
    <qti-hottext-interaction response-identifier="RESPONSE" max-choices="1">
      <p>Sponsors of the Olympic Games <qti-hottext identifier="A">who bought</qti-hottext> 
        advertising time on United States television
        <qti-hottext identifier="B">includes</qti-hottext>
        <qti-hottext identifier="C">at least</qti-hottext> a dozen international firms
        <qti-hottext identifier="D">whose</qti-hottext> names are familiar to American consumers.
        <qti-hottext identifier="E">No error.</qti-hottext>
      </p>
    </qti-hottext-interaction>
  </qti-item-body>
  <qti-response-processing 
  template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/match_correct.xml"/>
</qti-assessment-item>
Figure 12 Example of a Hot Text Interaction from the above code.
A map of Cape Cod with 4 lighthouse symbols distributed across the outer Cape.

The above example demonstrates an interaction with a single selection. For multiple selections, the response processing cardinality would be "multiple" and you may choose to limit the number of selections using the max-choices attribute in the qti-hottext-interaction element (or set to "0" for unlimited/all selections).

The shared vocabulary for the Hot Text Interaction is intended to provide more precision when describing:

  1. Hiding the input control of the Hot Text choices.
  2. Custom max|min-choices message overrides.

All information related to the Hot Text Interaction shared vocabulary is enumerated in the 1EdTech QTI 3 Standardized Shared Vocabulary and CSS document.

3.2.8 Inline Choice

The InlineChoiceInteraction.Type (qti-inline-choice-interaction) is an inline interaction to display a set of simple text choices in context in a surrounding text, which may be subject to variable value substitution with qti-printed-variable.

InlineChoiceInteraction Attributes (element: qti-inline-choice-interaction)

Name Usage Value(s) Default
identifier required Identifier
required optional boolean

false

If true then a choice must be selected by the candidate in order to form a valid response to the interaction.

shuffle optional boolean false

The sub-element seCoolquence of qti-inline-choice-interaction is:

  1. qti-label (maximum of 1)
  2. qti-inline-choice (at least 1)

InlineChoice Attributes (element: qti-inline-choice)

Name Usage Value(s) Default
identifier required Identifier
template-identifier optional Identifier of a template variable used to control the visibility of the choice
show-hide optional Vocabulary:• show• hide show
fixed optional boolean false

When rendering an inline choice interaction, the common implementation is an embodiment of a <select> html form element or a combo box form control.  

Below is an example of an inline choice interaction that allows the candidate to select one answer option to respond to the prompt.

Example: qti-inline-choice-interaction

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/qti/imsqtiasi_v3p0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.imsglobal.org/xsd/qti/imsqti_itemv3p0_v1p0
  https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
  identifier="QTI3-inline-choice" time-dependent="false" xml:lang="en-US">
    <qti-response-declaration base-type="identifier" cardinality="single" identifier="RESPONSE">
      <qti-correct-response>
        <qti-value>Y</qti-value>
      </qti-correct-response>
    </qti-response-declaration>
    <qti-outcome-declaration base-type="float" cardinality="single" identifier="SCORE"/>
    <qti-item-body>
      <p>Identify the missing word in this famous quote from Shakespeare's Richard III.</p>
      <blockquote>
        <p>Now is the winter of our discontent
        <br/>Made glorious summer by this sun of
        <qti-inline-choice-interaction response-identifier="RESPONSE" shuffle="false">
          <qti-inline-choice identifier="G">Gloucester</qti-inline-choice>
          <qti-inline-choice identifier="L">Lancaster</qti-inline-choice>
          <qti-inline-choice identifier="Y">York</qti-inline-choice>
        </qti-inline-choice-interaction>;
        <br/>And all the clouds that lour'd upon our house
        <br/>In the deep bosom of the ocean buried.</p>
      </blockquote>
    </qti-item-body>
    <qti-response-processing
   template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/match_correct.xml"/>
  </qti-assessment-item>
Figure 13 Expected Rendering: The inline choice interaction rendered inline (not block) with the surrounding inline markup.
A sentence of text is shown, with 4 lines of a poem below.
                      The second line of the poem ends with a drop down box, with 3 choices displayed.

The bulk of the shared vocabulary for this interaction adds further definition to the presentation width of the selection element by utilizing the class attribute.

Go to the QTI 3 Standardized Shared Vocabulary and CSS section on Inline Choice for full details.

3.2.9 Match Interaction

A MatchInteraction.Type (qti-match-interaction) is a blockInteraction that presents candidates with two sets of choices and allows them to create associations between pairs of choices in the two sets, but not between pairs of choices in the same set. Further restrictions can still be placed on the allowable associations using the match-max characteristic of the choices.

The sub-element within qti-match-interaction is qti-simple-match-set.   MatchInteration Attributes (element: qti-match-interaction)

Name Usage Value(s) Default
max-associations optional Non-negative number 1
min-associations optional Non-negative number
shuffle optional boolean false

The sub-element of qti-match-interaction is qti-simple-match-set (SimpleMatchSet.Type). The qti-simple-match-set has an optional "id" attribute which contains a UniqueIdentifier.Type. The qti-simple-match-set contains an ordered set of choices using qti-simple-associable-choice (SimpleAssociableChoice.Type) elements.

SimpleAssociableChoice Attributes (element: qti-simple-associable-choice)

Name Usage Value(s) Default
identifier required Identifier
template-identifier optional Identifier
show-hide optional Vocabulary:• show• hide show
match-group optional IdentifierList
match-max required Non-negative integer
match-min optional Non-negative integer 0 (unlimited)
fixed optional boolean false

The match interaction must be bound to a response variable with base-type directedPair and either single or multiple cardinality.

In the match interaction example below, the candidate's response is declared to have directedPair because the task involves pairing up choices from a source set into a target set. In this case characters from plays with the names of the plays from which they are drawn. Notice that match-max on the characters (the first set of associable choices) is "1" because each character can be in only one play but it is "4" on the plays (the second set of associable choices) because each play could contain all the characters. For example, Demetrius and Lysander were both in A Midsummer-Night's Dream, so in the correct response that play has two associations. In the mapping used for response processing these two associations have been awarded only a half a mark each.

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/qti/imsqtiasi_v3p0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.imsglobal.org/xsd/qti/imsqti_itemv3p0_v1p0
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
identifier="QTI3-match"  title="Match Example"
time-dependent="false" xml:lang="en-US">
  <qti-response-declaration identifier="RESPONSE" cardinality="multiple" baseType="directedPair">
      <qti-correct-response>
        <qti-value>C R</qti-value>
        <qti-value>D M</qti-value>
        <qti-value>L M</qti-value>
        <qti-value>P T</qti-value>
      </qti-correct-response>
      <qti-mapping default-value="0">
        <qti-map-entry map-key="C R" mapped-value="1" />
        <qti-map-entry map-key="D M" mapped-value="0.5" />
        <qti-map-entry map-key="L M" mapped-value="0.5" />
        <qti-map-entry map-key="P T" mapped-value="1" />
      </qti-mapping>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" baseType="float" />
  <qti-item-body>
      <qti-match-interaction response-identifier="RESPONSE" max-associations="4">
      <qti-prompt>Match the following characters to the Shakespeare play they appeared in:</qti-prompt>
      <qti-simple-match-set> 
        <qti-simple-associable-choice identifier="C" match-max="1">Capulet</qti-simple-associable-choice>
        <qti-simple-associable-choice identifier="D" match-max="1">Demetrius</qti-simple-associable-choice>
        <qti-simple-associable-choice identifier="L" match-max="1">Lysander</qti-simple-associable-choice>
        <qti-simple-associable-choice identifier="P" match-max="1">Prospero</qti-simple-associable-choice>
      </qti-simple-match-set>
      <qti-simple-match-set>
        <qti-simple-associable-choice identifier="M" match-max="4">A Midsummer-Night's Dream</qti-simple-associable-choice>
        <qti-simple-associable-choice identifier="R" match-max="4">Romeo and Juliet</qti-simple-associable-choice>
        <qti-simple-associable-choice identifier="T" match-max="4">The Tempest</qti-simple-associable-choice>
      </qti-simple-match-set>
    </qti-match-interaction>
  </qti-item-body>
  <qti-response-processing template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/map_response.xml"/>
</qti-assessment-item>
Figure 14 Example of a Match Interaction from the above code.
There are 4 words within scored rectangles set side-by-side with each other.
                          Below these boxed words are 4 lines of text including 2 inline rectangles (drop targets).

The shared vocabulary for the Match Interaction is intended to provide more precision when describing:

  1. Non-tabular Match Interaction positioning of the first Simple Match Set choices with respect to the second Simple Match Set choices.
  2. Tabular Match Interaction styling.
  3. Custom max|min-associations message overrides.

Go to the QTI 3 Standardized Shared Vocabulary and CSS section on Match Interaction for full details.

3.2.10 Order

In an OrderInteraction.Type (qti-order-interaction) the candidate's task is to reorder the choices, the order in which the choices are displayed initially is significant. By default the candidate's task is to order all of the choices but a subset of the choices can be requested using the max-choices and min-choices attributes. When specified the candidate must first select a (sub)set of the choices and then impose an ordering on them.

OrderInteraction Attributes (element: qti-order-interaction)

Name Usage Value(s) Default
min-choices optional Non-negative number
max-choices optional Non-negative number
orientation optional Vocabulary:• horizontal• vertical
shuffle optional false

The sub-element of qti-order-interaction is qti-simple-choice (SimpleChoice.Type) where there must be at least one qti-simple-choice in the interaction to be valid, and at least 2 choices to be useful as an order interaction.

SimpleChoice (element: qti-simple-choice) Attributes

Name Usage Value(s) Default
identifier required Identifier
template-identifier optional Identifier
show-hide optional Vocabulary:• show• hide show
fixed optional boolean false

This example below illustrates the Order Interaction. The candidate's response is declared to have ordered and the correct value is therefore composed of an ordered list of value. The question uses the standard response processing template Match Correct to score 1 for a completely correct answer and 0 otherwise.

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/qti/imsqtiasi_v3p0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.imsglobal.org/xsd/qti/imsqti_itemv3p0_v1p0
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
identifier="QTI3-order" title="Order Interaction Example" 
time-dependent="false" xml:lang="en-US">
  <qti-response-declaration identifier="RESPONSE" cardinality="ordered" baseType="identifier">
    <qti-correct-response>
      <qti-value>DriverC</qti-value>
      <qti-value>DriverA</qti-value>
      <qti-value>DriverB</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" baseType="float" />
  <qti-item-body>
    <p>The following F1 drivers finished on the podium in the first ever 
        Grand Prix of Bahrain.</p>
    <qti-order-interaction response-identifier="RESPONSE" orientation="horizontal">
      <qti-prompt>
        <p>Rearrange them into the correct finishing order.</p>
      </qti-prompt>
        <qti-simple-choice identifier="DriverA">Rubens Barrichello</qti-simple-choice>
        <qti-simple-choice identifier="DriverB">Jenson Button</qti-simple-choice>
        <qti-simple-choice identifier="DriverC">Michael Schumacher</qti-simple-choice>
    </qti-order-interaction>
  </qti-item-body>
  <qti-response-processing
   template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/match_correct.xml"/>
</qti-assessment-item>
Figure 15 Example of an Order Interaction
3 blue boxes with names in them are displayed side-by-side in a single row.

The shared vocabulary for the Order Interaction is intended to provide more precision when describing:

  1. Target Labels
  2. Target Label Suffixes
  3. Choices | Targets Container Positioning
  4. Choices Container Widths
  5. Custom max|min -associations Messages

Go to the QTI 3 Standardized Shared Vocabulary and CSS section on Order Interaction for full details.

3.2.11 Graphic Order Interaction

A GraphicOrderInteraction.Type (qti-associate-interaction) is a graphic interaction with a corresponding set of choices that are defined as areas of the graphic image. The candidate's task is to impose an ordering on the areas (hotspots). The order hotspot interaction should only be used when the spatial relationship of the choices with respect to each other (as represented by the graphic image) is important to the needs of the item.

Otherwise, Order interaction should be used instead with separate material for each option. The delivery engine must clearly indicate all defined area(s) of the image.

Graphic Order Interaction Attributes (element: qti-graphic-order-interaction)

Name Usage Value(s) Default
max-choices optional Non-negative number If unspecified, all of the choices may be ordered.
min-choices optional Non-negative number If unspecified, all of the choices must be ordered and max-choices is ignored.

The sub-element sequence for the qti-graphic-order-interaction:

  1. either img, picture, or object (must have only 1, object is deprecated)
  2. qti-hotspot-choice (at least 1)

HotspotChoice Attributes (element: qti-hotspot-choice)

Name Usage Value(s) Default
identifier required Identifier
template-identifier optional Identifier of a template variable used to control the visibility of the qti-hotspot-choice
show-hide optional Vocabulary:• show• hide show
shape required Vocabulary:• circle• default• ellipse• poly• rect
coords required Coords.Type
hotspot-label optional string

The graphic order interaction must be bound to a response variable with a base-type of identifier and ordered cardinality.

Example: Demonstrates qti-graphic-order-interaction

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/qti/imsqtiasi_v3p0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.imsglobal.org/xsd/qti/imsqti_itemv3p0_v1p0
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
identifier="QTI3-graphic-order" title="Graphic Order Interaction Example" 
time-dependent="false" xml:lang="en-US">
  <qti-response-declaration identifier="RESPONSE" cardinality="ordered" baseType="identifier">
    <qti-correct-response>
      <qti-value>A</qti-value>
      <qti-value>D</qti-value>
      <qti-value>C</qti-value>
      <qti-value>B</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" baseType="float" />
  <qti-item-body>
    <p>Lorna is flying back home to the UK. Ideally, she would like to fly in directly to her 
    home town of Glasgow. Edinburgh is her second choice and, if necessary, she could fly into 
    London and pick up an internal connecting flight. Although she has been offered a cheap flight 
    to Manchester it remains her least favourite option as connecting flights to Glasgow are not 
    very reliable from there.</p>
    <qti-graphic-order-interaction response-identifier="RESPONSE">
      <qti-prompt>Mark the airports shown on the map according to Lorna's preferences.</qti-prompt>
      <img src="image/ukair.png" width="206" height="280" alt="map of airports of the United Kingdom"/>
      <qti-hotspot-choice shape="circle" coords="78,102,8" identifier="A" aria-label="Airport A" />
      <qti-hotspot-choice shape="circle" coords="117,171,8" identifier="B" aria-label="Airport B" />
      <qti-hotspot-choice shape="circle" coords="166,227,8" identifier="C" aria-label="Airport C" />
      <qti-hotspot-choice shape="circle" coords="100,102,8" identifier="D" aria-label="Airport D" />
    </qti-graphic-order-interaction>
  </qti-item-body>
  <qti-response-processing 
    template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/match_correct.xml" />  
</qti-assessment-item>
Figure 16 Graphic Order Interaction example, partial response shown.
2 paragraphs of text are shown above an image. The image is a line drawing of the United Kingdom.
                      There are 4 places that have icons of airplanes placed on the drawing. Over 2 of the icons are large blue numbers.
                      2 large numbers are placed off to the side of the drawing.

3.2.12 Associate Interaction

An AssociateInteraction.Type (qti-associate-interaction) is a block interaction that presents candidates with a number of  choices and allows them to create associations between them.

AssociateInteraction Attributes (element: qti-associate-interaction)

Name Usage Value(s) Default
max-associations optional Non-negative number 1
min-associations optional Non-negative number 0 (unlimited)
shuffle optional boolean false

The sub-element of qti-associate-interaction is qti-simple-associable-choice, where there must be at least one qti-simple-associable-choice.

SimpleAssociableChoice Attributes (element: qti-simple-associable-choice)

Name Usage Value(s) Default
identifier required Identifier
template-identifier optional Identifier
show-hide optional Vocabulary:• show• hide show
match-max required Non-negative integer
match-min optional Non-negative integer 0 (unlimited)
fixed optional boolean

The qti-associate-interaction must be bound to a response variable with base-type pair and either single or multiple cardinality.

Example: Demonstrates qti-associate-interaction allowing for 3 pairings

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/qti/imsqtiasi_v3p0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.imsglobal.org/xsd/qti/imsqti_itemv3p0_v1p0
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
identifier="QTI3-associate" title="Classic Associate Interaction Example" 
time-dependent="false" xml:lang="en-US">
  <qti-response-declaration identifier="RESPONSE" cardinality="multiple" baseType="pair">
    <qti-correct-response>
      <qti-value>A P</qti-value>
      <qti-value>C M</qti-value>
       <qti-value>D L</qti-value>
    </qti-correct-response>
    <qti-mapping default-value="0">
      <qti-map-entry map-key="A P" mapped-value="2" />
      <qti-map-entry map-key="C M" mapped-value="1" />
      <qti-map-entry map-key="D L" mapped-value="1" />
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" baseType="float" />
  <qti-item-body>
    <qti-associate-interaction response-identifier="RESPONSE" max-associations="3">
      <qti-prompt>
        Hidden in this list of characters from famous
        Shakespeare plays are three pairs of rivals. Can you match
        each character to his adversary?
      </qti-prompt>
      <qti-simple-associable-choice identifier="A" match-max="1">
        Antonio
      </qti-simple-associable-choice>
      <qti-simple-associable-choice identifier="C" match-max="1">
        Capulet
      </qti-simple-associable-choice>
      <qti-simple-associable-choice identifier="D" match-max="1">
        Demetrius
      </qti-simple-associable-choice>
      <qti-simple-associable-choice identifier="L" match-max="1">
        Lysander
      </qti-simple-associable-choice>
      <qti-simple-associable-choice identifier="M" match-max="1">
        Montague
      </qti-simple-associable-choice>
      <qti-simple-associable-choice identifier="P" match-max="1">
        Prospero
      </qti-simple-associable-choice>
    </qti-associate-interaction>
  </qti-item-body>
  <qti-response-processing 
    template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/map_response.xml" />  
</qti-assessment-item>
Figure 17 Associate Interaction example with a partial response.
3 lines of text are shown above an image. The image contains 3 long rectangular boxes labeled with text.
                      Below that are six smaller boxes, 3 containing text labels and 3 unlabled.
                      The two boxes can be moved to the emplty boxes.

3.2.13 Graphic Associate Interaction

A GraphicAssociateInteraction.Type (qti-graphic-associate-interaction) is a graphic interaction with a corresponding set of choices that are defined as areas of the graphic image. The candidate's task is to associate the areas (hotspots) with each other. The graphic associate interaction should only be used when the graphical relationship of the choices with respect to each other (as represented by the graphic image) is important to the needs of the item. Otherwise, an Associate Interaction should be used instead with separate material for each option. The delivery engine must clearly indicate all defined area(s) of the image.

AssociateInteraction Attributes (element: qti-associate-interaction)

Name Usage Value(s) Default
max-associations optional Non-negative number 1
min-associations optional Non-negative number

The sub-element sequence:

  1. img, picture, or object (limited to a single occurrence, object is deprecated)
  2. qti-associable-hotspot (at least 1)

AssociableHotspot Attributes (element: qti-associable-hotspot)

Name Usage Value(s) Default
identifier required Identifier
template-identifier optional Identifier
show-hide optional Vocabulary:• show• hide show
match-group optional IdentifierList
shape required Vocabulary:• circle• default• ellipse• poly• rect
coords required Coords.Type
hotspot-label optional string
match-max required Non-negative integer
match-min optional Non-negative integer 0 (unlimited)

The qti-graphic-associate-interaction must be bound to a response variable with base-type pair and either single or multiple cardinality.

Example: Demonstrates qti-graphic-associate-interaction

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_itemv3p0_v1p0.xsd" 
identifier="example-graphic-assoc-1"  title="Graphic Associate Example 1" 
time-dependent="false" xml:lang="en-US">
  <qti-response-declaration identifier="RESPONSE" cardinality="multiple" baseType="pair">
    <qti-correct-response>
      <qti-value>C B</qti-value>
      <qti-value>C D</qti-value>
    </qti-correct-response>
    <qti-mapping lower-bound="0" default-value="0">

      <qti-map-entry map-key="A B" mapped-value="-1" />
      <qti-map-entry map-key="A C" mapped-value="-1" />
      <qti-map-entry map-key="A D" mapped-value="-1" />
      <qti-map-entry map-key="B D" mapped-value="-1" />

      <qti-map-entry map-key="B C" mapped-value="1" />
      <qti-map-entry map-key="C D" mapped-value="1" />

    </qti-mapping>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" baseType="float" />
  <qti-item-body>
    <p>
      Frizz, a new low cost airline, already operates a service
      connecting Manchester and Edinburgh but has recently opened two
      new routes: a service between London and Edinburgh and one
      between London and Manchester.
    </p>
  <qti-graphic-associate-interaction response-identifier="RESPONSE" max-associations="3">
    <qti-prompt>Mark the airline's new routes on the airport map.</qti-prompt>
    <img src="images/ukair.svg" alt="Map of United Kingdom airports" width="206" height="280" />
    <qti-associable-hotspot shape="circle" coords="78,102,10" identifier="A" match-max="3"/>
    <qti-associable-hotspot shape="circle" coords="117,171,10" identifier="B" match-max="3"/>
    <qti-associable-hotspot shape="circle" coords="166,227,10" identifier="C" match-max="3"/>
    <qti-associable-hotspot shape="circle" coords="100,102,10" identifier="D"  match-max="3"/>
  </qti-graphic-associate-interaction>
  <p class="interaction-instruction" >Drag the route markers by their ends to connect 
   the airports.</p>
  </qti-item-body>
  <qti-response-processing 
   template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/map_response.xml" />  
</qti-assessment-item>
Figure 18 Graphic Associate Interaction example at initiation.
2 paragraphs of text are shown above an image. The image is a line drawing of the United Kingdom.
                      There are 4 places that have icons of airplanes placed on the drawing.
Figure 19 Graphic Associate Interaction example's correct response.
2 paragraphs of text are shown above an image. The image is a line drawing of the United Kingdom.
                      There are 4 places that have icons of airplanes placed on the drawing. 3 of the icons are connected by lines.

Alternatively, you may wish to use the picture element to reference the source for the more highly compressed WebP version and with a PNG alternative within the img element for browsers that do not support WebP.

Example: Demonstrates qti-graphic-associate-interaction with picture element

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0
  https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_itemv3p0_v1p0.xsd"
  identifier="example-graphic-assoc-1alt" title="Alternative Graphic Associate Example" 
xml:lang="en-US" time-dependent="false">
<qti-response-declaration identifier="RESPONSE" cardinality="multiple" baseType="pair">
    <qti-correct-response>
      <qti-value>C B</qti-value>
      <qti-value>C D</qti-value>
    </qti-correct-response>
    <qti-mapping lower-bound="0" default-value="0">
      <qti-map-entry map-key="A B" mapped-value="-1" />
      <qti-map-entry map-key="A C" mapped-value="-1" />
      <qti-map-entry map-key="A D" mapped-value="-1" />
      <qti-map-entry map-key="B D" mapped-value="-1" />
      <qti-map-entry map-key="B C" mapped-value="1" />
      <qti-map-entry map-key="C D" mapped-value="1" />
    </qti-mapping>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" baseType="float" />
    <qti-item-body>
      <p>
        Frizz, a new low cost airline, already operates a service
        connecting Manchester and Edinburgh but has recently opened two
        new routes: a service between London and Edinburgh and one
        between London and Manchester.
      </p>
      <qti-graphic-associate-interaction response-identifier="RESPONSE" max-associations="3">
        <qti-prompt>
          Mark the airline's new routes on the airport map:
        </qti-prompt>

        <picture>
         <source srcset="images/ukair.webp" type="image/webp"/>
         <img src="images/ukair.png" alt="Map of United Kingdom airports" width="206" height="280" />
        </picture>

        <qti-associable-hotspot shape="circle" coords="78,102,10" identifier="A" match-max="3"/>
        <qti-associable-hotspot shape="circle" coords="117,171,10" identifier="B" match-max="3"/>
        <qti-associable-hotspot shape="circle" coords="166,227,10" identifier="C" match-max="3"/>
        <qti-associable-hotspot shape="circle" coords="100,102,10" identifier="D"  match-max="3"/>
      </qti-graphic-associate-interaction>
  <p>Drag the route markers by their ends to connect the airports. </p>
    </qti-item-body>
  <qti-response-processing 
   template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/map_response.xml" />  
  </qti-assessment-item>

3.2.14 Graphic Gap Match Interaction

A GraphicGapMatchInteraction.Type (qti-graphic-gap-match-interaction) is a graphical interaction with a set of gaps that are defined as areas (hotspots) of the graphic image and an additional set of gap choices that are defined outside the image. The candidate must associate the gap choices with the gaps in the image and be able to review the image with the gaps filled in context, as indicated by their choices.

Care should be taken when designing these interactions to ensure that the gaps in the image are a suitable size to receive the required gap choices. It must be clear to the candidate which hotspot each choice has been associated with. When associated, choices must appear wholly inside the gaps if at all possible and, where overlaps are required, should not hide each other completely. If the candidate indicates the association by positioning the choice over the gap (e.g. drag and drop) the system should 'snap' it to the nearest position that satisfies these requirements.

GraphicGapMatchInteraction Attributes (element: qti-graphic-gap-match-interaction)

Name Usage Value(s) Default
max-associations optional Non-negative number 1
min-associations optional Non-negative number

The sequence of elements within the qti-graphic-gap-match-interaction is:

  • qti-prompt
  • either img, picture, or object (deprecated)
  • qti-gap-text
  • qti-gap-img
  • qti-associable-hotspot

GapText Attributes (element: qti-gap-text)

Name Usage Value(s) Default
identifier required Identifier
template-identifier optional Identifier
show-hide optional Vocabulary:• show• hide show
match-group optional IdentifierList
match-max required Non-negative integer
match-min optional Non-negative integer 0 (unlimited)

GapImg Attributes (element: qti-gap-img)

Name Usage Value(s) Default
identifier required Identifier
template-identifier optional Identifier
show-hide optional Vocabulary:• show• hide show
match-group optional IdentifierList
match-max required Non-negative integer
match-min optional Non-negative integer 0 (unlimited)
object-label optional string
top optional empty
left optional empty

AssociableHotspot Attributes (element: qti-associable-hotspot)

Name Usage Value(s) Default
identifier required Identifier
template-identifier optional Identifier
show-hide optional Vocabulary:• show• hide show
match-group optional IdentifierList
shape required Vocabulary:• circle• default• ellipse• poly• rect
coords required Coords.Type
hotspot-label optional string
match-max required Non-negative integer
match-min optional Non-negative integer 0 (unlimited)

The graphic-gap-match-interaction must be bound to a response variable with base-type directedPair and multiple cardinality. The choices represent the source of the pairing and the gaps in the image (the hotspots) the targets. Unlike the simple GapMatchInteraction, each gap can have several choices associated with it if desired, furthermore, the same choice may be associated with an qti-associable-hotspot multiple times, in which case the corresponding directed pair appears multiple times in the value of the response variable.

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item 
  xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
  https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
  identifier="graphic-gap-match-item1" title="Q8 GGM Images - Airport Tags" 
  adaptive="false" time-dependent="false" xml:lang="en-US" >
    <qti-response-declaration identifier="RESPONSE" cardinality="multiple" base-type="directedPair">
        <qti-correct-response>
          <qti-value>GLA A</qti-value>
          <qti-value>EDI B</qti-value>
          <qti-value>MAN C</qti-value>
        </qti-correct-response>
        <qti-mapping default-value="-1" lower-bound="0">
          <qti-map-entry map-key="GLA A" mapped-value="1"/>
          <qti-map-entry map-key="EDI B" mapped-value="1"/>
          <qti-map-entry map-key="MAN C" mapped-value="1"/>
        </qti-mapping>
    </qti-response-declaration>
    <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"/>
    <qti-item-body>
        <p>The International Air Transport Association assigns three-letter codes 
        to identify airports worldwide. For example, London Heathrow has code LHR.</p>
        <qti-graphic-gap-match-interaction max-associations="0" response-identifier="RESPONSE" 
         class="qti-choices-left" >
          <qti-prompt>
            <p>Some of the labels on the following diagram are missing: can you identify the correct 
             three-letter codes for the unlabelled airports?</p>
          </qti-prompt>
          <img src="images/ukairtags2024.png" width="305" height="390" 
          alt="Outline map of the United Kingdom" />
          <qti-gap-img identifier="CBG" match-max="1">
            <img src="images/cbg.png" width="53" height="29" alt="The initials CBG" />
          </qti-gap-img>
          <qti-gap-img identifier="EBG" match-max="1">
            <img src="images/ebg.png" width="53" height="29" alt="The initials EBG" />
          </qti-gap-img>
          <qti-gap-img identifier="EDI" match-max="1">
            <img src="images/edi.png" width="53" height="29" alt="The initials EDI" />
          </qti-gap-img>
          <qti-gap-img identifier="GLA" match-max="1">
            <img src="images/gla.png" width="53" height="29" alt="The initials GLA" />
          </qti-gap-img>
          <qti-gap-img identifier="MAN" match-max="1">
            <img src="images/man.png" width="53" height="29" alt="The initials MAN" />
          </qti-gap-img>
          <qti-gap-img identifier="MCH" match-max="1">
            <img src="images/mch.png" width="53" height="29" alt="The initials MCH" />
          </qti-gap-img>
          <qti-associable-hotspot identifier="A" match-max="1" shape="rect" coords="11,122,64,151" />
          <qti-associable-hotspot identifier="B" match-max="1" shape="rect" coords="187,105,240,134" />
          <qti-associable-hotspot identifier="C" match-max="1" shape="rect" coords="91,206,144,235" />
        </qti-graphic-gap-match-interaction>
    </qti-item-body>
    <qti-response-processing 
    template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/map_response.xml"/>
</qti-assessment-item>
Figure 20 Example: Graphic Gap Match Interaction
example of graphic gap match interaction

The shared vocabulary for the Graphic Gap Match Interaction is intended to provide more precision when describing:

  1. Positioning of the Gap Choices container with respect to the image containing the hotspots.
  2. Gap Choices container width.
  3. Associable Hotspot Selections theming.
  4. Custom max|min-associations message overrides.

Go to the QTI 3 Standardized Shared Vocabulary and CSS section on Graphic Gap Match Interaction for full details.

3.2.15 Media

The MediaInteraction.Type (qti-media-interaction) enables measurement of the number of times the media object was experienced.  This quantity is reported in the value of the interaction's response variable.

MediaInteraction Attributes (element: qti-media-interaction)

Name Usage Value(s) Default
autostart required boolean Note: Accessibility guidelines suggest that candidates should initiate any media instead of automatically playing the media, therefore the value should be "false".
min-plays optional Non-negative integer 0 (unlimited)
max-plays optional Non-negative integer 0 (unlimited)
loop optional boolean false
coords optional Coords.Type

The sub-elements include:

  • audio
  • video
  • object (deprecated)

The qti-media-interaction must be bound to a response variable of base-type integer and single cardinality.

Note that for the audio and video elements in QTI 3 markup, the "controls" attribute MUST include a value for the attribute to be valid XML. As per the HTML 5 specification, the way to exclude controls is to explicitly not include the attribute in the audio or video element. In QTI 3, valid values to include controls are "controls" (as per the HTML specification) or "true" (the more traditional boolean value for XML). So <video> would mean the controls are not provided to the candidate (as in the example below), and <video controls="controls"> would indicate the candidate should be provided with media controls.

Example: Demonstrates qti-media-interaction

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
identifier="media-example-1" title="Media Interaction Example" 
adaptive="false" time-dependent="false" xml:lang="en-US" >
  <qti-response-declaration base-type="integer" cardinality="single" identifier="RESPONSE_1"/>
  <qti-item-body>
    <qti-media-interaction autostart="false" loop="false" response-identifier="RESPONSE_1"
    max-plays="3" >
      <qti-prompt>Play this video.</qti-prompt>
      <video width="320" height="240"  >
        <source src="images/bubble.mp4" type="video/mp4"/>
        <source src="images/bubble.ogg" type="video/ogg"/>
      </video>
    </qti-media-interaction>
  </qti-item-body>
</qti-assessment-item>
Figure 21 Media Interaction example (not interactive).
A video preview (a still image) is shown. Text above the video area says 'Play this video.'
                      There is a larger play button in the middle of the video area.

3.2.16 Position Object Interaction

The PositionObjectInteraction.Type (qti-position-object-interaction) consists of a single image which must be positioned on another graphic image (the stage) by the candidate. Like Select Point Interaction, the associated response may have a qti-area-mapping that scores the response on the basis of comparing it against predefined areas but the delivery engine must not indicate these areas of the stage. Only the actual position(s) selected by the candidate shall be indicated.

PositionObjectInteraction Attributes (element: qti-position-object-interaction)

Name Usage Value(s) Default
center-point optional IntegerList
min-choices optional Non-negative number
max-choices optional Non-negative number 1

The sub-element for the qti-position-object-interaction is either the HTML "img" or "picture" element. The object element is deprecated in QTI 3.

The qti-position-object-interaction must be bound to a response variable with a base-type of point and single or multiple cardinality. The point records the coordinates, with respect to the stage, of the centre point of the image being positioned.

Position Object Interaction, has a required parent, the qti-position-object-stage, which is a graphic image (represented as an "object"), on top of which the Position Object Interaction image is to be positioned. A single qti-position-object-stage may have several Position Object Interactions as child elements, representing several objects to be positioned on the same "stage".

Example: Demonstrates qti-position-object-interaction

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item 
xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
identifier="position-object-1" title="Position Object, those UK airports again!" 
adaptive="false" time-dependent="false" xml:lang="en-US" >
  <qti-response-declaration identifier="RESPONSE" cardinality="multiple" base-type="point">
    <qti-correct-response>
    <-- Manchester (MAN) -->
      <qti-value>118 184</qti-value>
    <-- London Heathrow (LHR) -->
      <qti-value>150 235</qti-value>
      <-- Edinburgh (EDI) -->
      <qti-value>96 114</qti-value>
    </qti-correct-response>
    <qti-area-mapping default-value="0">
      <qti-area-map-entry shape="circle" coords="118,184,12" mapped-value="1"/>
      <qti-area-map-entry shape="circle" coords="150,235,12" mapped-value="1"/>
      <qti-area-map-entry shape="circle" coords="96,114,12" mapped-value="1"/>
    </qti-area-mapping>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"/>
  <qti-item-body>
    <p>When flying into the UK, you may well find yourself landing at
      Edinburgh, Manchester or London Heathrow; but where are these
      airports actually located?
    </p>
    <qti-position-object-stage>
      <img src="images/uk.svg" alt="Map of airports of the United Kingdom" width="206" height="280">
      <qti-position-object-interaction response-identifier="RESPONSE" max-choices="3">
        <img src="images/airplane.png" alt="Icon of an airplane" width="30" height="30">
      </qti-position-object-interaction>
    </qti-position-object-stage>
    <p>Drag the airport marker to the city locations on the map.</p>
  </qti-item-body>
  <qti-response-processing 
  template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/map_response_point.xml"/>
  </qti-assessment-item>
Figure 22 Position Object Interaction example, partial response.
A paragraph of text is shown above an image. The image is a line drawing of the United Kingdom.
                      To the left of  the line drawing is an airplane icon.

3.2.17 Select Point Interaction

The SelectPointInteraction.Type (qti-select-point-interaction) is a graphic interaction. The candidate's task is to select one or more points. The associated response may have an qti-area-mapping  that scores the response on the basis of comparing it against predefined areas but the delivery engine must not indicate these areas of the image. Only the actual point(s) selected by the candidate shall be indicated.

SelectPointInteraction Attributes (element: qti-select-point-interaction)

Name Usage Value(s) Default
min-choices optional Non-negative number 0
max-choices optional Non-negative number 0 (unlimited)

The sub-element for the qti-select-point-interaction is either the HTML "img" or "picture" element. The object element is deprecated in QTI 3.

The select point interaction must be bound to a response variable with a base-type of point and single or multiple cardinality.

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item 
  xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
  https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
  identifier="select-point-item_1" title="Classic Where is Edinburgh Example" 
  adaptive="false" time-dependent="false" xml:lang="en-US" >
    <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="point">
        <qti-correct-response>
          <qti-value>93 111</qti-value>
        </qti-correct-response>
        <qti-area-mapping default-value="0" >
          <qti-area-map-entry shape="circle" coords="93,111,16" mapped-value="1"/>
        </qti-mapping>
    </qti-response-declaration>
    <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"/>
    <qti-item-body>
        <qti-select-point-interaction max-choices="1" response-identifier="RESPONSE"  >
          <qti-prompt>
            <p>Mark Edinburgh on this map of the United Kingdom.</p>
          </qti-prompt>
          <img width="196" height="280" src="images/uk_green.png" alt="A map of the United Kingdom" />
        </qti-select-point-interaction>
    </qti-item-body>
    <qti-response-processing 
    template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/map_response_point.xml"/>
</qti-assessment-item>
Figure 23 Example: Select Point Interaction (shown with correct response)
example of Select Point Interaction showing a simple map of the United Kingdom

3.2.18 Slider Interaction

The SliderInteraction.Type (qti-slider-interaction) presents the candidate with a control for selecting a numerical value between a lower and upper bound. It must be bound to a response variable with single cardinality with a base-type of either integer or float.

Note that a slider interaction does not have a default or initial position except where specified by a default value for  the associated response variable. The currently selected value, if any, must be clearly indicated to the candidate.

Because a slider interaction does not have a default or initial position, except where specified by a default value for the associated response variable, it is difficult to distinguish between an intentional response that corresponds to the slider's initial position and a NULL response. As a workaround, slider interaction items have to either a) not count NULL responses (i.e. count all responses as intentional) or b) include a 'skip' button and count its activation combined with a response variable that is equal to the slider's initial position as a NULL response.

There are six attributes for the qti-slider-interaction where the lower-bound and upper-bound are required attributes:

Slider Interaction Attributes (element: qti-slider-interaction)

Name Usage Value(s) Default
lower-bound required NonNegativeDouble
upper-bound required NonNegativeDouble
step optional NonNegativeDouble 1.0
step-label optional boolean false
orientation optional

Vocabulary;

  • horizontal
  • vertical
reverse optional

Example: Demonstrates qti-slider-interaction

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item 
xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
identifier="slider-1" title="Slider Interaction – Water" 
adaptive="false" time-dependent="false" xml:lang="en-US" >
  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="integer">
    <qti-correct-response>
      <qti-value>70</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"/>
  <qti-item-body>
    <qti-slider-interaction response-identifier="RESPONSE" 
    lower-bound="0" upper-bound="100" step="10" orientation="horizontal" >
      <qti-prompt>
      Roughly (to the nearest 10%) what percentage of the Earth's surface 
      is covered in water?
      </qti-prompt>
    </qti-slider-interaction>
  </qti-item-body>
  <qti-response-processing 
  template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/map_response.xml"/>
</qti-assessment-item>
Figure 24 Expected Rendering: A slider "track" with horizontal orientation, with a single handle that may be moved by dragging, or with arrow keys. Tick marks are left entirely to the delivery platform. In the example, the interaction increases the accessibility by also allowing the candidate to input a number to move the slider and to indicate the response chosen by the candidate..
A question appears above a line. There are tick marks at regular intervals above the line.
                      In the middle of the line is a grey rectangle. Below the grey rectangle is a dark rectangle that displays the number '50'.

3.2.19 Upload

The UploadInteraction.Type (qti-upload-interaction) allows the candidate to upload a pre-prepared file representing their response.

The qti-upload-interaction must be bound to a response variable with base-type  file and single cardinality.

UploadInteraction Attributes (element: qti-upload-interaction)

Name Usage Value(s) Default
class optional xs:string
response-identifier mandatory identifier

Example: Demonstrates qti-upload-interaction

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item 
xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
identifier="upload-interaction" title="Upload Chocolate Spreadsheet" 
adaptive="false" time-dependent="false" xml:lang="en-US" >
  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="file" />
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"/>
  <qti-item-body>
      <p>A chocolate factory produces several types of chocolate, some of which have nut centres.
      The chocolates are mixed together and are randomly packed into cartons of ten.</p>
      <qti-upload-interaction response-identifier="RESPONSE" >
        <qti-prompt>
          <p>Build a spreadsheet to simulate 50 cartons of chocolates when each carton contains 
          10 chocolates, and when one-seventh of the chocolates have nut centres. Your spreadsheet 
          should include 50 rows representing the 50 cartons, each row containing 10 columns to 
          represent the chocolates.</p>
        </qti-prompt>
      </qti-upload-interaction>
  </qti-item-body>
</qti-assessment-item>
Figure 25 Expected Rendering: Rendering and behaviors of the Upload Interaction are left entirely to the delivery platform.

A chocolate factory produces several types of chocolate, some of which have nut centres. The chocolates are mixed together and are randomly packed into cartons of ten.

Build a spreadsheet to simulate 50 cartons of chocolates when each carton contains 10 chocolates, and when one-seventh of the chocolates have nut centres. Your spreadsheet should include 50 rows representing the 50 cartons, each row containing 10 columns to represent the chocolates.

An empty rectangle is shown to the left of another rectangular button with the words 'Select file' within the button.

3.2.20 Drawing Interaction

The DrawingInteraction.Type (qti-drawing-interaction) allows the candidate to use a set of drawing tools to modify a given graphical image (the canvas).  It must be bound to a response variable with base type file and single cardinality.

DrawingInteraction Attributes (element: qti-drawing-interaction)

Name Usage Value(s) Default
class optional xs:string
response-identifier mandatory identifier

The sub-element of the qti-drawing-interaction are the HTML elements img, picture, or object. The image specified within one of the aforementioned elements acts as the canvas on which the drawing takes place. It is best practice to use the img or picture elements for this interaction. If using the deprecated object element it MUST be of an image type, as specified by the type attribute.

Example: Demonstrates qti-drawing-interaction

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item 
xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
identifier="drawing-interaction-1" title="Draw an Angle" 
adaptive="false" time-dependent="false" xml:lang="en-US" >
  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="file" />
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"/>
 <qti-item-body>
    <qti-drawing-interaction response-identifier="RESPONSE">
      <qti-prompt>
        <p>Use the compass provided to bisect the angle <em>PQR</em> in the figure below.</p>
      </qti-prompt>
      <picture>
        <source srcset="images/anglePQR.svg" media="(min-width: 600px)" type="image/svg" />
        <img src="images/anglePQR_HiRes.jpg" alt="drawing of angle PQR where point P connects with 
        point Q and point Q connects to point R and length of PQ equals the length of QR" 
        width="322" height="260" />
      </picture>
    </qti-drawing-interaction>
  </qti-item-body>
</qti-assessment-item>
Figure 26 Expected Rendering: A background canvas containing the image, upon which a candidate may draw using provided delivery platform drawing tools. Such delivery platform drawing tools are left entirely to the delivery platform.
An instructional sentence of text appears above a large rectangle.
                      Within the rectangle are two connected lines with 3 points labelled by letters.
                      To the left of the large rectangle is a stack of buttons with icons representing drawing tools and functions.

3.2.21 End Attempt Interaction

End Attempt Interaction is a special interaction which immediately ends the current attempt on an assessment item.  It may be used, for example, to allow the candidate to request a hint or model solution, or in an adaptive item to let the candidate display feedback or to move to the next in a series of interactions in the item.

EndAttemptInteraction Attributes (element: qti-end-attempt-interaction)

Name Usage Value(s) Default
title mandatory xs:string
count-attempt optional xs:boolean

Example: Demonstrates qti-end-attempt-interaction with a Hint

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
identifier="end-attempt-example-1" title="End Attempt Example" 
adaptive="false" time-dependent="false" xml:lang="en-US" >
  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier">
    <qti-correct-response>
       <qti-value>C</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-response-declaration identifier="HINTREQUEST" cardinality="single" base-type="boolean"/>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"/>
  <qti-outcome-declaration identifier="FEEDBACK" cardinality="single" base-type="identifier"/>
  <qti-item-body>
    <qti-choice-interaction response-identifier="RESPONSE" shuffle="false" max-choices="1">
      <qti-prompt>Who was the President of Mexico from 2000 to 2006?</qti-prompt>
      <qti-simple-choice identifier="A">George W Bush</qti-simple-choice>
      <qti-simple-choice identifier="B">Tony Blair</qti-simple-choice>
      <qti-simple-choice identifier="C">Vicente Fox</qti-simple-choice>
      <qti-simple-choice identifier="D">Ariel Sharon</qti-simple-choice>
    </qti-choice-interaction>
    <p>
      <qti-end-attempt-interaction response-identifier="HINTREQUEST" title="Show Hint"/>
    </p>
    <qti-feedback-block identifier="HINT" outcome-identifier="FEEDBACK" show-hide="show">
      <qti-content-body>
        Tony lived in the United Kingdom and George lived in Washington, DC.
      </qti-content-body>
    </qti-feedback-block>
  </qti-item-body>
  <qti-response-processing>
    <qti-set-outcome-value identifier="FEEDBACK">
      <qti-base-value base-type="identifier">NOHINT</qti-base-value>
    </qti-set-outcome-value>
    <qti-response-condition>
      <qti-response-if>
        <qti-variable identifier="HINTREQUEST"/>
        <qti-set-outcome-value identifier="FEEDBACK">
          <qti-base-value base-type="identifier">HINT</qti-base-value>
        </qti-set-outcome-value>
      </qti-response-if>
      <qti-response-else>
        <qti-response-condition>
          <qti-response-if>
            <qti-match>
              <qti-variable identifier="RESPONSE"/>
              <qti-correct identifier="RESPONSE"/>
            </qti-match>
            <qti-set-outcome-value identifier="SCORE">
              <qti-base-value base-type="float">1</qti-base-value>
            </qti-set-outcome-value>
          </qti-response-if>
          <qti-response-else>
            <qti-set-outcome-value identifier="SCORE">
              <qti-base-value base-type="float">0</qti-base-value>
            </qti-set-outcome-value>
          </qti-response-else>
        </qti-response-condition>
      </qti-response-else>
    </qti-response-condition>
  </qti-response-processing>
</qti-assessment-item>
Figure 27 Expected Rendering: the End Attempt interaction is rendered as a button. However, rendering embodiments of End Attempt interactions are left to the delivery platform.
A question is shown with 4 response options.
                      Below the response options is a button with the words “Show Hint” within it.
                      Below the button is a sentence of text (the hint).

3.2.22 Custom Interaction

The CustomInteraction.Type (qti-custom-interaction) is a deprecated feature in QTI 3. It is recommended to use Portable Custom Interaction (next section) in place of the custom interaction. The Custom Interaction provides an opportunity for delivery platform-specific extensibility of this specification to include support for interactions not currently built into the QTI specification.  This can be used, for example, to develop technology-enhanced items.

As the user interface and behavior of a qti-custom-interaction are custom, there is no predefined shared vocabulary for qti-custom-interaction.  However if a qti-custom-interaction implements a feature or behavior in a way which is consistent with how that has been defined for the pre-defined interaction types then it may use qti- prefixed class names to indicate it supports a behaviour consistent with the use of that shared vocabulary elsewhere in this specification; e.g., a qti-custom-interaction which supports text entry by the candidate may support the qti-input-width set of classes to control the visible width allocated to display of the candidate's input.

CustomInteraction Attributes (element: qti-custom-interaction)

Name Usage Value(s) Default
class optional xs:string
response-identifier mandatory identifier

Example: Demonstrates qti-custom-interaction

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
identifier="custom-deprecated-example-1" title="Custom Interaction Example" 
adaptive="false" time-dependent="false" xml:lang="en-US" >
<qti-response-declaration cardinality="single" base-type="string" identifier="RESPONSE">
    <qti-correct-response>
      <qti-value>3/8</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-outcome-declaration cardinality="single" base-type="float" identifier="SCORE"/>
  <qti-item-body>
    <p>
      A pie is divided into quarters. Each slice is then divided in half. One half of the
      pie is eaten at lunch. One slice is eaten at snack time.
    </p>
    <p>
      Use the Fraction Tool below to shade the portion of the pie that is left. The Fraction Tool
      buttons divide the circle into fewer or more pieces. Pieces of the circle can be
      shaded by selecting them.
    </p>
    <!-- docking div for the custom interaction -->
    <div id="myfractionmodel"></div>
  <qti-custom-interaction class="tei-fractionmodel" response-identifier="RESPONSE">
      <!-- Not required to kebab-case or use qti- as this custom-option is completely
           custom element.  However, best practice in QTI 3 is to kebab-case it for
           webcomponent-friendliness.
      -->
      <custom-option><![CDATA[
        {
          dockingDivId: 'myfractionmodel',
          alignment: 'center',
          models: [{  
            active: true,
            startSegments: 2,
            minSegments: 1,
            maxSegments: 12,
  selectedSegments: [],
            text: 'The Fraction Tool',
            style: {
              radius: 150,
              fillColor: '#FF0000',
              strokeColor: '#000000',
              strokeWeight: 2
            }
          }]
        }
      ]]></custom-option>
  </qti-custom-interaction>
  </qti-item-body>
</qti-assessment-item>
Figure 28 Expected Rendering: Because custom interactions are by definition, "custom", there are no expectations for delivery platform rendering. The example rendering below is provided as an example of how a delivery platform might render the above, so-called "Fraction Model" custom interaction.
Two paragraphs of text are presented above a rectangle with the title 'The Fraction Tool'.
                      The rectangle contains a circle divided into 8 equal sized sectors where 3 sectors are colored red.
                      There are 3 buttons below the circle: Fewer, More, Reset.

3.2.23 Portable Custom Interaction (PCI)

The PortableCustomInteraction.Type (qti-portable-custom-interaction) allows an item author with the support of a PCI module developer the ability to render an interaction with a custom user interface and behaviors by providing custom Javascript code supporting the interaction. This can be used, for example, to develop technology-enhanced items.

The Javascript code which implements a PCI may be included with the item in the content package or may reside elsewhere on the network. It will be loaded dynamically by the delivery engine when the item containing the PCI is presented.  These Javascript modules must be AMD (Asynchronous Module Definition) modules, and must conform to the PCI API, detailed later in this document.   The markup of a PCI may include any HTML5, MathML, and SSML elements supported elsewhere in QTI.  In addition, a PCI may contain feedback, template, and printed variable elements.  Finally, a special templateelement may be included. This may be used only in a PCI and is a container for any valid XML markup.

As the user interface and behavior of a PCI are custom, there is no predefined shared vocabulary for PCIs.  However if a PCI implements a feature or behavior in a way which is consistent with how that has been defined for the pre-defined interaction types then it MAY use qti- prefixed CSS class names to indicate it supports a behaviour consistent with the use of that shared vocabulary elsewhere in this specification; e.g. a PCI which supports text entry by the candidate may support the qti-input-width set of classes to control the visible width allocated to display of the candidate's input.

PCI allows for referencing a stylesheet using the qti-stylesheet element, where the stylesheet is specific to the code referenced within the PCI. PCI also allows for the inclusion of catalog information that is specific to the PCI. PCI is the only interaction that allows for these elements within the interaction. All other interactions would use the item level stylesheet reference and the item level catalog node.

There is a detailed example of a PCI in Section 3.7.12 .  Consequently, example definitions and expected renderings are not provided here.

3.3 Composite Items

Composite items are items that contain more than one interaction. Composite items may contain multiple instances of the same type of interaction or have a mixture of interaction types.

While a QTI item may contain multiple interactions, an interaction MUST NOT be nested or contained within any other interaction. Items with nested interactions are not considered compliant to the QTI standard regardless of whether they pass validation or not.

Example: Demonstrates composite item with two Inline Choice interactions and oneText Entry interaction, Response Processing with partial scoring

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0
  https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_itemv3p0_v1p0.xsd"
   xml:lang="en-US" identifier="shakespeare_biography" time-dependent="false">
    <qti-response-declaration identifier="response_1" cardinality="single" base-type="identifier">
      <qti-correct-response>
        <qti-value>choice_1</qti-value>
      </qti-correct-response>
    </qti-response-declaration>
    <qti-response-declaration identifier="response_2" cardinality="single" base-type="identifier">
      <qti-correct-response>
        <qti-value>choice_4</qti-value>
      </qti-correct-response>
    </qti-response-declaration>
    <qti-response-declaration identifier="response_3" cardinality="single" base-type="string">
      <qti-correct-response>
        <qti-value>poet</qti-value>
      </qti-correct-response>
      <qti-mapping default-value="0">
        <qti-map-entry map-key="poet" mapped-value="1"/>
        <qti-map-entry map-key="playwright" mapped-value="1"/>
        <qti-map-entry map-key="writer" mapped-value="0.5"/>
      </qti-mapping>
    </qti-response-declaration>
    <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"/>
    <qti-outcome-declaration identifier="SCORE_1" cardinality="single" base-type="float"/>
    <qti-outcome-declaration identifier="SCORE_2" cardinality="single" base-type="float"/>
    <qti-outcome-declaration identifier="SCORE_3" cardinality="single" base-type="float"/>
    <qti-item-body>
      <p>
        <strong>About William Shakespeare</strong>
      </p>
      <p>
        Date of birth:
        <qti-inline-choice-interaction response-identifier="response_1">
          <qti-inline-choice identifier="choice_1">26 April 1564</qti-inline-choice>
          <qti-inline-choice identifier="choice_2">29 February 1664</qti-inline-choice>
          <qti-inline-choice identifier="choice_3">2 March 2010</qti-inline-choice>
        </qti-inline-choice-interaction>
      </p>
      <p>
        Date of death:
        <qti-inline-choice-interaction response-identifier="response_2">
          <qti-inline-choice identifier="choice_4">23 April 1616</qti-inline-choice>
          <qti-inline-choice identifier="choice_5">24 April 1616</qti-inline-choice>
          <qti-inline-choice identifier="choice_6">25 April 1616</qti-inline-choice>
        </qti-inline-choice-interaction>
      </p>
      <hr/>
      <p>
        <em>Shakespeare</em> was an English
        <qti-text-entry-interaction response-identifier="response_3" expected-length="15"/>,
        widely regarded as the greatest writer in the English language and the
        world's pre-eminent dramatist.  His surviving works, including some
        collaborations, consist of about <strong>38</strong> plays, <strong>154</strong>
        sonnets, <strong>2</strong> long poems, and several other poems.  His plays have
        been translated into every major living language and are performed more often than
        those of any other playwright.
      </p>
    </qti-item-body>
    <qti-response-processing>
      <qti-response-condition>
        <qti-response-if>
          <qti-match>
            <qti-variable identifier="response_1"/>
                 <qti-correct identifier="response_1"/>
          </qti-match>
          <qti-set-outcome-value identifier="SCORE">
            <qti-sum>
              <qti-variable identifier="SCORE"/>
              <qti-base-value base-type="float">1</qti-base-value>
            </qti-sum>
          </qti-set-outcome-value>
          <qti-set-outcome-value identifier="SCORE_1">
            <qti-base-value base-type="float">1</qti-base-value>
          </qti-set-outcome-value>
        </qti-response-if>
      </qti-response-condition>
      <qti-response-condition>
        <qti-response-if>
          <qti-match>
            <qti-variable identifier="response_2"/>
            <qti-correct identifier="response_2"/>
          </qti-match>
          <qti-set-outcome-value identifier="SCORE">
            <qti-sum>
              <qti-variable identifier="SCORE"/>
              <qti-base-value base-type="float">1</qti-base-value>
            </qti-sum>
          </qti-set-outcome-value>
          <qti-set-outcome-value identifier="SCORE_2">
            <qti-base-value base-type="float">1</qti-base-value>
          </qti-set-outcome-value>
        </qti-response-if>
      </qti-response-condition>
      <qti-response-condition>
        <qti-response-if>
          <qti-not>
            <qti-is-null>
              <qti-variable identifier="response_3"/>
            </qti-is-null>
          </qti-not>
          <qti-set-outcome-value identifier="SCORE">
            <qti-sum>
              <qti-variable identifier="SCORE"/>
              <qti-map-response identifier="response_3"/>
            </qti-sum>
          </qti-set-outcome-value>
          <qti-set-outcome-value identifier="SCORE_3">
            <qti-map-response identifier="response_3"/>
          </qti-set-outcome-value>
        </qti-response-if>
      </qti-response-condition>
    </qti-response-processing>
  </qti-assessment-item>
Figure 29 Composite Item Example
Two drop down menus are shown, one for the date of birth of Shakespeare, one for the date of death.
                    Below these options is a paragraph of text with an inline text entry box within the text.

3.4 Response Processing

Item response processing occurs after the candidate has completed an attempt on an item.   The purpose of response processing is to compute the value of the item's outcome variables. The most common application is to compute the candidate's score on the item, but in more advanced items, response processing may be used to show or hide feedback or interaction choices, and for other purposes.

3.4.1 Response Processing Rules

Response processing consists of a sequence of rules that are carried out, in order, by the response processor. A ResponseCondition  rule is a special type of rule which contains sub-sequences of rules divided into responseIf , responseElseIf  and responseElse  sections. The response processor evaluates the expressions in the responseIf and responseElseIf elements to determine which sub-sequence to follow. In this example, the responseIf section is followed only if the variable with identifier RESPONSE matches the correct response declared for it. The responseElseIf section is followed if RESPONSE matches the response explicitly given (which places the correct driver 1st but confuses the other two). Finally, the responseElse section is followed if neither of the previous two apply. The responseElse section has no corresponding expression of course. The qti-set-outcome-value  element is just a ResponseRule  that tells the processor to set the value of the specified outcome variable to the value of the expression it contains.

The qti-variable , qti-correct  and qti-base-value  elements are examples of simple expressions. In other words, expressions that are indivisible. In contrast, the qti-match  and qti-ordered  elements are examples of operators. Operators are expressions that combine other expressions to form new values. For example, match is used to form a boolean depending on whether or not two expressions have matching values.

3.4.2 Fixed and General Response Processing

There are two forms of response processing:

  1. Fixed Template Response Processing
  2. General Response Processing.

In  "fixed template" response processing, the processing to be done is identified by a "template name".   There are three standard template names, and a delivery engine may define additional template names.   For simple scenarios, the "match_correct" and "map_response" standard templates may be used because this maximizes interoperability.   All conformant delivery systems are required to provide response processing as defined by these two templates, while there is no assurance that a template other than these two will be supported, or that general response processing will be supported.

The three standard "fixed" response processing templates are:

Template Name Description Location
match_correct https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/match_correct.xml
map_response https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/map_response.xml
map_response_point https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/map_response_point.xml

For "general" response processing, QTI defines an XML-based Domain Specific Language (DSL) with a large number of commands and operators for computing and setting template and outcome variables. General response processing is necessary for more complex items, such as items generated from templates, adaptive items involving feedback, and composite items.

The same Domain Specific Language is also used for Outcome Processing, Template Defaults, Constraints, and Processing, and for evaluating Preconditions and Branch Rules.

3.4.3 Partial Scoring

Please see section 3.3 Composite Items for an example of response processing that implements partial scoring.

3.4.4 Conformance

It is possible to define the effect of the standard templates using the "general" response processing DSL, but it is not required that a QTI 3 Entry-level delivery system implement the standard templates through support of the DSL. A "built-in" implementation of the standard templates is sufficient for conformance in a QTI 3 Entry-level delivery system.

At the QTI 3 Core-level of conformance, a delivery system is required to support enough of the response processing DSL to be able to load and execute at least the "match_correct" and "map_response" standard templates, as well as other templates or inline response processing blocks using the same subset of the Domain Specific Language as these two standard templates.  For convenience and performance, a QTI 3 Core-level delivery system may still also use the "built-in" approach for some of the templates which it supports, in addition to supporting the response processing language.

3.4.5 External Scoring

In some cases, response processing is undertaken by external systems or human scorers. This is typically the case for items asking candidates to write an essay. However, it might be important for external systems or human scorers to know which outcome value has to be set to derive an appropriate score.

External Scoring Example

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item
     xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0
    https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd" identifier="essay"
     title="Write an essay" adaptive="false" time-dependent="false" xml:lang="en-US">
  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="string"/>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"  external-scored="human"/>
  <qti-item-body>
     <p class="stem">
        In the classroom, we discovered Martin Luther King Jr. and his devotion.
     </p>
     <qti-extended-text-interaction response-identifier="RESPONSE">
        <qti-prompt>Write an abstract about the life of this historical figure.</qti-prompt>
     </qti-extended-text-interaction>
  </qti-item-body>
  </qti-assessment-item>

This example describes an item with a single qti-extended-text-interactionasking the candidate to write an essay. As the item does not contain qti-response-processing, the SCORE qti-outcome-declaration has its external-scored attribute value set to "human". This makes QTI compliant systems aware that the final value of SCORE has to be set by a human scorer after the Item Session has closed.

3.5 Outcomes

Outcome variables are declared by outcome declarations. Their value is set either from a default given in the declaration itself or by a responseRule during responseProcessing.

Items that declare a numeric outcome variable representing the candidate's overall performance on the item should use the "SCORE" built-in outcome variable. SCORE must have a base-type of float.

Items that declare a maximum score (in multiple response choice interactions, for example) should do so by declaring the built-in variable named "MAXSCORE".  MAXSCORE must have a base-type of float.

Items or tests that want to make the fact that the candidate scored above a predefined threshold available as a variable should use the built-in "PASSED' outcome variable. PASSED must have a base-type of boolean.

At runtime, outcome variables are instantiated as part of an item session. Their values may be initialized with a default value and/or set during response processing. If no default value is given in the declaration then the outcome variable is initialized to NULL unless the outcome is of a numeric type (integer or float) in which case it is initialized to 0.

For non-adaptive Items; i.e., items that do not use template processing to compute default values, the values of the outcome variables are reset to their default values prior to each invocation of response processing. For adaptive Items, the outcome variables retain the values that were assigned to them during the previous invocation of response processing. For more information, see section 3.4.2 Fixed and General Response Processing .

There is one built-in outcome variable, "completionStatus", that is declared implicitly and must not appear in an outcomeDeclaration. Delivery Engines must maintain the value of the built-in outcome variable completionStatus, a single identifier. It starts with the reserved value "not_attempted". At the start of the first attempt it changes to the reserved value "unknown". It remains with this value for the duration of the item session unless set to a different value by a setOutcomeValue rule in responseProcessing. There are four permitted values:

  • 'completed' - the candidate has experienced enough of the item to consider it completed;
  • 'incomplete' - the candidate has not experienced enough of the item to consider it completed;
  • 'not_attempted' - the candidate is considered to have not used the item in any significant way;
  • 'unknown' - no assertion on the state of completion can be made.

Any one of these values may be set during response processing. If an Adaptive Item sets completionStatus to completed then the session must be placed into the closed state, however an item session is not required to wait for the completed signal before terminating, it may terminate in response to a direct request from the candidate, through running out of time or through some other exceptional circumstance. Adaptive Items must maintain a suitable value and should set completionStatus to "completed" to indicate when the cycle of interaction, response processing and feedback must stop. Non-adaptive Items are not required to set a value for completionStatus, but they may do so. Delivery Engines are encouraged to use the value of completionStatus when communicating externally.

OutcomeDeclaration Attributes (element: qti-outcome-declaration)

Name Usage Value(s) Default
identifier required Identifier
base-type required

Normalized string

  • identifier
  • boolean
  • integer
  • float
  • string
  • point
  • pair
  • directedPair
  • duration
  • file
  • uri
cardinality required

Normalized string

  • single
  • multiple
  • ordered
  • record
view optional

Normalized string

  • author
  • candidate
  • proctor
  • scorer
  • testConstructor
  • tutor
The intended audience for an outcome variable can be set with the view attribute. If no view is specified the outcome is treated as relevant to all views. Complex items, such as adaptive items or complex templates, may declare outcomes that are of no interest to the candidate at all, but are merely used to hold intermediate values or other information useful during the item or test session. Such variables should be declared with a view of author (for item outcomes) or testConstructor (for test outcomes). Systems may exclude outcomes from result reports on the basis of their declared view if appropriate. Where more than one class of user should be able to view an outcome variable the view attribute should contain a comma delimited list.
interpretation optional string A human interpretation of the variable's value.
long-interpretation optional uri

An optional link to an extended interpretation of the outcome variable's value.         

Declared outcomes with numeric types should indicate their range of possible values using normal-maximum and normal-minimum, especially if this range differs from [0,1].

Declared outcomes with numeric types should indicate their range of possible values using normal-maximum and normal-minimum, especially if this range differs from [0,1].

normal-maximum optional float The normal-maximum attribute optionally defines the maximum magnitude of numeric outcome variables, it must be a positive value. If given, the outcome's value can be divided by normal-maximum and then truncated (if necessary) to obtain a normalized score in the range [-1.0,1.0]. normal-maximum has no effect on response processing or the values that the outcome variable itself can take.
normal-minimum optional float The normal-minimum attribute optionally defines the minimum value of numeric outcome variables, it may be negative.
mastery-value optional float The mastery-value attribute optionally defines a value for numeric outcome variables above which the aspect being measured is considered to have been mastered by the candidate.

3.6 Stylesheets

QTI 3 introduces an extensive shared vocabulary for improving item interaction rendering interoperability. To further improve item rendering interoperability, QTI 3 also introduces a limited number of shared CSS style names and conventions for use by authoring and delivery systems. In the QTI 3 Standardized Shared Vocabulary and CSS Classes document, the shared vocabulary are defined (with examples) and sample CSS code is provided. In addition to interaction specific vocabulary, the document includes:

  • Accessibility Classes
  • The standardized markup for inline text
  • Content layout (rows, columns, offsets, etc.)
  • Alignment markup
  • Vertical Writing
  • Markup for visually hiding elements
  • List Styles

By implementing these shared styles and conventions, QTI 3 authoring and delivery platforms can safely import/export – or render – items while preserving certain presentation characteristics without using custom stylesheet injection. Note that all of the shared styles are prefaced by the "qti-" string so as to avoid collisions with a delivery platform's existing CSS.

Reference implementations of each CSS class – and further examples – can be found in the IMS GitHub QTI 3 repository. Over time, it is expected that additional shared CSS style names and definitions will be added to this repository.

3.6.1 Custom Styles

For QTI 3, the best practice is to avoid using custom styles, and instead use the Shared CSS Vocabulary as described above. By using the Shared CSS style names, Test Delivery Systems can optimize the rendering experience for accessibility and for design responsiveness.

However, as a last resort, custom stylesheets may be injected into an item and other QTI content, such as tests, stimuli, and feedback, rubric, and template blocks, using the qti-stylesheet element:

...
<qti-assessment-item>
  <qti-stylesheet href="samples/Quizzco-Custom-Styles.css" type="text/css"/>
  <qti-item-body>
    <div id="Quizzco__item123" class="qti-layout-row">
      ...
     </div>
  </qti-item-body>
</qti-assessment-item>

As in earlier versions of QTI, it is not required for conformance for delivery systems to support the qti-stylesheet element -- a further reason why stylesheet injection is likely not to be interoperable.  Notwithstanding these issues, if your implementation will be using stylesheets,  QTI 3 recommends the use of CSS 3 stylesheets. For more information on CSS 3 stylesheets, see the W3C documentation at https://www.w3schools.com/css/default.asp  .

The best practice convention in QTI 3 is that stylesheets referenced within an AssssmentItem file apply to the item itself, and are not assumed to apply to associated content such as stimulus ( qti-assessment-stimulus) or rubric blocks ( qti-rubric-block), both of which can have their own associated stylesheets. An item's stylesheets are assumed to apply to content within qti-item-body, qti-catalog-info,  as well as to any content generated from the use of feedback or templates. Any included content using XInclude that is placed within the qti-item-body, qti-catalog-info, and qti-modal-feedback, or qti-template-block generated content is also assumed to be covered by the stylesheet reference made within an item.

It is the responsibility of an item author to limit the scope of an injected stylesheet to the content with which it is associated. Because of the way CSS scoping is defined, this is admittedly difficult.  The following describes some approaches to limiting CSS scope:

  • Use class naming conventions. Use a naming convention for CSS classes which includes a prefix with an item vendor-specific code, and which is likely to make custom  class names globally unique.
  • Avoid bare element or attribute selectors. Avoid CSS style rules which apply broadly, such as those using "bare" element or attribute selectors.  Such rules are very likely to have a wider impact than intended.  Do not write rules like "div {color: red}". There are bound to be many other div'sin the document, not all of which should be red.  Instead, write ".vendorprefix-red { color: red }", and add the "vendorprefix-red" class to elements in the content which should be red.   Further note: at all costs, avoid specifying any colors in custom style definitions as these are practically guaranteed to result in an accessibility problem for the delivery platform.
  • Do not assume defaults are in effect. Do not assume that CSS properties will have their default values.  If it is important for an element to have the default CSS property values, you should set the properties explicitly to the default values.
  • Use id attributes and descendent selectors. QTI 3 allows the use of the id attribute on HTML5 elements.  It may be helpful to assign an id to a higher level element within the HTML content you are styling, such as a div,and write style rules against that id, possibly combined with descendant selectors. Choose ids that are likely to be globally unique so that other stylesheets in the environment don't affect your content, and vice-versa.  
  • Do not assume order.Do not assume an injected stylesheet will be first or last, or in any particular position relative to other stylesheets in the delivery environment. That is, if item 1 injects stylesheet A, and the next item, item 2, injects stylesheet B, a delivery engine is free to insert the two stylesheets in any order, and an author cannot rely on stylesheet B being after stylesheet A. Even worse, stylesheet C, from somewhere else entirely, may land in between the two. In short, it is not really possible to rely on the CSS cascade between stylesheets, because the ultimate ordering of the stylesheets is not defined.
  • Be aware of delivery system artifacts. You may observe that the HTML generated by the delivery system for QTI content includes HTML elements which were not in the original content.  This is because delivery engines commonly transform QTI content such as interactions, interaction components (e.g. qti-prompt, or qti-simple-choice), the qti-item-body, catalog cards, rubrics, feedback blocks, etc, into standard HTML elements, and these will end up as the parents, children, or siblings of the HTML elements placed in the item directly.  It is unwise to style these  system-generated elements or to rely on the generated structure in CSS style rules, because another delivery system, or even another version of the same delivery system, will generate a different structure.  Be aware when writing style rules that delivery system artifacts may appear "out of nowhere" and "get in the way" of sibling selectors, child selectors, adjacency selectors, first- and last-child pseudo-selectors, and the like.
  • Do not depend on the stylesheet. To be interoperable, QTI content should fall back to a functional and accessible presentation even if the stylesheet is not injected. When injecting a stylesheet, authors should still rely on the CSS Shared Vocabulary for most of the styling and reserve the additional rules in the stylesheet  for styling which cannot be achieved through Shared Vocabulary.  An author should ensure that the content is acceptable with just Shared Vocabulary and be prepared for a stylesheet not to be injected at all.

Here is an example item, generated by a fictional vendor Quizzco, with some of these best practices applied:

Item with External Stylesheet Example

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/qti/imsqtiasi_v3p0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.imsglobal.org/xsd/qti/imsqti_itemv3p0_v1p0
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
identifier="QTI3-custom-stylesheet" title="Custom Stylesheet" 
time-dependent="false" xml:lang="en-US">
  <qti-response-declaration base-type="identifier" cardinality="single" identifier="RESPONSE1">
      <qti-correct-response>
        <qti-value>Y</qti-value>
      </qti-correct-response>
    </qti-response-declaration>
  <qti-response-declaration base-type="identifier" cardinality="single" identifier="RESPONSE">
      <qti-correct-response>
        <qti-value>Y</qti-value>
      </qti-correct-response>
    </qti-response-declaration>
  <qti-outcome-declaration base-type="float" cardinality="single" identifier="SCORE"/>
  <qti-stylesheet href="samples/Quizzco-Custom-Styles.css" type="text/css"/>
  <qti-item-body>
   <div id="Quizzco__item123" class="qti-layout-row">
    <div class="qti-layout-col7">
     <p class="Quizzco__item__prompt">
      Identify the missing word in this famous quote from Shakespeare's Richard III.</p>
       <blockquote class="Quizzco__item__passage">
        Now is the winter of our discontent<br />
        Made glorious summer by this sun of 
        <qti-inline-choice-interaction response-identifier="RESPONSE">
          <qti-inline-choice identifier="G">Gloucester</qti-inline-choice>
          <qti-inline-choice identifier="L">Lancaster</qti-inline-choice>
          <qti-inline-choice identifier="Y">York</qti-inline-choice>
          </qti-inline-choice-interaction>;<br />
        And all the clouds that lour'd upon our house<br />
        In the deep bosom of the ocean buried.
        </blockquote>
       </div>
   </div>
     </qti-item-body>
     <qti-response-processing 
   template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/match_correct.xml"/>
   </qti-assessment-item>

External Stylesheet Example: Quizzco-Custom-Styles.css

#Quizzco__item123 Quizzco__item__prompt {
     all: initial;
     display: block;
     margin-block-start: 1em;
     text-align: start;
     padding: 5px;
     font-weight: normal;
  }

  #Quizzco__item123 Quizzco__item__passage {
     line-height: 1.3em;
     font-weight: bolder;
  }

3.7 Advanced Item Structures

3.7.1 Customized Response Processing

The qti-custom-operator extension mechanism allows the inclusion of custom, non-QTI response evaluation rules.  In general, such APIs are likely to be particular to a specific software library or programming language. For that reason, it is difficult to predict what form such custom operators will take, and, by extension, how to generalise functions or syntax between different custom operators.

By way of illustration, the following fragment illustrates the use of the Maxima engine as a response processing library via the qti-custom-operator element.

<qti-set-outcome-value identifier="oDummy">
     <qti-custom-operator class="org.qtitools.mathassess.ScriptRule" ma:simplify="false"
    ma:syntax="text/x-maxima" xmlns:ma="http://mathassess.qtitools.org/xsd/mathassess">
        <qti-base-value base-type="string"><[!CDATA[
              oInput:RESPONSE;        
              equalp(p,q):= block([simp:false], if p=q then return(true)
                   else return(false) )$
               isEqual: equalp(RESPONSE,mAns);
              equivp(p,q):= block([simp:true], if is(equal(p,q))=true then return(true)
                      else return(false) )$
              isEquiv: equivp(RESPONSE,mAns);        
              isRecip: equivp(RESPONSE,1/mAns);
              numOrig: equivp(num(RESPONSE),mNum);
              denomOrig: equivp(denom(RESPONSE),mDen);                
              isOrig: if (numOrig and denomOrig) then true else false;        
              denR1: equivp(denom(RESPONSE),1);
              denR2: equalp(denom(RESPONSE),iN^(-iC));
              numR1: equalp(num(RESPONSE),iN^iC);
              numR2: equivp(num(RESPONSE),1);                
              negPower: is(ev(-iC,numer,simp)>0);
              isSimp: equalp(RESPONSE,ev(RESPONSE,simp));
              isNotSimp: if((numR2 and denR2 and not negPower) or (isEquiv and not isSimp)) then true
                     else false;
              isOK: if ((numR1 and denR1) or (negPower and numR2 and denR2)) then true
                        else false;        
              isAdded: equivp(RESPONSE,mAdd);
              isSubtracted: equivp(RESPONSE,mSub);
              isMultiplied: equivp(RESPONSE,mMult);
        ]]></qti-base-value>
     </qti-custom-operator>
  </qti-set-outcome-value>

In this case, a qti-custom-operator is used as a very slim container for what is effectively a complete script in Maxima's language. A QTI processor designed to work with this qti-custom-operator could pass the script verbatim to Maxima, and use its response to set the 'oDummy' outcome value.

3.7.2 Adaptive Items

Adaptive items are a feature that allows an item to be scored adaptively over a sequence of attempts. This allows the candidate to alter their answer following feedback or to be posed additional questions based on their current answer. Response processing works differently for adaptive items. Normally (for non-adaptive items) each attempt is independent and the outcome variables are set to their default values each time response processing is carried out. For adaptive items, the outcome variables retain their values across multiple attempts and are only updated by subsequent response processing. This difference is indicated by the value of the adaptive attribute of the Assessment Item. Adaptive items must of course provide feedback to the candidate in order to allow them to adjust their response(s).

In the following example, the feedback is used to contain a solution which is displayed when the candidate clicks the "Show Solution" button.

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd 
http://www.w3.org/1998/Math/MathML 
https://purl.imsglobal.org/spec/mathml/v2p0/schema/xsd/mathml2.xsd 
http://www.w3.org/2001/XInclude 
https://purl.imsglobal.org/spec/w3/2001/schema/xsd/XInclude.xsd" 
identifier="Example03-feedbackBlock-solution" title="Using feedbackBlock to show a solution" 
  adaptive="true" xml:lang="en-US"
  tool-name="Mathqurate" tool-version="0.9.7b">
  <qti-response-declaration base-type="float" cardinality="single" identifier="RESPONSE">
    <qti-correct-response>
      <qti-value>7.389</qti-value>
    </qti-correct-response>
  </qti-response-declaration>

<!--This response variable is set to true if the solution button is clicked.-->

  <qti-response-declaration base-type="boolean" cardinality="single" identifier="SOLREQUEST"/>
  <qti-outcome-declaration base-type="identifier" cardinality="multiple" identifier="FEEDBACK"/>
  <qti-outcome-declaration base-type="identifier" cardinality="single" identifier="EMPTY"/>
  <qti-outcome-declaration base-type="float" cardinality="single" identifier="SCORE" 
     normal-maximum="10.0" normal-minimum="0.0">
    <qti-default-value>
      <qti-value>0.0</qti-value>
      </qti-default-value>
  </qti-outcome-declaration>

<!--This outcome variable is set to true if the solution has been viewed.-->

  <qti-outcome-declaration base-type="boolean" cardinality="single" identifier="seenSolution">
    <qti-default-value>
      <qti-value>false</qti-value>
    </qti-default-value>
  </qti-outcome-declaration>

<!--This outcome variable controls the display of the solution button.-->

  <qti-outcome-declaration base-type="identifier" cardinality="single" identifier="ASKSOLUTION">
    <qti-default-value>
      <qti-value>asksolution</qti-value>
    </qti-default-value>
  </qti-outcome-declaration>
  <qti-item-body>
    <div>
      <p>Find the value of <m:math id="mathML0">
        <m:semantics>
                    <m:mrow>
                        <m:msup>
                            <m:mi>e</m:mi>
                            <m:mn>2</m:mn>
                        </m:msup>
                    </m:mrow>
                    <m:annotation encoding="LaTeX">[e^2]</m:annotation>
                </m:semantics>
            </m:math> to 3 decimal places.</p>
      <div>
        <table>
          <tbody>
            <tr>
              <td>
                <qti-text-entry-interaction expected-length="20" id="textEntryInteraction0" 
                label="mathInput" response-identifier="RESPONSE" />
              </td>
              <td>
                <qti-feedback-inline id="feedbackInline0" identifier="CORRECT" 
                outcome-identifier="FEEDBACK" show-hide="show">Correct </qti-feedback-inline>
                <qti-feedback-inline id="feedbackInline1" identifier="INCORRECT" 
                outcome-identifier="FEEDBACK" show-hide="show">
                No, that is not the correct answer</qti-feedback-inline>
              </td>
            </tr>
          </tbody>
        </table>
      </div>

<!-- this feedbackBlock contains the solution -->

    <qti-feedback-block identifier="SOLUTION" outcome-identifier="FEEDBACK" show-hide="show">
      <qti-content-body>
        <div>
                    <m:math display="block" id="mathML1">
                        <m:semantics>
                            <m:mtable>
                                <m:mtr>
                                    <m:mtd columnalign="right">
                                        <m:msup>
                                            <m:mi>e</m:mi>
                                            <m:mn>2</m:mn>
                                        </m:msup>
                                    </m:mtd>
                                    <m:mtd columnalign="center">
                                        <m:mo>=</m:mo>
                                    </m:mtd>
                                    <m:mtd columnalign="left">
                                        <m:mi>exp</m:mi>
                                        <m:mfenced close=")" open="(">
                                            <m:mn>2</m:mn>
                                        </m:mfenced>
                                    </m:mtd>
                                </m:mtr>
                                <m:mtr>
                                    <m:mtd columnalign="right"/>
                                    <m:mtd columnalign="center">
                                        <m:mo>=</m:mo>
                                    </m:mtd>
                                    <m:mtd columnalign="left">
                                        <m:mn>7.389</m:mn>
                                    </m:mtd>
                                </m:mtr>
                            </m:mtable>
                            <m:annotation encoding="SnuggleTeX">egin{eqnarray*}e^2 &=&
                                    exp(2)\ &=& 7.389end{eqnarray*}</m:annotation>
                        </m:semantics>
                    </m:math>
        </div>
      </qti-content-body>
    </qti-feedback-block>

<!-- Explain why the score is zero (after viewing solution) -->

    <qti-feedback-block identifier="SEEN-SOLUTION" outcome-identifier="FEEDBACK" show-hide="show">
      <qti-content-body>
        <p> Since you have viewed the solution, your score for this question will be 0. </p>
      </qti-content-body>
    </qti-feedback-block>

<!-- show the solution button -->

    <qti-feedback-block identifier="asksolution" outcome-identifier="ASKSOLUTION" show-hide="show">
      <qti-content-body>
        <p>
          <qti-end-attempt-interaction response-identifier="SOLREQUEST" title="Show Solution"/>
        </p>
      </qti-content-body>
    </qti-feedback-block>
    </div>
  </qti-item-body>
<qti-response-processing>
  <qti-set-outcome-value identifier="FEEDBACK">
    <qti-multiple>
      <qti-variable identifier="EMPTY"/>
    </qti-multiple>
  </qti-set-outcome-value>
  <qti-response-condition>
    <qti-response-if>
            <qti-variable identifier="SOLREQUEST"/>

<!--In response processing, the outcome variable FEEDBACK is set to the identifier 
    (SOLUTION) of the solution feedbackBlock, so that the solution appears.-->

            <qti-set-outcome-value identifier="FEEDBACK">
                <qti-multiple>
                    <qti-base-value base-type="identifier">SOLUTION</qti-base-value>
                </qti-multiple>
            </qti-set-outcome-value>

<!--The seenSolution flag is set to true so that the message about the score will 
    appear if an answer is submitted.-->

            <qti-set-outcome-value identifier="seenSolution">
                <qti-base-value base-type="boolean">true</qti-base-value>
            </qti-set-outcome-value>

<!--The built-in outcome variable completionStatus is set to completed – this must 
    happen at some stage in any adaptive question otherwise the question is never 
    complete, which is a problem in tests.-->

            <qti-set-outcome-value identifier="completionStatus">
                <qti-base-value base-type="identifier">completed</qti-base-value>
            </qti-set-outcome-value>

<!--The solution button is removed by setting the ASKSOLUTION outcome variable to null-->

            <qti-set-outcome-value identifier="ASKSOLUTION">
                <qti-base-value base-type="identifier">null</qti-base-value>
            </qti-set-outcome-value>
    </qti-response-if>
    <qti-response-else>
            <qti-response-condition>
                <qti-response-if>
                    <qti-is-null>
                        <qti-variable identifier="RESPONSE"/>
                    </qti-is-null>
                    <qti-set-outcome-value identifier="SCORE">
                        <qti-base-value base-type="float">0</qti-base-value>
                    </qti-set-outcome-value>
                </qti-response-if>
                <qti-response-else>
                    <qti-response-condition>
                        <qti-response-if>
                            <qti-equal-rounded figures="3" rounding-mode="decimalPlaces">
                                <qti-variable identifier="RESPONSE"/>
                                <qti-correct identifier="RESPONSE"/>
                            </qti-equal-rounded>
                            <qti-set-outcome-value identifier="FEEDBACK">
                                <qti-multiple>
                                    <qti-base-value base-type="identifier">CORRECT</qti-base-value>
                                </qti-multiple>
                            </qti-set-outcome-value>
                            <qti-set-outcome-value identifier="SCORE">
                                <qti-base-value base-type="float">2</qti-base-value>
                            </qti-set-outcome-value>
                        </qti-response-if>
                        <qti-response-else>
                            <qti-set-outcome-value identifier="FEEDBACK">
                                <qti-multiple>
                                    <qti-base-value base-type="identifier">INCORRECT</qti-base-value>
                                </qti-multiple>
                            </qti-set-outcome-value>
                            <qti-set-outcome-value identifier="SCORE">
                                <qti-base-value base-type="float">0</qti-base-value>
                            </qti-set-outcome-value>
                        </qti-response-else>
                    </qti-response-condition>

<!--When an answer has been submitted, once again the built-in outcome 
    variable completionStatus is set to completed and the solution button is removed.-->

                    <qti-set-outcome-value identifier="completionStatus">
                        <qti-base-value base-type="identifier">completed</qti-base-value>
                    </qti-set-outcome-value>
                    <qti-set-outcome-value identifier="ASKSOLUTION">
                        <qti-base-value base-type="identifier">null</qti-base-value>
                    </qti-set-outcome-value>
                    <qti-response-condition>
                        <qti-response-if>

<!--When an answer has been submitted, if the solution has been displayed, 
    the message about the score is added to the FEEDBACK, and SCORE is set to 0.0.-->

                          <qti-variable identifier="seenSolution"/>
                    <qti-set-outcome-value identifier="FEEDBACK">
                      <qti-multiple>
                        <qti-variable identifier="FEEDBACK"/>
                        <qti-base-value base-type="identifier">SEEN-SOLUTION</qti-base-value>
                      </qti-multiple>
                    </qti-set-outcome-value>
                    <qti-set-outcome-value identifier="SCORE">
                      <qti-base-value base-type="float">0.0</qti-base-value>
                    </qti-set-outcome-value>
                  </qti-response-if>
                </qti-response-condition>
            </qti-response-else>
          </qti-response-condition>
        </qti-response-else>
    </qti-response-condition>
  </qti-response-processing>
</qti-assessment-item>

A randomized version of the item above is shown below. The randomization does not affect the display of the solution in this example.

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xi="http://www.w3.org/2001/XInclude" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd http://www.w3.org/1998/Math/MathML 
https://purl.imsglobal.org/spec/mathml/v2p0/schema/xsd/mathml2.xsd http://www.w3.org/2001/XInclude 
https://purl.imsglobal.org/spec/w3/2001/schema/xsd/XInclude.xsd" 
identifier="feedbackBlock-solution-random" title="Using feedbackBlock to show a solution (random)" 
adaptive="true" time-dependent="false" xml:lang="en-US" >
  <qti-response-declaration base-type="float" cardinality="single" identifier="RESPONSE"/>
  <qti-response-declaration base-type="boolean" cardinality="single" identifier="SOLREQUEST"/>
  <qti-outcome-declaration base-type="identifier" cardinality="multiple" identifier="FEEDBACK"/>
  <qti-outcome-declaration base-type="identifier" cardinality="single" identifier="EMPTY"/>
  <qti-outcome-declaration base-type="float" cardinality="single" identifier="SCORE" 
    normal-maximum="10.0" normal-minimum="0.0">
          <qti-default-value>
              <qti-value>0.0</qti-value>
          </qti-default-value>
  </qti-outcome-declaration>
  <qti-outcome-declaration base-type="boolean" cardinality="single" identifier="seenSolution">
          <qti-default-value>
              <qti-value>false</qti-value>
          </qti-default-value>
  </qti-outcome-declaration>
  <qti-outcome-declaration base-type="identifier" cardinality="single" identifier="ASKSOLUTION">
          <qti-default-value>
              <qti-value>asksolution</qti-value>
          </qti-default-value>
  </qti-outcome-declaration>
  <qti-template-declaration base-type="integer" cardinality="single" identifier="iA" 
          math-variable="true" param-variable="false"/>
  <qti-template-declaration base-type="float" cardinality="single" identifier="fAns" 
          math-variable="true" param-variable="false"/>
  <qti-template-declaration base-type="float" cardinality="single" identifier="fR" 
          math-variable="true" param-variable="false"/>
  <qti-template-processing>
          <qti-set-template-value identifier="iA">
              <qti-random-integer max="4" min="1"/>
          </qti-set-template-value>
          <qti-set-template-value identifier="fAns">
              <qti-math-operator name="exp">
                  <qti-variable identifier="iA"/>
              </qti-math-operator>
          </qti-set-template-value>
          <qti-set-template-value identifier="fR">
              <qti-round-to figures="3" rounding-mode="decimalPlaces">
                  <qti-variable identifier="fAns"/>
              </qti-round-to>
          </qti-set-template-value>
  </qti-template-processing>
  <qti-item-body>
    <div>
      <p>Find the value of <m:math id="mathML0">
                      <m:semantics>
                          <m:mrow>
                              <m:msup>
                                  <m:mn>e</m:mn>
                                  <m:mi>iA</m:mi>
                              </m:msup>
                          </m:mrow>
                          <m:annotation encoding="LaTeX">[e^qv{iA}]</m:annotation>
                      </m:semantics>
                  </m:math> to 3 decimal places.</p>
    <div>
      <table>
        <tbody>
          <tr>
            <td>
              <qti-text-entry-interaction expected-length="20" id="textEntryInteraction0" 
                label="mathInput" response-identifier="RESPONSE"/>
            </td>
            <td>
              <qti-feedback-inline id="feedbackInline0" identifier="CORRECT" 
              outcome-identifier="FEEDBACK" show-hide="show"> Correct </qti-feedback-inline>
              <qti-feedback-inline id="feedbackInline1" identifier="INCORRECT" 
              outcome-identifier="FEEDBACK" show-hide="show"> 
               No, that is not the correct answer
              </qti-feedback-inline>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
<!-- this feedbackBlock contains the solution -->
              <qti-feedback-block class="" id="feedbackBlock2" identifier="SOLUTION" 
              outcome-identifier="FEEDBACK" show-hide="show">
                <qti-content-body>
                  <div>
                      <m:math display="block" id="mathML1">
                          <m:semantics>
                              <m:mtable>
                                  <m:mtr>
                                      <m:mtd columnalign="right">
                                          <m:msup>
                                              <m:mi>e</m:mi>
                                              <m:mi>iA</m:mi>
                                          </m:msup>
                                      </m:mtd>
                                      <m:mtd columnalign="center"> <m:mo>=</m:mo>
                                      </m:mtd>
                                      <m:mtd columnalign="left">
                                          <m:mi>exp</m:mi>
                                          <m:mfenced close=")" open="(">
                                              <m:mi>iA</m:mi>
                                          </m:mfenced>
                                      </m:mtd>
                                  </m:mtr>
                                  <m:mtr>
                                      <m:mtd columnalign="right"/>
                                      <m:mtd columnalign="center"> <m:mo>=</m:mo>
                                      </m:mtd>
                                      <m:mtd columnalign="left">
                                          <m:mi>fR</m:mi>
                                      </m:mtd>
                                  </m:mtr>
                              </m:mtable>
                              <m:annotation encoding="SnuggleTeX">egin{eqnarray*}e^qv{iA} 
                                &=& exp(qv{iA})\ &=&
                                qv{fR}end{eqnarray*}</m:annotation>
                          </m:semantics>
                      </m:math>
                  </div>       
                </qti-content-body>
              </qti-feedback-block>
<!-- Explain why the score is zero (after viewing solution) -->
              <qti-feedback-block id="feedbackBlock4" identifier="SEEN-SOLUTION" 
              outcome-identifier="FEEDBACK" show-hide="show">
                <qti-content-body>
                  <p>Since you have viewed the solution, your score for this 
                  question will be 0.</p>
                </qti-content-body></qti-feedback-block>
<!-- show the solution button -->
              <qti-feedback-block id="feedbackBlock7" identifier="asksolution" 
              outcome-identifier="ASKSOLUTION" show-hide="show">
                <qti-content-body>
                  <p>
                    <qti-end-attempt-interaction id="endAttemptInteraction2" 
                    response-identifier="SOLREQUEST" title="Show Solution"/>
                  </p>         
                </qti-content-body>
              </qti-feedback-block>
          </div>
  </qti-item-body>
  <qti-response-processing>
          <qti-set-outcome-value identifier="FEEDBACK">
              <qti-multiple>
                  <qti-variable identifier="EMPTY"/>
              </qti-multiple>
          </qti-set-outcome-value>
          <qti-response-condition>
              <qti-response-if>
                  <qti-variable identifier="SOLREQUEST"/>
                  <qti-set-outcome-value identifier="FEEDBACK">
                      <qti-multiple>
                          <qti-base-value base-type="identifier">SOLUTION</qti-base-value>
                      </qti-multiple>
                  </qti-set-outcome-value>
                  <qti-set-outcome-value identifier="seenSolution">
                      <qti-base-value base-type="boolean">true</qti-base-value>
                  </qti-set-outcome-value>
                  <qti-set-outcome-value identifier="completionStatus">
                      <qti-base-value base-type="identifier">completed</qti-base-value>
                  </qti-set-outcome-value>
                  <qti-set-outcome-value identifier="ASKSOLUTION">
                      <qti-base-value base-type="identifier">null</qti-base-value>
                  </qti-set-outcome-value>
              </qti-response-if>
              <qti-response-else>
                  <qti-response-condition>
                      <qti-response-if>
                          <qti-is-null>
                              <qti-variable identifier="RESPONSE"/>
                          </qti-is-null>
                          <qti-set-outcome-value identifier="SCORE">
                              <qti-base-value base-type="float">0</qti-base-value>
                          </qti-set-outcome-value>
                      </qti-response-if>
                      <qti-response-else>
                          <qti-response-condition>
                              <qti-response-if>
                                  <qti-equal-rounded figures="3" rounding-mode="decimalPlaces">
                                      <qti-variable identifier="RESPONSE"/>
                                      <qti-variable identifier="fAns"/>
                                  </qti-equal-rounded>
                                  <qti-set-outcome-value identifier="FEEDBACK">
                                      <qti-multiple>
                                          <qti-base-value base-type="identifier">CORRECT</qti-base-value>
                                      </qti-multiple>
                                  </qti-set-outcome-value>
                                  <qti-set-outcome-value identifier="SCORE">
                                      <qti-base-value base-type="float">2</qti-base-value>
                                  </qti-set-outcome-value>
                              </qti-response-if>
                              <qti-response-else>
                                  <qti-set-outcome-value identifier="FEEDBACK">
                                      <qti-multiple>
                                          <qti-base-value base-type="identifier">INCORRECT</qti-base-value>
                                      </qti-multiple>
                                  </qti-set-outcome-value>
                                  <qti-set-outcome-value identifier="SCORE">
                                      <qti-base-value base-type="float">0</qti-base-value>
                                  </qti-set-outcome-value>
                              </qti-response-else>
                          </qti-response-condition>
                          <qti-set-outcome-value identifier="completionStatus">
                              <qti-base-value base-type="identifier">completed</qti-base-value>
                          </qti-set-outcome-value>
                          <qti-set-outcome-value identifier="ASKSOLUTION">
                              <qti-base-value base-type="identifier">null</qti-base-value>
                          </qti-set-outcome-value>
                          <qti-response-condition>
                              <qti-response-if>
                                  <qti-variable identifier="seenSolution"/>
                                  <qti-set-outcome-value identifier="FEEDBACK">
                                      <qti-multiple>
                                          <qti-variable identifier="FEEDBACK"/>
                                          <qti-base-value base-type="identifier">SEEN-SOLUTION</qti-base-value>
                                      </qti-multiple>
                                  </qti-set-outcome-value>
                                  <qti-set-outcome-value identifier="SCORE">
                                      <qti-base-value base-type="float">0.0</qti-base-value>
                                  </qti-set-outcome-value>
                              </qti-response-if>
                          </qti-response-condition>
                      </qti-response-else>
                  </qti-response-condition>
              </qti-response-else>
          </qti-response-condition>
  </qti-response-processing>
</qti-assessment-item>

Adaptive Example 4 – Using qti-template-block and qti-template-inline inside qti-feedback-block to adjust content:

The qti-feedback-block element can contain subsidiary feedback elements, "template" elements and interactions alongside any of the HTML elements. In this question, the values of template variables are calculated within the templateProcessing element, and the solution is different depending on the value of the variable iA; if iA=90, the right angle in the triangle makes the question easier.

The method for displaying the solution is as in the previous example; here we concentrate on the template elements within the SOLUTION feedbackBlock.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<qti-assessment-item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:m="http://www.w3.org/1998/Math/MathML" 
identifier="Example04-feedbackBlock-templateBlock" title="Find side, directly or sine rule - with solution" 
time-dependent="false" adaptive="true" xml:lang="en">

    <qti-response-declaration identifier="RESPONSE1" cardinality="single" base-type="float"/>
    <qti-response-declaration identifier="HINTREQUEST" cardinality="single" base-type="boolean"/>
    <qti-response-declaration identifier="SOLREQUEST" cardinality="single" base-type="boolean"/>

    <qti-outcome-declaration base-type="float" cardinality="single" identifier="SCORE" 
    normal-maximum="10.0" normal-minimum="0.0">
        <qti-default-value>
            <qti-value>0.0</qti-value>
        </qti-default-value>
    </qti-outcome-declaration>
    <qti-outcome-declaration base-type="identifier" cardinality="multiple" identifier="FEEDBACK"/>
    <qti-outcome-declaration base-type="identifier" cardinality="single" identifier="EMPTY"/>
    <qti-outcome-declaration base-type="boolean" cardinality="single" identifier="seenSolution">
        <qti-default-value>
            <qti-value>false</qti-value>
        </qti-default-value>
    </qti-outcome-declaration>
    <qti-outcome-declaration base-type="boolean" cardinality="single" identifier="seenHint">
        <qti-default-value>
            <qti-value>false</qti-value>
        </qti-default-value>
    </qti-outcome-declaration>
    <qti-outcome-declaration base-type="identifier" cardinality="single" identifier="ASKHINT">
        <qti-default-value>
            <qti-value>askhint</qti-value>
        </qti-default-value>
    </qti-outcome-declaration>
    <qti-outcome-declaration base-type="identifier" cardinality="single" identifier="ASKSOLUTION">
        <qti-default-value>
            <qti-value>asksolution</qti-value>
        </qti-default-value>
    </qti-outcome-declaration>
    <qti-outcome-declaration identifier="oMult" cardinality="single" base-type="float">
        <qti-default-value>
            <qti-value>1.0</qti-value>
        </qti-default-value>
    </qti-outcome-declaration>
    <qti-outcome-declaration identifier="oPower" cardinality="single" base-type="float"/>

<!--The template variables for the calculation are declared, among them iA, an integer variable; it will be used in MathML, 
        so the mathVariable attribute is true.-->
    <qti-template-declaration identifier="iA" cardinality="single" base-type="integer" param-variable="false" math-variable="true">
        <qti-default-value>
            <qti-value>90</qti-value>
        </qti-default-value>
    </qti-template-declaration>
    <qti-template-declaration identifier="iB" cardinality="single" base-type="integer" param-variable="false" math-variable="true">
        <qti-default-value>
            <qti-value>65</qti-value>
        </qti-default-value>
    </qti-template-declaration>
    <qti-template-declaration identifier="ia" cardinality="single" base-type="integer" param-variable="false" math-variable="true"/>
    <qti-template-declaration identifier="sinA" cardinality="single" base-type="float" param-variable="false" math-variable="true"/>
    <qti-template-declaration identifier="sinB" cardinality="single" base-type="float" param-variable="false" math-variable="true"/>
    <qti-template-declaration identifier="fAns" cardinality="single" base-type="float" param-variable="false" math-variable="true"/>
    <qti-template-declaration identifier="fPiOver180" cardinality="single" base-type="float" param-variable="false" math-variable="true"/>

<!--This template variable holds a string which describes the triangle.-->
    <qti-template-declaration identifier="sType" cardinality="single" base-type="string" param-variable="false" math-variable="false"/>

<!--These template variables control the display of the templateInline and templateBlock elements.-->
    <qti-template-declaration base-type="identifier" cardinality="single" identifier="tSol"/>
    <qti-template-declaration base-type="identifier" cardinality="single" identifier="tSoli"/>
    <qti-template-processing>

<!-- now do the randomisation and mathematical calculations -->
<!-- The value of iA is selected randomly from a list of possible values of which several are 90 -->
    <qti-set-template-value identifier="iA">
            <qti-random>
                <qti-multiple>
                    <qti-base-value base-type="integer">45</qti-base-value>
                    <qti-base-value base-type="integer">60</qti-base-value>
                    <qti-base-value base-type="integer">75</qti-base-value>
                    <qti-base-value base-type="integer">90</qti-base-value>
                    <qti-base-value base-type="integer">90</qti-base-value>
                    <qti-base-value base-type="integer">90</qti-base-value>
                </qti-multiple>
            </qti-random>
    </qti-set-template-value>
    <qti-set-template-value identifier="iB">
            <qti-random-integer min="50" max="85" step="5"/>
    </qti-set-template-value>
    <qti-template-constraint>
            <qti-not>
                <qti-equal tolerance-mode="exact">
                    <qti-variable identifier="iA"/>
                    <qti-variable identifier="iB"/>
                </qti-equal>
            </qti-not>
    </qti-template-constraint>
    <qti-set-template-value identifier="ia">
            <qti-random-integer min="5" max="50"/>
    </qti-set-template-value>
    <qti-set-template-value identifier="fPiOver180">
            <qti-divide>
                <qti-math-constant name="pi"/>
                <qti-base-value base-type="integer">180</qti-base-value>
            </qti-divide>
    </qti-set-template-value>
    <qti-set-template-value identifier="sinA">
            <qti-math-operator name="sin">
                <qti-product>
                    <qti-variable identifier="iA"/>
                    <qti-variable identifier="fPiOver180"/>
                </qti-product>
            </qti-math-operator>
    </qti-set-template-value>
    <qti-set-template-value identifier="sinB">
            <qti-math-operator name="sin">
                <qti-product>
                    <qti-variable identifier="iB"/>
                    <qti-variable identifier="fPiOver180"/>
                </qti-product>
            </qti-math-operator>
    </qti-set-template-value>
    <qti-set-template-value identifier="sinA">
            <qti-round-to rounding-mode="significantFigures" figures="5">
                <qti-variable identifier="sinA"/>
            </qti-round-to>
    </qti-set-template-value>
    <qti-set-template-value identifier="sinB">
            <qti-round-to rounding-mode="significantFigures" figures="5">
                <qti-variable identifier="sinB"/>
            </qti-round-to>
    </qti-set-template-value>
    <qti-set-template-value identifier="fAns">
            <qti-divide>
                <qti-product>
                    <qti-variable identifier="ia"/>
                    <qti-variable identifier="sinB"/>
                </qti-product>
                <qti-variable identifier="sinA"/>
            </qti-divide>
    </qti-set-template-value>
    <qti-set-template-value identifier="fAns">
            <qti-round-to rounding-mode="significantFigures" figures="3">
                <qti-variable identifier="fAns"/>
            </qti-round-to>
    </qti-set-template-value>

<!-- set up alternative content depending on the value of variable iA -->
        <qti-template-condition>
            <qti-template-if>
                <qti-equal tolerance-mode="exact">

                    <!--If iA is 90, sType contains “right angled”, tSol contains the identifier, SolRightAngle, of the 
                        templateBlock for the right angle case, and tSoli contains the identifier, SolRightAnglei, of the 
                        templateInline for the right angle case-->

                    <qti-variable identifier="iA"/>
                    <qti-base-value base-type="integer">90</qti-base-value>
                </qti-equal>
                <qti-set-template-value identifier="sType">
                    <qti-base-value base-type="string">right angle</qti-base-value>
                </qti-set-template-value>
                <qti-set-template-value identifier="tSol">
                    <qti-base-value base-type="identifier">SolRightAngle</qti-base-value>
                </qti-set-template-value>
                <qti-set-template-value identifier="tSoli">
                    <qti-base-value base-type="identifier">SolRightAnglei</qti-base-value>
                </qti-set-template-value>
            </qti-template-if>
            <qti-template-else>

<!--If iA is not 90, sType contains "scalene", tSol contains the identifier, SolScalene, 
of the templateBlock for the scalene case, and tSoli contains the identifier, SolScalenei, 
of the templateInline for the scalene case-->

                <qti-set-template-value identifier="sType">
                    <qti-base-value base-type="string">scalene</qti-base-value>
                </qti-set-template-value>
                <qti-set-template-value identifier="tSol">
                    <qti-base-value base-type="identifier">SolScalene</qti-base-value>
                </qti-set-template-value>
                <qti-set-template-value identifier="tSoli">
                    <qti-base-value base-type="identifier">SolScalenei</qti-base-value>
                </qti-set-template-value>
            </qti-template-else>
        </qti-template-condition>
  </qti-template-processing>
    
  <qti-item-body>
    <p>In triangle ABC, side a=<qti-printed-variable identifier="ia"/>, 
    angle A=<qti-printed-variable identifier="iA"/> ° and 
    angle B=<qti-printed-variable identifier="iB"/> °. 
    Find the length of side b.</p>
    <div class="qti-margin-b-3">
      <p>Enter your answer to 3 significant figures.</p>
      <qti-text-entry-interaction response-identifier="RESPONSE1" expected-length="20"/>
    </div>
    <div>
      <qti-feedback-inline id="feedbackInline3" show-hide="show" outcome-identifier="FEEDBACK" 
      identifier="Correct"> OK </qti-feedback-inline>
    </div>
    <div>
      <qti-feedback-inline id="feedbackInline2" show-hide="show" outcome-identifier="FEEDBACK" 
      identifier="Partial"> Not far off - check your rounding... </qti-feedback-inline>
    </div>
    <div>
      <qti-feedback-inline id="feedbackInline1" show-hide="show" outcome-identifier="FEEDBACK" 
      identifier="Incorrect"> Incorrect </qti-feedback-inline>
    </div>
    <div>
      <qti-feedback-block id="feedbackBlock11" identifier="THREETRIES" outcome-identifier="FEEDBACK" 
      show-hide="show">
        <qti-content-body>
            <p> You have had three attempts at answering this question, so here is the solution:</p>
        </qti-content-body>
      </qti-feedback-block>

<!-- this feedbackBlock contains the solution, 
  which is different depending on the value of iA -->
      <qti-feedback-block identifier="SOLUTION" outcome-identifier="FEEDBACK" show-hide="show">
        <qti-content-body>
<!--Parts of this sentence appear differently, depending on whether or not iA is 90. 
The template variables sType, tSol and tSoli were set during template processing in the 
templateCondition shown above-->
          <p>This is a <qti-printed-variable identifier="sType"/> triangle, so
            <qti-template-inline template-identifier="tSoli" identifier="SolRightAnglei" show-hide="show">
                <span> we can use sin(B) to find b directly</span>
            </qti-template-inline>
            <qti-template-inline template-identifier="tSoli" identifier="SolScalenei" show-hide="show">
                <span> we apply the Sine Rule</span>
            </qti-template-inline>:
          </p>
<!--The templateBlock elements contain the MathML for the two different solutions: SolRightAngle for iA=90 and 
SolScalene for other values of iA-->
        <qti-template-block template-identifier="tSol" identifier="SolRightAngle" show-hide="show">
            <qti-content-body>
                <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
                    <semantics>
                        <mtable>
                            <mtr>
                                <mtd columnalign="right">
                                    <mrow>
                                        <mi>sin</mi>
                                        <mfenced close=")">
                                            <mi>B</mi>
                                        </mfenced>
                                    </mrow>
                                </mtd>
                                <mtd columnalign="center">
                                    <mo>=</mo>
                                </mtd>
                                <mtd columnalign="left">
                                    <mfrac>
                                        <mi>b</mi>
                                        <mi>a</mi>
                                    </mfrac>
                                </mtd>
                            </mtr>
                            <mtr>
                                <mtd columnalign="right">
                                    <mi>b</mi>
                                </mtd>
                                <mtd columnalign="center">
                                    <mo>=</mo>
                                </mtd>
                                <mtd columnalign="left">
                                    <mi>a</mi>
                                    <mrow>
                                        <mi>sin</mi>
                                        <mfenced close=")">
                                            <mi>B</mi>
                                        </mfenced>
                                    </mrow>
                                </mtd>
                            </mtr>
                            <mtr>
                                <mtd columnalign="right">
                                    <mi>b</mi>
                                </mtd>
                                <mtd columnalign="center">
                                    <mo>=</mo>
                                </mtd>
                                <mtd columnalign="left">
                                    <mrow>
                                        <mi>ia</mi>
                                        <mo>×</mo>
                                        <mi>sin</mi>
                                        <mfenced close=")">
                                            <mi>iB</mi>
                                        </mfenced>
                                    </mrow>
                                </mtd>
                            </mtr>
                            <mtr>
                                <mtd columnalign="right"/>
                                <mtd columnalign="center">
                                    <mo>=</mo>
                                </mtd>
                                <mtd columnalign="left">
                                    <mi>fAns</mi>
                                </mtd>
                            </mtr>
                        </mtable>
                    </semantics>
                </math>

            </qti-content-body>
        </qti-template-block>
        <qti-template-block template-identifier="tSol" identifier="SolScalene" show-hide="show">
            <qti-content-body>
                <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
                    <semantics>
                        <mtable>
                            <mtr>
                                <mtd columnalign="right">
                                    <mfrac>
                                        <mi>a</mi>
                                        <mrow>
                                            <mi>sin</mi>
                                            <mfenced close=")">
                                                <mi>A</mi>
                                            </mfenced>
                                        </mrow>
                                    </mfrac>
                                </mtd>
                                <mtd columnalign="center">
                                    <mo>=</mo>
                                </mtd>
                                <mtd columnalign="left">
                                    <mfrac>
                                        <mi>b</mi>
                                        <mrow>
                                            <mi>sin</mi>
                                            <mfenced close=")">
                                                <mi>B</mi>
                                            </mfenced>
                                        </mrow>
                                    </mfrac>
                                </mtd>
                            </mtr>
                            <mtr>
                                <mtd columnalign="right">
                                    <mfrac>
                                        <mi>ia</mi>
                                        <mrow>
                                            <mi>sin</mi>
                                            <mfenced close=")">
                                                <mi>iA</mi>
                                            </mfenced>
                                        </mrow>
                                    </mfrac>
                                </mtd>
                                <mtd columnalign="center">
                                    <mo>=</mo>
                                </mtd>
                                <mtd columnalign="left">
                                    <mfrac>
                                        <mi>b</mi>
                                        <mrow>
                                            <mi>sin</mi>
                                            <mfenced close=")">
                                                <mi>iB</mi>
                                            </mfenced>
                                        </mrow>
                                    </mfrac>
                                </mtd>
                            </mtr>
                            <mtr>
                                <mtd columnalign="right">
                                    <mi>b</mi>
                                </mtd>
                                <mtd columnalign="center">
                                    <mo>=</mo>
                                </mtd>
                                <mtd columnalign="left">
                                    <mfrac>
                                        <mrow>
                                            <mi>ia</mi>
                                            <mo>×</mo>
                                            <mi>sin</mi>
                                            <mfenced close=")">
                                                <mi>iB</mi>
                                            </mfenced>
                                        </mrow>
                                        <mrow>
                                            <mi>sin</mi>
                                            <mfenced close=")">
                                                <mi>iA</mi>
                                            </mfenced>
                                        </mrow>
                                    </mfrac>
                                </mtd>
                            </mtr>
                            <mtr>
                                <mtd columnalign="right"/>
                                <mtd columnalign="center">
                                    <mo>=</mo>
                                </mtd>
                                <mtd columnalign="left">
                                    <mfrac>
                                        <mrow>
                                            <mi>ia</mi>
                                            <mo>×</mo>
                                            <mi>sinB</mi>
                                        </mrow>
                                        <mrow>
                                            <mi>sinA</mi>
                                        </mrow>
                                    </mfrac>
                                </mtd>
                            </mtr>
                            <mtr>
                                <mtd columnalign="right"/>
                                <mtd columnalign="center">
                                    <mo>=</mo>
                                </mtd>
                                <mtd columnalign="left">
                                    <mi>fAns</mi>
                                </mtd>
                            </mtr>
                        </mtable>
                    </semantics>
                </math>
            </qti-content-body>
        </qti-template-block>

<!--This sentence is the same for all values of iA-->
          <p>So the expected answer is <qti-printed-variable identifier="fAns"/>.</p>
        </qti-content-body>
      </qti-feedback-block>
    </div>

<!-- Explain why the score is zero (after viewing solution) -->
    <qti-feedback-block identifier="SEEN-SOLUTION" outcome-identifier="FEEDBACK" show-hide="show">
      <qti-content-body>
        <p> Since you have viewed the solution, your score for this question will be 0. </p>
      </qti-content-body>
    </qti-feedback-block> 

<!-- show the solution button -->
    <qti-feedback-block identifier="asksolution" outcome-identifier="ASKSOLUTION" show-hide="show">
      <qti-content-body>
        <div>
            <qti-end-attempt-interaction id="endAttemptInteraction2" response-identifier="SOLREQUEST" 
            title="Show Solution"/>
        </div>
      </qti-content-body>
    </qti-feedback-block>

  </qti-item-body>

  <qti-response-processing>
    <qti-set-outcome-value identifier="FEEDBACK">
    <qti-multiple>
        <qti-variable identifier="EMPTY"/>
    </qti-multiple>
    </qti-set-outcome-value>
  <qti-response-condition>
  <qti-response-if>
      <qti-variable identifier="SOLREQUEST"/>
      <qti-set-outcome-value identifier="FEEDBACK">
          <qti-multiple>
              <qti-base-value base-type="identifier">SOLUTION</qti-base-value>
          </qti-multiple>
      </qti-set-outcome-value>
      <qti-set-outcome-value identifier="seenSolution">
          <qti-base-value base-type="boolean">true</qti-base-value>
      </qti-set-outcome-value>
      <qti-set-outcome-value identifier="completionStatus">
          <qti-base-value base-type="identifier">completed</qti-base-value>
      </qti-set-outcome-value>
      <qti-set-outcome-value identifier="ASKSOLUTION">
          <qti-base-value base-type="identifier">null</qti-base-value>
      </qti-set-outcome-value>
  </qti-response-if>
  <qti-response-else>
      <qti-response-condition>
          <qti-response-if>
              <qti-is-null>
                  <qti-variable identifier="RESPONSE1"/>
              </qti-is-null>
              <qti-set-outcome-value identifier="SCORE">
                  <qti-base-value base-type="float">0</qti-base-value>
              </qti-set-outcome-value>
          </qti-response-if>
          <qti-response-else>
              <qti-response-condition>
                  <qti-response-if>
                      <qti-equal-rounded rounding-mode="significantFigures" figures="3">
                          <qti-variable identifier="fAns"/>
                          <qti-variable identifier="RESPONSE1"/>
                      </qti-equal-rounded>
                      <qti-set-outcome-value identifier="FEEDBACK">
                          <qti-multiple>
                              <qti-base-value base-type="identifier">Correct</qti-base-value>
                          </qti-multiple>
                      </qti-set-outcome-value>
                      <qti-set-outcome-value identifier="SCORE">
                          <qti-base-value base-type="float">10.0</qti-base-value>
                      </qti-set-outcome-value>
                  </qti-response-if>
                  <qti-response-else-if>
                      <qti-equal-rounded rounding-mode="significantFigures" figures="2">
                          <qti-variable identifier="RESPONSE1"/>
                          <qti-variable identifier="fAns"/>
                      </qti-equal-rounded>
                      <qti-set-outcome-value identifier="FEEDBACK">
                          <qti-multiple>
                              <qti-base-value base-type="identifier">Partial</qti-base-value>
                          </qti-multiple>
                      </qti-set-outcome-value>
                      <qti-set-outcome-value identifier="SCORE">
                          <qti-base-value base-type="float">5.0</qti-base-value>
                      </qti-set-outcome-value>
                  </qti-response-else-if>
                  <qti-response-else>
                      <qti-set-outcome-value identifier="FEEDBACK">
                          <qti-multiple>
                              <qti-base-value base-type="identifier">Incorrect</qti-base-value>
                          </qti-multiple>
                      </qti-set-outcome-value>
                      <qti-set-outcome-value identifier="SCORE">
                          <qti-base-value base-type="float">0.0</qti-base-value>
                      </qti-set-outcome-value>
                  </qti-response-else>
              </qti-response-condition>
              <qti-response-condition>
                  <qti-response-if>
                      <qti-gt>
                          <qti-variable identifier="numAttempts"/>
                          <qti-base-value base-type="integer">3</qti-base-value>
                      </qti-gt>
                      <qti-set-outcome-value identifier="FEEDBACK">
                          <qti-multiple>
                              <qti-base-value base-type="identifier">THREETRIES</qti-base-value>
                              <qti-base-value base-type="identifier">SOLUTION</qti-base-value>
                          </qti-multiple>
                      </qti-set-outcome-value>

                      <!-- completionStatus must be specifically set to completed in adaptive questions -->

                      <qti-set-outcome-value identifier="completionStatus">
                          <qti-base-value base-type="identifier">completed</qti-base-value>
                      </qti-set-outcome-value>
                      <qti-set-outcome-value identifier="ASKSOLUTION">
                          <qti-base-value base-type="identifier">null</qti-base-value>
                      </qti-set-outcome-value>
                  </qti-response-if>
              </qti-response-condition>
              <qti-response-condition>
                  <qti-response-if>
                      <qti-variable identifier="seenSolution"/>
                      <qti-set-outcome-value identifier="FEEDBACK">
                          <qti-multiple>
                              <qti-variable identifier="FEEDBACK"/>
                              <qti-base-value base-type="identifier">SEEN-SOLUTION</qti-base-value>
                          </qti-multiple>
                      </qti-set-outcome-value>
                      <qti-set-outcome-value identifier="SCORE">
                          <qti-base-value base-type="float">0.0</qti-base-value>
                      </qti-set-outcome-value>
                  </qti-response-if>
            </qti-response-condition>
          </qti-response-else>
        </qti-response-condition>
      </qti-response-else>
    </qti-response-condition>
  </qti-response-processing>
</qti-assessment-item>

Adaptive Example 5 – Using qti-feedback-block to change the appearance of a question

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<qti-assessment-item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation=" http://www.imsglobal.org/xsd/imsqtiasi_v3p0
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
  xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" xmlns:xi="http://www.w3.org/2001/XInclude"
  xmlns:m="http://www.w3.org/1998/Math/MathML" identifier="Example05-feedbackBlock-adaptive"
  title="Adaptive - choice of input type" time-dependent="false" adaptive="true" xml:lang="en">

  <qti-response-declaration identifier="RESPONSE1" cardinality="single" base-type="identifier" />
  <qti-response-declaration identifier="RESPONSE21" cardinality="single" base-type="identifier">
    <qti-correct-response>
      <qti-value>OPTION210</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-response-declaration identifier="RESPONSE22" cardinality="single" base-type="identifier">
    <qti-correct-response>
      <qti-value>OPTION221</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-response-declaration identifier="RESPONSE23" cardinality="single" base-type="identifier">
    <qti-correct-response>
      <qti-value>OPTION231</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-response-declaration identifier="RESPONSE24" cardinality="single" base-type="identifier">
    <qti-correct-response>
      <qti-value>OPTION241</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-response-declaration identifier="RESPONSE25" cardinality="single" base-type="string">
    <qti-correct-response>
      <qti-value>cooks</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-response-declaration identifier="RESPONSE26" cardinality="single" base-type="string">
    <qti-correct-response>
      <qti-value>spoil</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-response-declaration identifier="RESPONSE27" cardinality="single" base-type="string">
    <qti-correct-response>
      <qti-value>broth</qti-value>
    </qti-correct-response>
  </qti-response-declaration>

  <qti-outcome-declaration base-type="float" cardinality="single" identifier="SCORE" normal-maximum="10.0"
    normal-minimum="0.0">
    <qti-default-value>
      <qti-value>0.0</qti-value>
    </qti-default-value>
  </qti-outcome-declaration>
  <qti-outcome-declaration base-type="identifier" cardinality="single" identifier="FEEDBACK" />

  <!--Define a feedback variable; its cardinality is "multiple" so that it can contain the 
  identifiers of several feedback elements, and in this case it is initialised to the identifier,
  part1, of the first part of this adaptive question-->
  <qti-outcome-declaration base-type="identifier" cardinality="multiple" identifier="BODY">
    <qti-default-value>
      <qti-value>part1</qti-value>
    </qti-default-value>
  </qti-outcome-declaration>

  <qti-item-body class="">
    <div class="">
<!--This feedbackBlock is the first part of this adaptive question to appear, since the BODY variable 
  initially contains its identifier, part1; it contains the first multiple choice interaction in this question.
  When BODY is set to part2, this feedbackBlock is no longer visible.-->
      <qti-feedback-block id="feedbackBlock0" identifier="part1" outcome-identifier="BODY" show-hide="show">
        <qti-content-body>
          <p>This is the first part of this question: Which of these input methods do you wish
            to use?</p>
          <qti-choice-interaction id="choiceInteraction0" max-choices="1" response-identifier="RESPONSE1"
            shuffle="true">
            <qti-simple-choice id="simpleChoice0" identifier="OPTION1">Multiple choice </qti-simple-choice>
            <qti-simple-choice id="simpleChoice1" identifier="OPTION2">Drop-down menu </qti-simple-choice>
            <qti-simple-choice id="simpleChoice2" identifier="OPTION3">Typed input </qti-simple-choice>
          </qti-choice-interaction>
        </qti-content-body></qti-feedback-block>

<!--This feedbackBlock is the second part of the question; it appears when the BODY variable contains 
  its identifier,   part2. BODY is a multiple cardinality variable, so it can contain the identifiers of 
  several feedbackBlocks   (and feedbackInlines) at the same time, each of which is visible if their show 
  attribute is set to show, or hidden if their show attribute is set to hide.-->
      <qti-feedback-block identifier="part2" outcome-identifier="BODY" show-hide="show">
        <qti-content-body>
          <p>OK, this is the type of input you have chosen. Now please answer this, the second
            part of the question.</p>
        </qti-content-body>
      </qti-feedback-block>

<!--This feedbackBlock appears if the user chose to use multiple choice in the first part of the question – 
  it contains the selected type of interaction.-->
      <qti-feedback-block identifier="option1" outcome-identifier="BODY" show-hide="show">
        <qti-content-body>
          <p>Choose the correct saying:</p>
          <qti-choice-interaction max-choices="1" response-identifier="RESPONSE21" shuffle="true">
            <qti-simple-choice identifier="OPTION210">Too many cooks spoil the broth</qti-simple-choice>
            <qti-simple-choice identifier="OPTION211">Too many cooks burn the dinner</qti-simple-choice>
            <qti-simple-choice identifier="OPTION212">Too many children spill the broth</qti-simple-choice>
            <qti-simple-choice identifier="OPTION213">Too many hands spill the beans</qti-simple-choice>
            <qti-simple-choice identifier="OPTION214">Too many children spoil the broth</qti-simple-choice>
          </qti-choice-interaction>
        </qti-content-body>
      </qti-feedback-block>

<!--This feedbackBlock appears if the user chose to use drop-down menus in the first part of the question – 
  it contains the selected type of interaction.-->
      <qti-feedback-block identifier="option2" outcome-identifier="BODY" show-hide="show">
        <qti-content-body>
          <p class="">Complete the saying below by selecting from the lists:</p>
          <p class="">Too many 
            <qti-inline-choice-interaction response-identifier="RESPONSE22" shuffle="true">
              <qti-inline-choice identifier="OPTION221">cooks</qti-inline-choice>
              <qti-inline-choice identifier="OPTION222">children</qti-inline-choice>
              <qti-inline-choice identifier="OPTION223">hands</qti-inline-choice>
            </qti-inline-choice-interaction> 
            <qti-inline-choice-interaction response-identifier="RESPONSE23" shuffle="true">
              <qti-inline-choice identifier="OPTION231">spoil</qti-inline-choice>
              <qti-inline-choice identifier="OPTION232">spill</qti-inline-choice>
              <qti-inline-choice identifier="OPTION233">burn</qti-inline-choice>
            </qti-inline-choice-interaction> the 
            <qti-inline-choice-interaction response-identifier="RESPONSE24" shuffle="true">
              <qti-inline-choice identifier="OPTION241">broth</qti-inline-choice>
              <qti-inline-choice identifier="OPTION242">dinner</qti-inline-choice>
              <qti-inline-choice identifier="OPTION243">beans</qti-inline-choice>
            </qti-inline-choice-interaction>.
          </p>
        </qti-content-body>
      </qti-feedback-block>

<!--This feedbackBlock appears if the user chose to type answers in text boxes in the first part 
of the question – it contains the selected type of interaction.-->
      <qti-feedback-block identifier="option3" outcome-identifier="BODY" show-hide="show">
        <qti-content-body>
          <p class="">Complete the saying below:</p>
          <p class="">Too many 
            <qti-text-entry-interaction expected-length="20" response-identifier="RESPONSE25" /> 
            <qti-text-entry-interaction expected-length="20" response-identifier="RESPONSE26" /> the 
            <qti-text-entry-interaction expected-length="20" response-identifier="RESPONSE27" />.
          </p>
        </qti-content-body>
      </qti-feedback-block>
      <div>
<!--These feedbackInline elements provide feedback on the input given by the user in the 
second part of the question.-->
        <qti-feedback-inline id="feedbackInline1" identifier="CORRECT" outcome-identifier="FEEDBACK" show-hide="show">
          That's the correct answer. </qti-feedback-inline>
        <qti-feedback-inline id="feedbackInline2" identifier="PARTIAL" outcome-identifier="FEEDBACK" show-hide="show">
          Your answer is partially correct; the correct answer is "Too many <b>cooks</b>
          <b>spoil</b> the <b>broth</b>". </qti-feedback-inline>
        <qti-feedback-inline id="feedbackInline3" identifier="INCORRECT" outcome-identifier="FEEDBACK" show-hide="show">
          Sorry, that's not correct; the correct answer is "Too many <b>cooks</b>
          <b>spoil</b> the <b>broth</b>". </qti-feedback-inline>
      </div>
    </div>
  </qti-item-body>

  <qti-response-processing>
    <qti-response-condition>
      <qti-response-if>
        <qti-member>
<!--Check whether "part1" is contained in the BODY variable, and if it is, 
set up the second part of thequestion.-->
          <qti-base-value base-type="identifier">part1</qti-base-value>
          <qti-variable identifier="BODY" />
        </qti-member>
        <qti-set-outcome-value identifier="BODY">
          <qti-multiple>
<!--Put "part2" into the BODY variable.-->
            <qti-base-value base-type="identifier">part2</qti-base-value>
          </qti-multiple>
        </qti-set-outcome-value>
        <qti-response-condition>
          <qti-response-if>
            <qti-match>
              <qti-variable identifier="RESPONSE1" />
<!--If the user selected OPTION1 (MCQ) put the identifier, option1, 
of the feedbackBlock containing the second MCQ into BODY .-->
              <qti-base-value base-type="identifier">OPTION1</qti-base-value>
            </qti-match>
            <qti-set-outcome-value identifier="BODY">
              <qti-multiple>
                <qti-variable identifier="BODY" />
                <qti-base-value base-type="identifier">option1</qti-base-value>
              </qti-multiple>
            </qti-set-outcome-value>
          </qti-response-if>
          <qti-response-else-if>
            <qti-match>
              <qti-variable identifier="RESPONSE1" />
<!--If the user selected OPTION2 (drop-down menus) put the identifier, option2, 
of the feedbackBlock containing the drop-down menus into BODY .-->
              <qti-base-value base-type="identifier">OPTION2</qti-base-value>
            </qti-match>
            <qti-set-outcome-value identifier="BODY">
              <qti-multiple>
                <qti-variable identifier="BODY" />
                <qti-base-value base-type="identifier">option2</qti-base-value>
              </qti-multiple>
            </qti-set-outcome-value>
          </qti-response-else-if>
          <qti-response-else-if>
            <qti-match>
              <qti-variable identifier="RESPONSE1" />
<!--If the user selected OPTION3 (text input) put the identifier, option3, 
of the feedbackBlock containing the text boxes into BODY .-->
              <qti-base-value base-type="identifier">OPTION3</qti-base-value>
            </qti-match>
            <qti-set-outcome-value identifier="BODY">
              <qti-multiple>
                <qti-variable identifier="BODY" />
                <qti-base-value base-type="identifier">option3</qti-base-value>
              </qti-multiple>
            </qti-set-outcome-value>
          </qti-response-else-if>
        </qti-response-condition>
      </qti-response-if>
      <qti-response-else-if>
        <qti-member>
<!--If BODY contains part2, the second part of the question has been displayed, 
so we process the user’s input to the chosen interaction.-->
          <qti-base-value base-type="identifier">part2</qti-base-value>
          <qti-variable identifier="BODY" />
        </qti-member>
        <qti-response-condition>
          <qti-response-if>
            <qti-member>
              <qti-base-value base-type="identifier">option1</qti-base-value>
              <qti-variable identifier="BODY" />
            </qti-member>
            <qti-response-condition>
              <qti-response-if>
                <qti-match>
                  <qti-variable identifier="RESPONSE21" />
                  <qti-correct identifier="RESPONSE21" />
                </qti-match>
                <qti-set-outcome-value identifier="FEEDBACK">
                  <qti-base-value base-type="identifier">CORRECT</qti-base-value>
                </qti-set-outcome-value>
                <qti-set-outcome-value identifier="SCORE">
                  <qti-base-value base-type="float">10.0</qti-base-value>
                </qti-set-outcome-value>
              </qti-response-if>
              <qti-response-else>
                <qti-set-outcome-value identifier="FEEDBACK">
                  <qti-base-value base-type="identifier">INCORRECT</qti-base-value>
                </qti-set-outcome-value>
                <qti-set-outcome-value identifier="SCORE">
                  <qti-base-value base-type="float">0.0</qti-base-value>
                </qti-set-outcome-value>
              </qti-response-else>
            </qti-response-condition>
          </qti-response-if>
          <qti-response-else-if>
            <qti-member>
              <qti-base-value base-type="identifier">option2</qti-base-value>
              <qti-variable identifier="BODY" />
            </qti-member>
            <qti-response-condition>
              <qti-response-if>
                <qti-and>
                  <qti-match>
                    <qti-variable identifier="RESPONSE22" />
                    <qti-correct identifier="RESPONSE22" />
                  </qti-match>
                  <qti-match>
                    <qti-variable identifier="RESPONSE23" />
                    <qti-correct identifier="RESPONSE23" />
                  </qti-match>
                  <qti-match>
                    <qti-variable identifier="RESPONSE24" />
                    <qti-correct identifier="RESPONSE24" />
                  </qti-match>
                </qti-and>
                <qti-set-outcome-value identifier="FEEDBACK">
                  <qti-base-value base-type="identifier">CORRECT</qti-base-value>
                </qti-set-outcome-value>
                <qti-set-outcome-value identifier="SCORE">
                  <qti-base-value base-type="float">10.0</qti-base-value>
                </qti-set-outcome-value>
              </qti-response-if>
              <qti-response-else-if>
                <qti-or>
                  <qti-match>
                    <qti-variable identifier="RESPONSE22" />
                    <qti-correct identifier="RESPONSE22" />
                  </qti-match>
                  <qti-match>
                    <qti-variable identifier="RESPONSE23" />
                    <qti-correct identifier="RESPONSE23" />
                  </qti-match>
                  <qti-match>
                    <qti-variable identifier="RESPONSE24" />
                    <qti-correct identifier="RESPONSE24" />
                  </qti-match>
                </qti-or>
                <qti-set-outcome-value identifier="FEEDBACK">
                  <qti-base-value base-type="identifier">PARTIAL</qti-base-value>
                </qti-set-outcome-value>
                <qti-set-outcome-value identifier="SCORE">
                  <qti-base-value base-type="float">5.0</qti-base-value>
                </qti-set-outcome-value>
              </qti-response-else-if>
              <qti-response-else>
                <qti-set-outcome-value identifier="FEEDBACK">
                  <qti-base-value base-type="identifier">INCORRECT</qti-base-value>
                </qti-set-outcome-value>
                <qti-set-outcome-value identifier="SCORE">
                  <qti-base-value base-type="float">0.0</qti-base-value>
                </qti-set-outcome-value>
              </qti-response-else>
            </qti-response-condition>
          </qti-response-else-if>
          <qti-response-else-if>
            <qti-member>
              <qti-base-value base-type="identifier">option3</qti-base-value>
              <qti-variable identifier="BODY" />
            </qti-member>
            <qti-response-condition>
              <qti-response-if>
                <qti-and>
                  <qti-match>
                    <qti-variable identifier="RESPONSE25" />
                    <qti-correct identifier="RESPONSE25" />
                  </qti-match>
                  <qti-match>
                    <qti-variable identifier="RESPONSE26" />
                    <qti-correct identifier="RESPONSE26" />
                  </qti-match>
                  <qti-match>
                    <qti-variable identifier="RESPONSE27" />
                    <qti-correct identifier="RESPONSE27" />
                  </qti-match>
                </qti-and>
                <qti-set-outcome-value identifier="FEEDBACK">
                  <qti-base-value base-type="identifier">CORRECT</qti-base-value>
                </qti-set-outcome-value>
                <qti-set-outcome-value identifier="SCORE">
                  <qti-base-value base-type="float">10.0</qti-base-value>
                </qti-set-outcome-value>
              </qti-response-if>
              <qti-response-else-if>
                <qti-or>
                  <qti-match>
                    <qti-variable identifier="RESPONSE25" />
                    <qti-correct identifier="RESPONSE25" />
                  </qti-match>
                  <qti-match>
                    <qti-variable identifier="RESPONSE26" />
                    <qti-correct identifier="RESPONSE26" />
                  </qti-match>
                  <qti-match>
                    <qti-variable identifier="RESPONSE27" />
                    <qti-correct identifier="RESPONSE27" />
                  </qti-match>
                </qti-or>
                <qti-set-outcome-value identifier="FEEDBACK">
                  <qti-base-value base-type="identifier">PARTIAL</qti-base-value>
                </qti-set-outcome-value>
                <qti-set-outcome-value identifier="SCORE">
                  <qti-base-value base-type="float">5.0</qti-base-value>
                </qti-set-outcome-value>
              </qti-response-else-if>
              <qti-response-else>
                <qti-set-outcome-value identifier="FEEDBACK">
                  <qti-base-value base-type="identifier">INCORRECT</qti-base-value>
                </qti-set-outcome-value>
                <qti-set-outcome-value identifier="SCORE">
                  <qti-base-value base-type="float">0.0</qti-base-value>
                </qti-set-outcome-value>
              </qti-response-else>
            </qti-response-condition>
          </qti-response-else-if>
        </qti-response-condition>
<!-- completionStatus must be specifically set to completed in adaptive questions -->
        <qti-set-outcome-value identifier="completionStatus">
          <qti-base-value base-type="identifier">completed</qti-base-value>
        </qti-set-outcome-value>
      </qti-response-else-if>
    </qti-response-condition>
  </qti-response-processing>
</qti-assessment-item>

In this example, the "feedback" forms part of the question. In adaptive questions, feedbackBlock and feedbackInline elements can contain interactions:

Monty Hall (Take 1)

Section 3.8.3 - Annotated Item Examples - Monty Hall (Take 1)

This example takes a famous mathematical problem and presents it to the user as a game. The qti-feedback-block  element, in association with a number of outcome variables is used to control the flow of the story, from the opening gambit through to whether or not you have won a prize. When the story concludes you are asked about the strategy you adopted. Notice that the scoring for the question is based on the actual strategy you took (one mark) and your answer to the final question (two marks). If you choose a bad strategy initially you are always punished by losing the game. If you feel that this is cheating take a look at a more realistic version of the same question which combines adaptivity with the powerful feature of item templates: Monty Hall (Take 2).

Items with Hints

See the example in the End Attempt Interaction section, where the item is extended to provide both feedback and the option of requesting a hint. The qti-end-attempt-interaction controls the value of the response variable HINTREQUEST - which is true if the attempt ended with a request for a hint and false otherwise.

3.7.3 Feedback

Feedback consists of material presented to the candidate conditionally, based on the values of outcome variables, allowing an item to be reconfigured as a result of Response Processing . In other words, feedback is controlled by the values of outcome variables. There are several  types of feedback material:

  • Feedback blocks ( qti-feedback-block) are shown to the candidate based on the value of an outcome variable.  Each feedback block is associated with an outcome variable and an identifier. If the outcome variable has that identifier as its value, then the feedback block is shown or hidden, as determined by the value of the show-hide attribute.  Feedback blocks may contain almost any valid qti-item-body content, including interactions and other feedback blocks. Feedback blocks may be used inside many interaction components, such as choices, and within HTML5 elements, such as div.   After each attempt, following a round of response and outcome processing, the delivery engine re-computes the visibility of feedback blocks based on possibly new values of the controlling outcome variables.   By default, the changed state of feedback content is only shown during subsequent attempts on, or review of, an item.
  • Inline feedback ( qti-feedback-inline) is similar to block feedback, but may only be used in "inline" contexts. Inline feedback elements may only contain inline HTML5 content, such as span, and inline QTI interactions, such as qti-inline-choice-interaction, or qti-text-entry-interaction.
  • Modal feedback ( qti-modal-feedback) is item content which is shown to (or hidden from) the candidate based on the value of outcome variables, and whose display can be changed by response processing. Those display changes become visible before any subsequent attempt or review of the item. As with feedback blocks, the value of a controlling outcome variable is used in conjunction with the show-hide and identifier attributes to determine whether or not the feedback is presented. Unlike feedback blocks and inline feedback, the modal feedback element cannot contain any interactions, and may not be used inside an item body. Because modal feedback is not part of the item body, it may be displayed "modally" -- for example, as a pop-up "dialog box" which appears after response and outcome processing and which must be dismissed by the candidate after it is read.  However, how modal feedback is displayed is left to the delivery platform, and an implementation may simply display modal feedback in-line in the item, similar to other forms of feedback.
  • Test feedback ( qti-test-feedback) is allowed within qti-assessment-test and qti-test-part, and is otherwise very similar to modal feedback. Test feedback may be configured to be shown during the test or test part ( access="during"), or only when the candidate reaches the end of the test or test part ( access="atEnd").

Using qti-modal-feedback

In this example, a straightforward multi-choice question declares an additional outcome variable called FEEDBACK which is used to control the visibility of just qti-modal-feedback.

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
identifier="Example01-modalFeedback" title="Example 1 - modal feedback" 
adaptive="false" time-dependent="false" xml:lang="en" >
  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier">
    <!-- The response variable RESPONSE will hold the candidate's input-->
    <qti-correct-response>
      <!--The value of the right answer is declared-->
      <qti-value>true</qti-value>
    </qti-correct-response>
  </qti-response-declaration>

<!-- Define a feedback variable; its baseType is "identifier" so that it can contain 
        the identifier of the feedback message-->
  <qti-outcome-declaration identifier="FEEDBACK" cardinality="single" base-type="identifier" />
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"
      normal-maximum="10.0">
    <qti-default-value>
        <qti-value>0</qti-value>
    </qti-default-value>
  </qti-outcome-declaration>
  <qti-outcome-declaration identifier="MAXSCORE" cardinality="single" base-type="float">
    <qti-default-value>
        <qti-value>10.0</qti-value>
    </qti-default-value>
  </qti-outcome-declaration>

  <qti-item-body>
    <qti-choice-interaction response-identifier="RESPONSE" shuffle="false" max-choices="1">
      <qti-prompt>Sigmund Freud and Carl Jung both belong to the psychoanalytic school of
          psychology.</qti-prompt>
      <qti-simple-choice identifier="true" fixed="true">True </qti-simple-choice>
      <qti-simple-choice identifier="false" fixed="true">False </qti-simple-choice>
    </qti-choice-interaction>
  </qti-item-body>
  <qti-response-processing>
    <qti-response-condition>
      <qti-response-if>
        <qti-match>
            <!-- The value of RESPONSE is compared with the correct value identified 
                    in the RESPONSE declaration-->
              <qti-variable identifier="RESPONSE" />
              <qti-correct identifier="RESPONSE" />
        </qti-match>
        <qti-set-outcome-value identifier="SCORE">
            <qti-variable identifier="MAXSCORE" />
        </qti-set-outcome-value>
        <qti-set-outcome-value identifier="FEEDBACK">
            <qti-base-value base-type="identifier">correct</qti-base-value>
        </qti-set-outcome-value>
      </qti-response-if>
      <qti-response-else>
      <!--Depending on whether the input matches the correct answer or not, FEEDBACK 
                    is given the value of the identifier of the appropriate feedback message-->
        <qti-set-outcome-value identifier="FEEDBACK">
            <qti-base-value base-type="identifier">incorrect</qti-base-value>
        </qti-set-outcome-value>
      </qti-response-else>
    </qti-response-condition>
  </qti-response-processing>
  
<!-- Note how the identifiers in the following modalFeedback elements match those of the 
        setOutcomeValue elements above -->

  <qti-modal-feedback outcome-identifier="FEEDBACK" show-hide="show" identifier="correct">
      <qti-content-body>correct</qti-content-body>
  </qti-modal-feedback>
  <qti-modal-feedback outcome-identifier="FEEDBACK" show-hide="show" identifier="incorrect">
      <qti-content-body>incorrect</qti-content-body>
  </qti-modal-feedback>

</qti-assessment-item>

Inline Feedback using qti-feedback-inline

In this example, the feedback appears within the question, right beside the text of the selected option. The content of qti-feedback-inline is restricted to material which can be displayed "inline", i.e. without moving to a new block or paragraph, so it behaves like the HTML "span" element.

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation=" http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd" 
xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
identifier="Example02-feedbackInline" title="Example 2 - inline feedback" 
adaptive="false" time-dependent="false" xml:lang="en" >

  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier">
      <qti-correct-response>
          <qti-value>true</qti-value>
      </qti-correct-response>
  </qti-response-declaration>

  <!-- Define a feedback variable; its base-type is "identifier" so that it can contain the identifier
         of the feedback message-->
  <qti-outcome-declaration identifier="FEEDBACK" cardinality="single" base-type="identifier"/>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float" normal-maximum="10.0">
      <qti-default-value>
          <qti-value>0</qti-value>
      </qti-default-value>
  </qti-outcome-declaration>
  <qti-outcome-declaration identifier="MAXSCORE" cardinality="single" base-type="float">
      <qti-default-value>
          <qti-value>10.0</qti-value>
      </qti-default-value>
  </qti-outcome-declaration>

  <qti-item-body>
    <!-- The response variable RESPONSE will hold the candidate's input-->
    <qti-choice-interaction response-identifier="RESPONSE" shuffle="false" max-choices="1">
        <qti-prompt>Sigmund Freud and Carl Jung both belong to the psychoanalytic school of
            psychology.</qti-prompt>
        <qti-simple-choice identifier="true" fixed="true">True 
    <!--The feedbackInline elements are each given the same identifier as the corresponding option.-->
          <qti-feedback-inline outcome-identifier="FEEDBACK" identifier="true" show-hide="show"><strong>That's correct</strong></qti-feedback-inline>
        </qti-simple-choice>
        <qti-simple-choice identifier="false" fixed="true">False 
        <qti-feedback-inline outcome-identifier="FEEDBACK" identifier="false" show-hide="show"><strong>That's not correct</strong></qti-feedback-inline>
        </qti-simple-choice>
      </qti-choice-interaction>
  </qti-item-body>

  <qti-response-processing>
<!--This time, FEEDBACK is given the value of the identifier of the option which was selected.-->
        <qti-set-outcome-value identifier="FEEDBACK">
            <qti-variable identifier="RESPONSE"/>
        </qti-set-outcome-value>
        <qti-response-condition>
            <qti-response-if>
                <qti-match>
                    <qti-variable identifier="RESPONSE"/>
                    <qti-correct identifier="RESPONSE"/>
                </qti-match>
                <qti-set-outcome-value identifier="SCORE">
                    <qti-variable identifier="MAXSCORE"/>
                </qti-set-outcome-value>
            </qti-response-if>
        </qti-response-condition>
    </qti-response-processing>
</qti-assessment-item>

3.7.4 Item Templates

Item Templates are items which function as templates that can be used for generating large numbers of related items. The generated items are often called "cloned items". Item templates can be used by special-purpose software, a so-called "cloning engine" to produce many clones of the template.

Where Delivery Engines support Template Processing, an Item Template can also be included directly in an assessment. At delivery time, the delivery engine will run the Template Processing in the item, giving the item's template variables values, and possibly computing new correct responses based upon the template variable values, effectively creating a single clone of the item template dynamically. In combination with the QTI selection element with the attribute with-replacement="true", a single Item Template in an assessment may be instantiated multiple times, and appear to the candidate as a different item each time, as a result of the Template Processing in the Item being run in each separate instance.

Each item cloned from an Item Template is identical except for the value, qti-default-value, and qti-correct-response value of the template, response, and outcome variables of the item, as assigned by the Template Processing.

An Assessment Item is therefore an Item Template if it contains a set of Template Processing rules for assigning values to the item variables. An Item Template will typically also have Template Declarations for template variables, although this is not mandatory. The state of the template, outcome, and response variables post-Template Processing is what distinguishes one clone of an item from another.

A cloning engine that creates cloned items must assign a different identifier to each clone and record the values of the template variables used to create it. A report of an item session with such a clone can then be transformed into an equivalent report for the original item template by substituting the item template'sidentifier for the cloned item's identifier and adding the values of the template variables to the report.

Item templating features may be used in combination with QTI adaptive and feedback features to provide items with varying paths through multiple interactions.

The main QTI features which support Item Templates include:

  • Template Variables.  Similar to response, outcome, and context variables, template variables are defined by the qti-template-declarationelement. The default values of template variables can be set in the declaration or by qti-template-defaultelements. The values may subsequently be changed via Template Processing.
  • Template Variable Defaults (qti-template-default).  While the default value of a template variable can be set using the qti-default-valueelement within the qti-template-declaration, in the same manner as with response and outcome declarations, the qti-template-default element may also be used to set the default value within an Assessment Item Reference at the Assessment Section level. This allows the default values of template variables, as specified within the item, to be overridden when an item is incorporated by reference into a particular assessment. The template default value can be given as an expression in the Template Processing domain-specific language.
  • Template Content(qti-template-block and qti-template-inline).  Conceptually similar to feedback blocks and inline feedback, template blocks and inline templates represent content which is shown to, or hidden from, the candidate based on the identifier and show-hide attributes of the template blocks and inline templates. Many of the interaction types also have subcomponents, such as hotspots or choices, which can be conditionally displayed (or hidden), using the same show-hide mechanism as template blocks and inline templates. This makes it possible, for example, to turn the choices in a Choice Interaction on or off via template variables.
  • Template Variable Expansion.  Printed variables (qti-printed-variable) may be used to display template variable values, just as they may be used with outcome and context variables. In addition, if a template variable has the math-variable="true" attribute, MathML mi and mo variables will be replaced with the value of the corresponding template variable. Similarly, if a template variable has the param-variable="true" attribute, param element values will be replaced with the corresponding template variables.
  • Template Processing (qti-template-processing).  Similar to response and outcome processing, template processing may be defined within an item to compute and set the values of template, response, and outcome variables. The delivery system will run the template processing rules immediately before the first attempt on an item, just prior to its initial presentation to the candidate. Following template processing and still before the initial presentation of the item, the delivery system will then determine the visibility of template blocks and inline templates, and do variable expansion on printed variables, MathML and param elements based on template variables.
  • Template Constraints (qti-template-constraint).  A template constraint is a processing rule available only in Template Processing. It terminates Template Processing and re-runs it from the beginning if the condition specified in the template constraint is not satisfied. This can be used, for example, to iterate the Template Processing with different randomly-generated values until a predetermined condition is satisfied.

The following examples demonstrate a variety of templating features.

Using Template Variables

This example contains a simpleqti-text-entry-interaction(TextEntryInteraction.Type) but the question (and the correct answer) varies for each item session. In addition to the usual RESPONSE and SCORE variables a number of template variables are declared. Their values are set by a set of TemplateProcessing rules. Template processing is very similar to response processing. The same condition model and expression language are used. The difference is that TemplateRules set the values of template variables and not outcome variables. Notice that the declaration of RESPONSE does not declare a value for the CorrectResponse because the answer varies depending on which values are chosen for A and B. Instead, a special rule is used, qti-set-correct-response in the template processing section.

The display of aqti-text-entry-interaction response can be formatted through the use of a format attribute using # for optional digits. For example, comma separators and a leading 0 for decimal entries can be displayed if format="#,##0.#". A response 12345678 would display as 12,345,678, but would be captured as entered - "12345678". A response .12345 would be captured as entered, but would display as 0.12345. A response 1.2345 would display and be captured as entered, 1.2345. See https://code.google.com/p/javascript-number-formatter/ for the basis of this feature.

The qti-random-integer element represents a simple expression that selects a random integer from a specified range. The qti-random element represents an operator that selects a random value from a container.

The qti-item-body displays the values of the template variables using the qti-printed-variable element.

<?xml version="1.0" encoding="UTF-8"?>
  <qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation=" http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
  https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd" 
  identifier="template_digging" title="Digging a Hole" 
  adaptive="false" time-dependent="false" xml:lang="en" >
    <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="float"/>
    <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float"/>
  
    <qti-template-declaration identifier="PEOPLE" cardinality="single" base-type="string" math-variable="false" param-variable="false"/>
    <qti-template-declaration identifier="A" cardinality="single" base-type="integer" math-variable="false" param-variable="false"/>
    <qti-template-declaration identifier="B" cardinality="single" base-type="integer" math-variable="false" param-variable="false"/>
    <qti-template-declaration identifier="MIN" cardinality="single" base-type="integer" math-variable="false" param-variable="false"/>
    
    <qti-template-processing>
      <qti-set-template-value identifier="PEOPLE">
        <qti-random>
          <qti-multiple>
            <qti-base-value base-type="string">men</qti-base-value>
            <qti-base-value base-type="string">women</qti-base-value>
            <qti-base-value base-type="string">children</qti-base-value>
          </qti-multiple>
        </qti-random>
      </qti-set-template-value>
      <qti-set-template-value identifier="A">
        <qti-random-integer min="2" max="4"/>
      </qti-set-template-value>
      <qti-template-condition>
        <qti-template-if>
          <qti-match>
            <qti-variable identifier="A"/>
            <qti-base-value base-type="integer">2</qti-base-value>
          </qti-match>
          <qti-set-template-value identifier="B">
            <qti-random-integer min="4" max="12" step="2"/>
          </qti-set-template-value>
        </qti-template-if>
        <qti-template-else-if>
          <qti-match>
            <qti-variable identifier="A"/>
            <qti-base-value base-type="integer">3</qti-base-value>
          </qti-match>
          <qti-set-template-value identifier="B">
            <qti-random>
              <qti-multiple>
                <qti-base-value base-type="integer">6</qti-base-value>
                <qti-base-value base-type="integer">12</qti-base-value>
              </qti-multiple>
            </qti-random>
          </qti-set-template-value>
        </qti-template-else-if>
        <qti-template-else>
          <qti-set-template-value identifier="B">
            <qti-random>
              <qti-multiple>
                <qti-base-value base-type="integer">8</qti-base-value>
                <qti-base-value base-type="integer">12</qti-base-value>
              </qti-multiple>
            </qti-random>
          </qti-set-template-value>
        </qti-template-else>
      </qti-template-condition>
      <qti-set-template-value identifier="MIN">
        <qti-integer-divide>
          <qti-base-value base-type="integer">120</qti-base-value>
          <qti-variable identifier="A"/>
        </qti-integer-divide>
      </qti-set-template-value>
      <qti-set-correct-response identifier="RESPONSE">
        <qti-integer-to-float>
          <qti-integer-divide>
            <qti-base-value base-type="integer">120</qti-base-value>
            <qti-variable identifier="B"/>
          </qti-integer-divide>
        </qti-integer-to-float>
      </qti-set-correct-response>
    </qti-template-processing>
  
    <qti-item-body>
      <p>If it takes <qti-printed-variable identifier="A"/>
      <qti-printed-variable identifier="PEOPLE"/>
      <qti-printed-variable identifier="MIN"/>
      minutes to dig a hole, how long would it take
      <qti-printed-variable identifier="B"/>
      <qti-printed-variable identifier="PEOPLE"/>
      to dig a similar hole?</p>
      <p>Answer: <qti-text-entry-interaction response-identifier="RESPONSE" expected-length="8"/> minutes.</p>
    </qti-item-body>
  
    <qti-response-processing 
    template="https://www.imsglobal.org/question/qti_v3p0/rptemplates/match_correct.xml"/>
  </qti-assessment-item>

Using a Template to Change an Image

Sometimes it is desirable to vary some aspect of an item that cannot be represented directly by the value of a template variable. For example, in "Mick's Travels", the qti-item-body contains an illustration that needs to be varied according to the value chosen for a template variable. To achieve this, three qti-template-inline elements are used, each one enclosing a different img element. This element (along with the similar qti-template-block ) has attributes for controlling its visibility with template variables in the same way as outcome variables are used to control the visibility of feedback.

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
  https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
  identifier="template_image" title="Mick's Travels" 
  adaptive="false" time-dependent="false" xml:lang="en" >

  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="integer" />
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float" />

  <qti-template-declaration identifier="TRANSPORT" cardinality="single" base-type="identifier"
    math-variable="false" param-variable="false" />
  <qti-template-declaration identifier="SPEED" cardinality="single" base-type="integer"
    math-variable="false" param-variable="false" />

  <qti-template-processing>
    <qti-set-template-value identifier="TRANSPORT">
      <qti-random>
        <qti-multiple>
          <qti-base-value base-type="identifier">plane</qti-base-value>
          <qti-base-value base-type="identifier">train</qti-base-value>
          <qti-base-value base-type="identifier">bus</qti-base-value>
        </qti-multiple>
      </qti-random>
    </qti-set-template-value>
    <qti-template-condition>
      <qti-template-if>
        <qti-match>
          <qti-variable identifier="TRANSPORT" />
          <qti-base-value base-type="identifier">plane</qti-base-value>
        </qti-match>
        <qti-set-template-value identifier="SPEED">
          <qti-base-value base-type="integer">600</qti-base-value>
        </qti-set-template-value>
      </qti-template-if>
      <qti-template-else-if>
        <qti-match>
          <qti-variable identifier="TRANSPORT" />
          <qti-base-value base-type="identifier">train</qti-base-value>
        </qti-match>
        <qti-set-template-value identifier="SPEED">
          <qti-base-value base-type="integer">200</qti-base-value>
        </qti-set-template-value>
      </qti-template-else-if>
      <qti-template-else>
        <qti-set-template-value identifier="SPEED">
          <qti-base-value base-type="integer">50</qti-base-value>
        </qti-set-template-value>
      </qti-template-else>
    </qti-template-condition>
    <qti-set-correct-response identifier="RESPONSE">
      <qti-product>
        <qti-base-value base-type="integer">3</qti-base-value>
        <qti-variable identifier="SPEED" />
      </qti-product>
    </qti-set-correct-response>
  </qti-template-processing>

  <qti-item-body>
  <!--Accessibility note: For QTI content, we assume the interface will have an h1, 
    so we start with h2 heading level within the item body-->
    <h2>Mick's Travels</h2>
    <p>
      <qti-template-inline template-identifier="TRANSPORT" show-hide="show" identifier="plane">
        <img src="images/plane.png" alt="Picture of a plane." />
      </qti-template-inline>
      <qti-template-inline template-identifier="TRANSPORT" show-hide="show" identifier="train">
        <img src="images/train.png" alt="Picture of a train" />
      </qti-template-inline>
      <qti-template-inline template-identifier="TRANSPORT" show-hide="show" identifier="bus">
        <img src="images/bus.png" alt="Picture of a bus" />
      </qti-template-inline>
    </p>

    <p>Mick travels at an average speed of <qti-printed-variable identifier="SPEED" /> km/h.</p>
    <p>How far does he travel in 3 hours? <qti-text-entry-interaction
        response-identifier="RESPONSE" expected-length="8" /> km.</p>
  </qti-item-body>

  <qti-response-processing
    template="https://www.imsglobal.org/question/qti_v3p0/rptemplates/match_correct.xml" />
</qti-assessment-item>

Item Templates Combined with Adaptive Items

In Monty Hall (Take 1) we cheated by fixing the game so that the wrong strategy always lost the candidate the prize (and the first mark). In Monty Hall (Take 2) we present a more realistic version of the game using an item template. The same outcome variables are defined to control the story and the feedback given but this time a qti-template-declaration is used to declare the variable PRIZEDOOR. The qti-template-processing rules are then used to preselect the winning door at random making the game more realistic. The qti-response-processing rules are a little more complicated as the value of PRIZEDOOR must be checked (a) to ensure that Monty doesn't open the prize winning door after the candidate's first choice and (b) to see if the candidate has actually won the "fantastic prize".

In this example, using the correct strategy will still lose the candidate the prize 1/3 of the time (though they always get the mark). Do you think that the outcome of the game will affect the response to the final strategy question?

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
  https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
  identifier="adaptiveTemplate" title="Monty Hall (Take 2)" 
  adaptive="true" time-dependent="false" xml:lang="en" >

  <qti-response-declaration identifier="DOOR" cardinality="single" base-type="identifier" />
  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier">
    <qti-correct-response>
      <qti-value>switchStrategy</qti-value>
    </qti-correct-response>
  </qti-response-declaration>

  <qti-outcome-declaration identifier="STORY" cardinality="single" base-type="identifier">
    <qti-default-value>
      <qti-value>openingGambit</qti-value>
    </qti-default-value>
  </qti-outcome-declaration>
  <qti-outcome-declaration identifier="FEEDBACK" cardinality="single" base-type="identifier" />
  <qti-outcome-declaration identifier="CLOSED" cardinality="multiple" base-type="identifier">
    <qti-default-value>
      <qti-value>DoorA</qti-value>
      <qti-value>DoorB</qti-value>
      <qti-value>DoorC</qti-value>
    </qti-default-value>
  </qti-outcome-declaration>
  <qti-outcome-declaration identifier="GOATS" cardinality="multiple" base-type="identifier" />
  <qti-outcome-declaration identifier="PRIZE" cardinality="single" base-type="identifier" />
  <qti-outcome-declaration identifier="FIRSTDOOR" cardinality="single" base-type="identifier" />
  <qti-outcome-declaration identifier="REVEALED" cardinality="single" base-type="identifier" />
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float" />

  <qti-template-declaration identifier="PRIZEDOOR" cardinality="single" base-type="identifier"
    math-variable="false" param-variable="false" />
  <qti-template-processing>
    <qti-set-template-value identifier="PRIZEDOOR">
      <qti-random>
        <qti-multiple>
          <qti-base-value base-type="identifier">DoorA</qti-base-value>
          <qti-base-value base-type="identifier">DoorB</qti-base-value>
          <qti-base-value base-type="identifier">DoorC</qti-base-value>
        </qti-multiple>
      </qti-random>
    </qti-set-template-value>
  </qti-template-processing>

  <qti-item-body>
    <p>Monty Hall has hidden a prize behind one of these doors.</p>
    <qti-feedback-block outcome-identifier="STORY" show-hide="show" identifier="openingGambit">
      <qti-content-body>
        <p>Monty invites you to choose one of the doors but won't let you open it just yet.</p>
      </qti-content-body>
    </qti-feedback-block>
    <qti-feedback-block outcome-identifier="STORY" show-hide="show" identifier="tempter">
      <qti-content-body>
        <p>Monty opens one of the other doors to reveal - a goat!</p>
        <p>He then asks you if you would like to change your mind or to stick with the door
          you
          originally chose. It's time to make your mind up, which door are you going to
          open?</p>
      </qti-content-body>
    </qti-feedback-block>
    <qti-feedback-block outcome-identifier="STORY" show-hide="show" identifier="goat">
      <qti-content-body>
        <p>Bad luck! When you opened your chosen door it also revealed a goat.</p>
      </qti-content-body>
    </qti-feedback-block>
    <qti-feedback-block outcome-identifier="STORY" show-hide="show" identifier="prize">
      <qti-content-body>
        <p>Congratulations! When you opened your chosen door it revealed a fantastic prize
          that
          you are now free to take home.</p>
      </qti-content-body>
    </qti-feedback-block>
    <qti-choice-interaction response-identifier="DOOR" shuffle="false" max-choices="1">
      <qti-simple-choice identifier="DoorA">
        <qti-feedback-inline outcome-identifier="CLOSED" show-hide="show" identifier="DoorA">
          <img src="images/red_door.png" alt="The Red Door" />
        </qti-feedback-inline>
        <qti-feedback-inline outcome-identifier="GOATS" show-hide="show" identifier="DoorA">
          <img src="images/open_goat.png" alt="An open door" /> - this door is now open
          revealing a goat!</qti-feedback-inline>
        <qti-feedback-inline outcome-identifier="PRIZE" show-hide="show" identifier="DoorA">
          <img src="images/open_car.png" alt="An open door" /> - this door is now open
          revealing a fantastic prize!</qti-feedback-inline>
      </qti-simple-choice>
      <qti-simple-choice identifier="DoorB">
        <qti-feedback-inline outcome-identifier="CLOSED" show-hide="show" identifier="DoorB">
          <img src="images/green_door.png" alt="The Green Door" />
        </qti-feedback-inline>
        <qti-feedback-inline outcome-identifier="GOATS" show-hide="show" identifier="DoorB">
          <img src="images/open_goat.png" alt="An open door" /> - this door is now open
          revealing a goat!</qti-feedback-inline>
        <qti-feedback-inline outcome-identifier="PRIZE" show-hide="show" identifier="DoorB">
          <img src="images/open_car.png" alt="An open door" /> - this door is now open
          revealing a fantastic prize!</qti-feedback-inline>
      </qti-simple-choice>
      <qti-simple-choice identifier="DoorC">
        <qti-feedback-inline outcome-identifier="CLOSED" show-hide="show" identifier="DoorC">
          <img src="images/blue_door.png" alt="The Blue Door" />
        </qti-feedback-inline>
        <qti-feedback-inline outcome-identifier="GOATS" show-hide="show" identifier="DoorC">
          <img src="images/open_goat.png" alt="An open door" /> - this door is now open
          revealing a goat!</qti-feedback-inline>
        <qti-feedback-inline outcome-identifier="PRIZE" show-hide="show" identifier="DoorC">
          <img src="images/open_car.png" alt="An open door" /> - this door is now open
          revealing a fantastic prize!</qti-feedback-inline>
      </qti-simple-choice>
    </qti-choice-interaction>
    <qti-feedback-block outcome-identifier="FEEDBACK" show-hide="show" identifier="poser">
      <qti-content-body>
        <p>Well, whether or not you won the prize did you make your decision by guesswork or
          logical reasoning? The question is, if we allowed you to play this game
          repeatedly what strategy <em>should</em> you adopt?</p>
        <qti-choice-interaction response-identifier="RESPONSE" shuffle="true"
          max-choices="1">
          <qti-simple-choice identifier="stickStrategy">Always stick to the first door you
            chose.</qti-simple-choice>
          <qti-simple-choice identifier="switchStrategy">Always switch to the other closed
            door
            when Monty offers you the chance.</qti-simple-choice>
          <qti-simple-choice identifier="noStrategy">It really doesn't matter whether you
            stick or
            switch - the outcome's the same.</qti-simple-choice>
        </qti-choice-interaction>
      </qti-content-body>
    </qti-feedback-block>
  </qti-item-body>

  <qti-response-processing>
    <qti-set-outcome-value identifier="completionStatus">
      <qti-base-value base-type="identifier">incomplete</qti-base-value>
    </qti-set-outcome-value>
    <qti-response-condition>
      <qti-response-if>
        <!-- Transition from openingGambit to tempter -->
        <qti-and>
          <qti-match>
            <qti-base-value base-type="identifier">openingGambit</qti-base-value>
            <qti-variable identifier="STORY" />
          </qti-match>
          <qti-not>
            <qti-is-null>
              <qti-variable identifier="DOOR" />
            </qti-is-null>
          </qti-not>
        </qti-and>
        <!-- Remember the first door chosen -->
        <qti-set-outcome-value identifier="FIRSTDOOR">
          <qti-variable identifier="DOOR" />
        </qti-set-outcome-value>
        <qti-response-condition>
          <qti-response-if>
            <qti-match>
              <qti-variable identifier="DOOR" />
              <qti-variable identifier="PRIZEDOOR" />
            </qti-match>
            <!-- Randomly open one of the other two doors -->
            <qti-response-condition>
              <qti-response-if>
                <qti-match>
                  <qti-variable identifier="DOOR" />
                  <qti-base-value base-type="identifier">DoorA</qti-base-value>
                </qti-match>
                <qti-set-outcome-value identifier="REVEALED">
                  <qti-random>
                    <qti-multiple>
                      <qti-base-value base-type="identifier">DoorB</qti-base-value>
                      <qti-base-value base-type="identifier">DoorC</qti-base-value>
                    </qti-multiple>
                  </qti-random>
                </qti-set-outcome-value>
              </qti-response-if>
              <qti-response-else-if>
                <qti-match>
                  <qti-variable identifier="DOOR" />
                  <qti-base-value base-type="identifier">DoorB</qti-base-value>
                </qti-match>
                <qti-set-outcome-value identifier="REVEALED">
                  <qti-random>
                    <qti-multiple>
                      <qti-base-value base-type="identifier">DoorA</qti-base-value>
                      <qti-base-value base-type="identifier">DoorC</qti-base-value>
                    </qti-multiple>
                  </qti-random>
                </qti-set-outcome-value>
              </qti-response-else-if>
              <qti-response-else>
                <qti-set-outcome-value identifier="REVEALED">
                  <qti-random>
                    <qti-multiple>
                      <qti-base-value base-type="identifier">DoorA</qti-base-value>
                      <qti-base-value base-type="identifier">DoorB</qti-base-value>
                    </qti-multiple>
                  </qti-random>
                </qti-set-outcome-value>
              </qti-response-else>
            </qti-response-condition>
          </qti-response-if>
          <qti-response-else>
            <!-- Open the other losing door -->
            <qti-response-condition>
              <qti-response-if>
                <qti-not>
                  <qti-member>
                    <qti-base-value base-type="identifier">DoorA</qti-base-value>
                    <qti-multiple>
                      <qti-variable identifier="PRIZEDOOR" />
                      <qti-variable identifier="DOOR" />
                    </qti-multiple>
                  </qti-member>
                </qti-not>
                <qti-set-outcome-value identifier="REVEALED">
                  <qti-base-value base-type="identifier">DoorA</qti-base-value>
                </qti-set-outcome-value>
              </qti-response-if>
              <qti-response-else-if>
                <qti-not>
                  <qti-member>
                    <qti-base-value base-type="identifier">DoorB</qti-base-value>
                    <qti-multiple>
                      <qti-variable identifier="PRIZEDOOR" />
                      <qti-variable identifier="DOOR" />
                    </qti-multiple>
                  </qti-member>
                </qti-not>
                <qti-set-outcome-value identifier="REVEALED">
                  <qti-base-value base-type="identifier">DoorB</qti-base-value>
                </qti-set-outcome-value>
              </qti-response-else-if>
              <qti-response-else>
                <qti-set-outcome-value identifier="REVEALED">
                  <qti-base-value base-type="identifier">DoorC</qti-base-value>
                </qti-set-outcome-value>
              </qti-response-else>
            </qti-response-condition>
          </qti-response-else>
        </qti-response-condition>
        <qti-set-outcome-value identifier="CLOSED">
          <qti-delete>
            <qti-variable identifier="REVEALED" />
            <qti-variable identifier="CLOSED" />
          </qti-delete>
        </qti-set-outcome-value>
        <qti-set-outcome-value identifier="GOATS">
          <qti-multiple>
            <qti-variable identifier="REVEALED" />
          </qti-multiple>
        </qti-set-outcome-value>
        <qti-set-outcome-value identifier="STORY">
          <qti-base-value base-type="identifier">tempter</qti-base-value>
        </qti-set-outcome-value>
      </qti-response-if>
      <qti-response-else-if>
        <!-- Transition from tempter to prize or goat -->
        <qti-and>
          <qti-match>
            <qti-base-value base-type="identifier">tempter</qti-base-value>
            <qti-variable identifier="STORY" />
          </qti-match>
          <qti-not>
            <qti-is-null>
              <qti-variable identifier="DOOR" />
            </qti-is-null>
          </qti-not>
        </qti-and>
        <!-- Whether you won or not, we score based on whether you switched -->
        <qti-response-condition>
          <qti-response-if>
            <qti-match>
              <qti-variable identifier="DOOR" />
              <qti-variable identifier="FIRSTDOOR" />
            </qti-match>
            <qti-set-outcome-value identifier="SCORE">
              <qti-base-value base-type="float">0</qti-base-value>
            </qti-set-outcome-value>
          </qti-response-if>
          <qti-response-else>
            <qti-set-outcome-value identifier="SCORE">
              <qti-base-value base-type="float">1</qti-base-value>
            </qti-set-outcome-value>
          </qti-response-else>
        </qti-response-condition>
        <!-- Now determine if you won the prize and open your chosen door -->
        <qti-response-condition>
          <qti-response-if>
            <qti-match>
              <qti-variable identifier="DOOR" />
              <qti-variable identifier="PRIZEDOOR" />
            </qti-match>
            <qti-set-outcome-value identifier="PRIZE">
              <qti-variable identifier="DOOR" />
            </qti-set-outcome-value>
            <qti-set-outcome-value identifier="STORY">
              <qti-base-value base-type="identifier">prize</qti-base-value>
            </qti-set-outcome-value>
          </qti-response-if>
          <qti-response-else>
            <qti-set-outcome-value identifier="GOATS">
              <qti-multiple>
                <qti-variable identifier="GOATS" />
                <qti-variable identifier="DOOR" />
              </qti-multiple>
            </qti-set-outcome-value>
            <qti-set-outcome-value identifier="STORY">
              <qti-base-value base-type="identifier">goat</qti-base-value>
            </qti-set-outcome-value>
          </qti-response-else>
        </qti-response-condition>
        <qti-set-outcome-value identifier="CLOSED">
          <qti-delete>
            <qti-variable identifier="DOOR" />
            <qti-variable identifier="CLOSED" />
          </qti-delete>
        </qti-set-outcome-value>
        <qti-set-outcome-value identifier="FEEDBACK">
          <qti-base-value base-type="identifier">poser</qti-base-value>
        </qti-set-outcome-value>
      </qti-response-else-if>
      <qti-response-else-if>
        <qti-and>
          <qti-match>
            <qti-variable identifier="FEEDBACK" />
            <qti-base-value base-type="identifier">poser</qti-base-value>
          </qti-match>
          <qti-not>
            <qti-is-null>
              <qti-variable identifier="RESPONSE" />
            </qti-is-null>
          </qti-not>
        </qti-and>
        <qti-response-condition>
          <qti-response-if>
            <qti-match>
              <qti-variable identifier="RESPONSE" />
              <qti-correct identifier="RESPONSE" />
            </qti-match>
            <qti-set-outcome-value identifier="SCORE">
              <qti-sum>
                <qti-variable identifier="SCORE" />
                <qti-base-value base-type="float">2</qti-base-value>
              </qti-sum>
            </qti-set-outcome-value>
          </qti-response-if>
        </qti-response-condition>
        <qti-set-outcome-value identifier="FEEDBACK">
          <qti-variable identifier="RESPONSE" />
        </qti-set-outcome-value>
        <qti-set-outcome-value identifier="completionStatus">
          <qti-base-value base-type="identifier">completed</qti-base-value>
        </qti-set-outcome-value>
      </qti-response-else-if>
    </qti-response-condition>
  </qti-response-processing>

  <qti-modal-feedback outcome-identifier="FEEDBACK" show-hide="show" identifier="stickStrategy">
    <qti-content-body>No. Initially, the probability of the prize being behind each door is 1/3.
      Opening a losing door can't possibly make this go down for the remaining closed one! In
      fact you should <em>never</em> stick to your original decision. 
    </qti-content-body>
  </qti-modal-feedback>
  <qti-modal-feedback outcome-identifier="FEEDBACK" show-hide="show" identifier="switchStrategy">
    <qti-content-body>Yes, you should <em>always</em> switch doors when offered the chance.
      Congratulations, perhaps you should think about a career as a TV game show contestant? 
    </qti-content-body>
  </qti-modal-feedback>
  <qti-modal-feedback outcome-identifier="FEEDBACK" show-hide="show" identifier="noStrategy">
    <qti-content-body>
      <p>No, you should infact <em>always</em> switch doors. This problem has fooled many
        mathematicians since it was first posed in an American magazine article and
        continues to present a seemingly paradoxical answer!</p>
      <p>The probability of your first choice door hiding the prize is 1/3 and this can't change.
        But, 2/3 of the time you'll be wrong with your first choice and, by revealing a goat,
        Monty is effectively telling you which door the prize is behind the remaining 2/3 of the
        time! So by switching doors, your chances of getting the prize go up to 2/3!</p>
    </qti-content-body>
  </qti-modal-feedback>

</qti-assessment-item>

Modal Feedback with Math Markup Language

This example makes extensive use of templates to test knowledge of calculus. It has modal feedback and includes some mathML.

<?xml version="1.0" encoding="UTF-8"?>
  <qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
  https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
  adaptive="false" time-dependent="false"
  identifier="mc_calc3" title="The number divisors" xml:lang="en">
  
    <qti-response-declaration base-type="identifier" cardinality="single" identifier="RESPONSE0" />
    <qti-outcome-declaration base-type="identifier" cardinality="single" identifier="FEEDBACK" />
    <qti-outcome-declaration base-type="float" cardinality="single" identifier="SCORE" />
  
    <qti-template-declaration base-type="integer" cardinality="single" identifier="i"
        math-variable="true" param-variable="true" />
    <qti-template-declaration base-type="integer" cardinality="ordered" identifier="numbers"
        math-variable="true" param-variable="true" />
    <qti-template-declaration base-type="string" cardinality="ordered" identifier="divisors"
        math-variable="true" param-variable="true" />
    <qti-template-declaration base-type="integer" cardinality="single" identifier="CALC0"
        math-variable="true" param-variable="true" />
    <qti-template-processing>
        <qti-set-template-value identifier="i">
            <qti-random-integer max="7" min="1" />
        </qti-set-template-value>
        <qti-set-template-value identifier="numbers">
            <qti-ordered>
                <qti-base-value base-type="integer">3</qti-base-value>
                <qti-base-value base-type="integer">4</qti-base-value>
                <qti-base-value base-type="integer">6</qti-base-value>
                <qti-base-value base-type="integer">15</qti-base-value>
                <qti-base-value base-type="integer">24</qti-base-value>
                <qti-base-value base-type="integer">25</qti-base-value>
                <qti-base-value base-type="integer">30</qti-base-value>
            </qti-ordered>
        </qti-set-template-value>
        <qti-set-template-value identifier="divisors">
            <qti-ordered>
                <qti-base-value base-type="string">-</qti-base-value>
                <qti-base-value base-type="string">2</qti-base-value>
                <qti-base-value base-type="string">2,3</qti-base-value>
                <qti-base-value base-type="string">3,5</qti-base-value>
                <qti-base-value base-type="string">2,3,4,6,8,12</qti-base-value>
                <qti-base-value base-type="string">5</qti-base-value>
                <qti-base-value base-type="string">2,3,5,6,10,15</qti-base-value>
            </qti-ordered>
        </qti-set-template-value>
        <qti-set-template-value identifier="CALC0">
            <qti-index n="i">
                <qti-variable identifier="numbers" />
            </qti-index>
        </qti-set-template-value>
        <qti-template-condition>
            <qti-template-if>
                <qti-equal tolerance-mode="exact">
                    <qti-variable identifier="i" />
                    <qti-base-value base-type="integer">1</qti-base-value>
                </qti-equal>
                <qti-set-correct-response identifier="RESPONSE0">
                    <qti-base-value base-type="identifier">SOLUTION0_0_0</qti-base-value>
                </qti-set-correct-response>
            </qti-template-if>
            <qti-template-else-if>
                <qti-equal tolerance-mode="exact">
                    <qti-variable identifier="i" />
                    <qti-base-value base-type="integer">2</qti-base-value>
                </qti-equal>
                <qti-set-correct-response identifier="RESPONSE0">
                    <qti-base-value base-type="identifier">SOLUTION0_0_1</qti-base-value>
                </qti-set-correct-response>
            </qti-template-else-if>
            <qti-template-else-if>
                <qti-equal tolerance-mode="exact">
                    <qti-variable identifier="i" />
                    <qti-base-value base-type="integer">3</qti-base-value>
                </qti-equal>
                <qti-set-correct-response identifier="RESPONSE0">
                    <qti-base-value base-type="identifier">SOLUTION0_0_2</qti-base-value>
                </qti-set-correct-response>
            </qti-template-else-if>
            <qti-template-else-if>
                <qti-equal tolerance-mode="exact">
                    <qti-variable identifier="i" />
                    <qti-base-value base-type="integer">4</qti-base-value>
                </qti-equal>
                <qti-set-correct-response identifier="RESPONSE0">
                    <qti-base-value base-type="identifier">SOLUTION0_0_3</qti-base-value>
                </qti-set-correct-response>
            </qti-template-else-if>
            <qti-template-else-if>
                <qti-equal tolerance-mode="exact">
                    <qti-variable identifier="i" />
                    <qti-base-value base-type="integer">5</qti-base-value>
                </qti-equal>
                <qti-set-correct-response identifier="RESPONSE0">
                    <qti-base-value base-type="identifier">SOLUTION0_0_4</qti-base-value>
                </qti-set-correct-response>
            </qti-template-else-if>
            <qti-template-else-if>
                <qti-equal tolerance-mode="exact">
                    <qti-variable identifier="i" />
                    <qti-base-value base-type="integer">6</qti-base-value>
                </qti-equal>
                <qti-set-correct-response identifier="RESPONSE0">
                    <qti-base-value base-type="identifier">SOLUTION0_0_5</qti-base-value>
                </qti-set-correct-response>
            </qti-template-else-if>
            <qti-template-else-if>
                <qti-equal tolerance-mode="exact">
                    <qti-variable identifier="i" />
                    <qti-base-value base-type="integer">7</qti-base-value>
                </qti-equal>
                <qti-set-correct-response identifier="RESPONSE0">
                    <qti-base-value base-type="identifier">SOLUTION0_0_6</qti-base-value>
                </qti-set-correct-response>
            </qti-template-else-if>
        </qti-template-condition>
    </qti-template-processing>
  
    <qti-item-body>
        <div> What are the divisors of <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mrow>
                    <mi>CALC0</mi>
                </mrow>
            </math> without 1 and <math>
                <mrow>
                    <mi>CALC0</mi>
                </mrow>
            </math>? <qti-inline-choice-interaction
                required="true" response-identifier="RESPONSE0" shuffle="true">
                <qti-inline-choice fixed="true" identifier="SOLUTION0_0_0">-</qti-inline-choice>
                <qti-inline-choice fixed="true" identifier="SOLUTION0_0_1">2</qti-inline-choice>
                <qti-inline-choice fixed="true" identifier="SOLUTION0_0_2">2,3</qti-inline-choice>
                <qti-inline-choice fixed="true" identifier="SOLUTION0_0_3">3,5</qti-inline-choice>
                <qti-inline-choice fixed="true" identifier="SOLUTION0_0_4">2,3,4,6,8,12</qti-inline-choice>
                <qti-inline-choice fixed="true" identifier="SOLUTION0_0_5">5</qti-inline-choice>
                <qti-inline-choice fixed="true" identifier="SOLUTION0_0_6">2,3,5,6,10,15</qti-inline-choice>
            </qti-inline-choice-interaction>
        </div>
    </qti-item-body>
  
    <qti-response-processing>
        <qti-response-condition>
            <qti-response-if>
                <qti-match>
                    <qti-variable identifier="RESPONSE0" />
                    <qti-correct identifier="RESPONSE0" />
                </qti-match>
                <qti-set-outcome-value identifier="FEEDBACK">
                    <qti-base-value base-type="identifier">FEEDBACK0</qti-base-value>
                </qti-set-outcome-value>
                <qti-set-outcome-value identifier="SCORE">
                    <qti-base-value base-type="float">2.0</qti-base-value>
                </qti-set-outcome-value>
            </qti-response-if>
            <qti-response-else>
                <qti-set-outcome-value identifier="FEEDBACK">
                    <qti-base-value base-type="identifier">DEFAULT_FEEDBACK</qti-base-value>
                </qti-set-outcome-value>
                <qti-set-outcome-value identifier="SCORE">
                    <qti-base-value base-type="float">0.0</qti-base-value>
                </qti-set-outcome-value>
            </qti-response-else>
        </qti-response-condition>
    </qti-response-processing>
  
    <qti-modal-feedback identifier="FEEDBACK0" outcome-identifier="FEEDBACK" show-hide="show">
        <qti-content-body>Bravo! You are right</qti-content-body>
    </qti-modal-feedback>
    <qti-modal-feedback identifier="DEFAULT_FEEDBACK" outcome-identifier="FEEDBACK" show-hide="show">
        <qti-content-body>It is false</qti-content-body>
    </qti-modal-feedback>
  </qti-assessment-item>

Numeric Operators in Response Processing

An example that uses templates extensively testing statistic funtions, and uses many common numeric operators in the response processing. It has modal feedback and includes some mathML.

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
  https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd" 
  identifier="stat2" title="Test of statistics functions" 
  adaptive="false" time-dependent="false" xml:lang="en">

  <qti-response-declaration base-type="integer" cardinality="single" identifier="RESPONSE0"/>
  <qti-response-declaration base-type="integer" cardinality="single" identifier="RESPONSE1"/>
  <qti-response-declaration base-type="float" cardinality="single" identifier="RESPONSE2"/>
  <qti-response-declaration base-type="float" cardinality="single" identifier="RESPONSE3"/>

  <qti-outcome-declaration base-type="identifier" cardinality="single" identifier="FEEDBACK"/>
  <qti-outcome-declaration base-type="float" cardinality="single" identifier="SCORE"/>

  <qti-template-declaration base-type="integer" cardinality="single" identifier="n" 
    math-variable="true" param-variable="true"/>
  <qti-template-declaration base-type="integer" cardinality="ordered" identifier="t" 
    math-variable="true" param-variable="true"/>
  <qti-template-declaration base-type="integer" cardinality="single" identifier="SOLUTION0_0" 
    math-variable="true" param-variable="true"/>
  <qti-template-declaration base-type="integer" cardinality="single" identifier="SOLUTION1_0" 
    math-variable="true" param-variable="true"/>
  <qti-template-declaration base-type="float" cardinality="single" identifier="SOLUTION2_0" 
    math-variable="true" param-variable="true"/>
  <qti-template-declaration base-type="float" cardinality="single" identifier="SOLUTION3_0" 
    math-variable="true" param-variable="true"/>

  <qti-template-processing>
      <qti-set-template-value identifier="n">
          <qti-random-integer max="10" min="2"/>
      </qti-set-template-value>
      <qti-set-template-value identifier="t">
          <qti-ordered>
              <qti-repeat number-repeats="n">
                  <qti-random-integer max="100" min="-100"/>
              </qti-repeat>
          </qti-ordered>
      </qti-set-template-value>
      <qti-set-template-value identifier="SOLUTION0_0">
          <qti-min>
              <qti-variable identifier="t"/>
          </qti-min>
      </qti-set-template-value>
      <qti-set-correct-response identifier="RESPONSE0">
          <qti-variable identifier="SOLUTION0_0"/>
      </qti-set-correct-response>
      <qti-set-template-value identifier="SOLUTION1_0">
          <qti-max>
              <qti-variable identifier="t"/>
          </qti-max>
      </qti-set-template-value>
      <qti-set-correct-response identifier="RESPONSE1">
          <qti-variable identifier="SOLUTION1_0"/>
      </qti-set-correct-response>
      <qti-set-template-value identifier="SOLUTION2_0">
          <qti-divide>
              <qti-round>
                  <qti-product>
                      <qti-stats-operator name="mean">
                          <qti-variable identifier="t"/>
                      </qti-stats-operator>
                      <qti-base-value base-type="integer">100</qti-base-value>
                  </qti-product>
              </qti-round>
              <qti-base-value base-type="integer">100</qti-base-value>
          </qti-divide>
      </qti-set-template-value>
      <qti-set-correct-response identifier="RESPONSE2">
          <qti-variable identifier="SOLUTION2_0"/>
      </qti-set-correct-response>
      <qti-set-template-value identifier="SOLUTION3_0">
          <qti-divide>
              <qti-round>
                  <qti-product>
                      <qti-stats-operator name="popSD">
                          <qti-variable identifier="t"/>
                      </qti-stats-operator>
                      <qti-base-value base-type="integer">100</qti-base-value>
                  </qti-product>
              </qti-round>
              <qti-base-value base-type="integer">100</qti-base-value>
          </qti-divide>
      </qti-set-template-value>
      <qti-set-correct-response identifier="RESPONSE3">
          <qti-variable identifier="SOLUTION3_0"/>
      </qti-set-correct-response>
  </qti-template-processing>

  <qti-item-body>
    <div>
      <p>Here is a set of numbers: <qti-printed-variable identifier="t"/></p>
      <p>What is the smallest number of this set? 
        <qti-text-entry-interaction expected-length="5" response-identifier="RESPONSE0"/></p>
      <p>What is the greatest number of this set? 
        <qti-text-entry-interaction expected-length="5" response-identifier="RESPONSE1"/></p>
      <p>What is the mean of this set (rounded to two decimal places)? 
        <qti-text-entry-interaction expected-length="5" response-identifier="RESPONSE2"/></p>
      <p>What is the standard deviation of this set (rounded to two decimal places)?
        <qti-text-entry-interaction expected-length="5" response-identifier="RESPONSE3"/></p>
    </div>
  </qti-item-body>

  <qti-response-processing>
      <qti-response-condition>
          <qti-response-if>
              <qti-and>
                  <qti-equal tolerance-mode="exact">
                      <qti-variable identifier="RESPONSE0"/>
                      <qti-correct identifier="RESPONSE0"/>
                  </qti-equal>
                  <qti-equal tolerance-mode="exact">
                      <qti-variable identifier="RESPONSE1"/>
                      <qti-correct identifier="RESPONSE1"/>
                  </qti-equal>
                  <qti-equal tolerance-mode="exact">
                      <qti-variable identifier="RESPONSE2"/>
                      <qti-correct identifier="RESPONSE2"/>
                  </qti-equal>
                  <qti-equal tolerance-mode="exact">
                      <qti-variable identifier="RESPONSE3"/>
                      <qti-correct identifier="RESPONSE3"/>
                  </qti-equal>
              </qti-and>
              <qti-set-outcome-value identifier="FEEDBACK">
                  <qti-base-value base-type="identifier">FEEDBACK0</qti-base-value>
              </qti-set-outcome-value>
              <qti-set-outcome-value identifier="SCORE">
                  <qti-base-value base-type="float">8.0</qti-base-value>
              </qti-set-outcome-value>
          </qti-response-if>
          <qti-response-else-if>
              <qti-and>
                  <qti-equal tolerance-mode="exact">
                      <qti-variable identifier="RESPONSE0"/>
                      <qti-correct identifier="RESPONSE0"/>
                  </qti-equal>
                  <qti-equal tolerance-mode="exact">
                      <qti-variable identifier="RESPONSE1"/>
                      <qti-correct identifier="RESPONSE1"/>
                  </qti-equal>
              </qti-and>
              <qti-set-outcome-value identifier="FEEDBACK">
                  <qti-base-value base-type="identifier">FEEDBACK1</qti-base-value>
              </qti-set-outcome-value>
              <qti-set-outcome-value identifier="SCORE">
                  <qti-base-value base-type="float">4.0</qti-base-value>
              </qti-set-outcome-value>
          </qti-response-else-if>
          <qti-response-else-if>
              <qti-and>
                  <qti-equal tolerance-mode="exact">
                      <qti-variable identifier="RESPONSE0"/>
                      <qti-correct identifier="RESPONSE0"/>
                  </qti-equal>
                  <qti-equal tolerance-mode="exact">
                      <qti-variable identifier="RESPONSE2"/>
                      <qti-correct identifier="RESPONSE2"/>
                  </qti-equal>
              </qti-and>
              <qti-set-outcome-value identifier="FEEDBACK">
                  <qti-base-value base-type="identifier">FEEDBACK2</qti-base-value>
              </qti-set-outcome-value>
              <qti-set-outcome-value identifier="SCORE">
                  <qti-base-value base-type="float">4.0</qti-base-value>
              </qti-set-outcome-value>
          </qti-response-else-if>
          <qti-response-else-if>
              <qti-and>
                  <qti-equal tolerance-mode="exact">
                      <qti-variable identifier="RESPONSE2"/>
                      <qti-correct identifier="RESPONSE2"/>
                  </qti-equal>
                  <qti-equal tolerance-mode="exact">
                      <qti-variable identifier="RESPONSE3"/>
                      <qti-correct identifier="RESPONSE3"/>
                  </qti-equal>
              </qti-and>
              <qti-set-outcome-value identifier="FEEDBACK">
                  <qti-base-value base-type="identifier">FEEDBACK3</qti-base-value>
              </qti-set-outcome-value>
              <qti-set-outcome-value identifier="SCORE">
                  <qti-base-value base-type="float">4.0</qti-base-value>
              </qti-set-outcome-value>
          </qti-response-else-if>
          <qti-response-else>
              <qti-set-outcome-value identifier="FEEDBACK">
                  <qti-base-value base-type="identifier">DEFAULT_FEEDBACK</qti-base-value>
              </qti-set-outcome-value>
              <qti-set-outcome-value identifier="SCORE">
                  <qti-base-value base-type="float">0.0</qti-base-value>
              </qti-set-outcome-value>
          </qti-response-else>
      </qti-response-condition>
  </qti-response-processing>

  <qti-modal-feedback identifier="FEEDBACK0" outcome-identifier="FEEDBACK" show-hide="show">
      <qti-content-body>
        Bravo!
        </qti-content-body>
  </qti-modal-feedback>
  <qti-modal-feedback identifier="FEEDBACK1" outcome-identifier="FEEDBACK" show-hide="show">
      <qti-content-body>
        The mean was: <math xmlns="http://www.w3.org/1998/Math/MathML">
          <mi>SOLUTION2_0</mi>
          </math> and the standard deviation was: <math xmlns="http://www.w3.org/1998/Math/MathML">
          <mi>SOLUTION3_0</mi>
        </math>. 
      </qti-content-body>
  </qti-modal-feedback>
  <qti-modal-feedback identifier="FEEDBACK2" outcome-identifier="FEEDBACK" show-hide="show">
    <qti-content-body>
      The greatest one was: <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mi>SOLUTION1_0</mi>
      </math> and the standard deviation was: <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mi>SOLUTION3_0</mi>
      </math>. 
    </qti-content-body>
  </qti-modal-feedback>
  <qti-modal-feedback identifier="FEEDBACK3" outcome-identifier="FEEDBACK" show-hide="show">
    <qti-content-body>
      The smallest one was: <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mi>SOLUTION0_0</mi>
      </math> and the standard deviation was: <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mi>SOLUTION3_0</mi>
      </math>. 
    </qti-content-body>
  </qti-modal-feedback>
  <qti-modal-feedback identifier="DEFAULT_FEEDBACK" outcome-identifier="FEEDBACK" show-hide="show">
    <qti-content-body>
      At least two incorrect responses. The smallest one was: <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mi>SOLUTION0_0</mi>
      </math>, the greatest one was: <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mi>SOLUTION1_0</mi>
      </math>, the mean was: <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mi>SOLUTION2_0</mi>
      </math> and the standard deviation was <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mi>SOLUTION3_0</mi>
      </math>. 
    </qti-content-body>
  </qti-modal-feedback>
</qti-assessment-item>

Using Template Constraint to Determine Variables at Runtime

This is another numeric example that makes use of templates, but is notable for its use of templateConstraint to determine variables at runtime.

<?xml version="1.0" encoding="UTF-8" ?>
  <qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0
      https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd"
      identifier="mc_calc5" title="Product of a fraction by a number"
      adaptive="false" time-dependent="false" xml:lang="en" >
  
      <qti-response-declaration identifier="REPONSE0" cardinality="multiple" base-type="identifier">
          <qti-correct-response>
              <qti-value>Item1</qti-value>
          </qti-correct-response>
      </qti-response-declaration>
  
      <qti-outcome-declaration identifier="FEEDBACK1" cardinality="single" base-type="identifier" />
      <qti-outcome-declaration identifier="FEEDBACK0" cardinality="single" base-type="identifier" />
      <qti-outcome-declaration identifier="FEEDBACK2" cardinality="single" base-type="identifier" />
      <qti-outcome-declaration identifier="FEEDBACK3" cardinality="single" base-type="identifier" />
      <qti-outcome-declaration identifier="SCORE0" cardinality="single" base-type="float" />
     
      <qti-template-declaration identifier="a" cardinality="single" base-type="integer"
        math-variable="true" param-variable="true" />
      <qti-template-declaration identifier="b" cardinality="single" base-type="integer"
        math-variable="true" param-variable="true" />
      <qti-template-declaration identifier="c" cardinality="single" base-type="integer"
        math-variable="true" param-variable="true" />
      <qti-template-declaration identifier="p" cardinality="single" base-type="integer"
        math-variable="true" param-variable="true" />
      <qti-template-declaration identifier="Choix0" cardinality="single" base-type="integer"
        math-variable="true" param-variable="true" />
      <qti-template-declaration identifier="Choix1" cardinality="single" base-type="integer"
        math-variable="true" param-variable="true" />
      <qti-template-declaration identifier="Choix2" cardinality="single" base-type="integer"
        math-variable="true" param-variable="true" />
      <qti-template-declaration identifier="Choix3" cardinality="single" base-type="integer"
        math-variable="true" param-variable="true" />
  
      <qti-template-processing>
          <qti-set-template-value identifier="a">
              <qti-random-integer min="1" max="10" />
          </qti-set-template-value>
          <qti-set-template-value identifier="b">
              <qti-random-integer min="2" max="20" />
          </qti-set-template-value>
          <qti-set-template-value identifier="c">
              <qti-random-integer min="-20" max="-10" />
          </qti-set-template-value>
          <qti-set-template-value identifier="p">
              <qti-product>
                  <qti-variable identifier="a" />
                  <qti-variable identifier="c" />
              </qti-product>
          </qti-set-template-value>
          <qti-set-template-value identifier="Choix0">
              <qti-subtract>
                  <qti-base-value base-type="integer">0</qti-base-value>
                  <qti-product>
                      <qti-variable identifier="a" />
                      <qti-variable identifier="c" />
                  </qti-product>
              </qti-subtract>
          </qti-set-template-value>
          <qti-set-template-value identifier="Choix1">
              <qti-subtract>
                  <qti-base-value base-type="integer">0</qti-base-value>
                  <qti-product>
                      <qti-variable identifier="b" />
                      <qti-variable identifier="c" />
                  </qti-product>
              </qti-subtract>
          </qti-set-template-value>
          <qti-set-template-value identifier="Choix2">
              <qti-round>
                  <qti-divide>
                      <qti-product>
                          <qti-variable identifier="a" />
                          <qti-variable identifier="c" />
                      </qti-product>
                      <qti-variable identifier="b" />
                  </qti-divide>
              </qti-round>
          </qti-set-template-value>
          <qti-set-template-value identifier="Choix3">
              <qti-subtract>
                  <qti-base-value base-type="integer">0</qti-base-value>
                  <qti-round>
                      <qti-divide>
                          <qti-product>
                              <qti-variable identifier="a" />
                              <qti-variable identifier="c" />
                          </qti-product>
                          <qti-variable identifier="b" />
                      </qti-divide>
                  </qti-round>
              </qti-subtract>
          </qti-set-template-value>
          <qti-template-constraint>
              <qti-equal tolerance-mode="exact">
                  <qti-gcd>
                      <qti-variable identifier="a" />
                      <qti-variable identifier="b" />
                  </qti-gcd>
                  <qti-base-value base-type="integer">1</qti-base-value>
              </qti-equal>
          </qti-template-constraint>
          <qti-template-constraint>
              <qti-lt>
                  <qti-variable identifier="a" />
                  <qti-variable identifier="b" />
              </qti-lt>
          </qti-template-constraint>
          <qti-template-constraint>
              <qti-equal tolerance-mode="exact">
                  <qti-integer-modulus>
                      <qti-variable identifier="p" />
                      <qti-variable identifier="b" />
                  </qti-integer-modulus>
                  <qti-base-value base-type="integer">0</qti-base-value>
              </qti-equal>
          </qti-template-constraint>
      </qti-template-processing>
  
      <qti-item-body>
          <div>
              <em> </em>
              <qti-choice-interaction response-identifier="REPONSE0" shuffle="true" max-choices="1">
                  <qti-prompt>
                      <math xmlns="http://www.w3.org/1998/Math/MathML">
                          <mfrac>
                              <mi>a</mi>
                              <mi>b</mi>
                          </mfrac>
                      </math> of <math xmlns="http://www.w3.org/1998/Math/MathML">
                          <mi>c</mi>
                      </math>
                      <br /> is equal to:<br />
                  </qti-prompt>
                  <qti-simple-choice identifier="Item0" fixed="false"> - <math xmlns="http://www.w3.org/1998/Math/MathML">
                          <mfrac>
                              <mi>Choix0</mi>
                              <mi>Choix1</mi>
                          </mfrac>
                      </math>
                  </qti-simple-choice>
                  <qti-simple-choice identifier="Item1" fixed="false">
                      <math xmlns="http://www.w3.org/1998/Math/MathML">
                          <mi>Choix2</mi>
                      </math>
                  </qti-simple-choice>
                  <qti-simple-choice identifier="Item2" fixed="false">
                      <math xmlns="http://www.w3.org/1998/Math/MathML">
                          <mi>Choix3</mi>
                      </math>
                  </qti-simple-choice>
              </qti-choice-interaction>
          </div>
      </qti-item-body>
  
      <qti-response-processing>
          <qti-response-condition>
              <qti-response-if>
                  <qti-match>
                      <qti-variable identifier="REPONSE0" />
                      <qti-correct identifier="REPONSE0" />
                  </qti-match>
                  <qti-set-outcome-value identifier="FEEDBACK1">
                      <qti-base-value base-type="identifier">FEEDBACK1</qti-base-value>
                  </qti-set-outcome-value>
                  <qti-set-outcome-value identifier="SCORE0">
                      <qti-base-value base-type="float">4</qti-base-value>
                  </qti-set-outcome-value>
              </qti-response-if>
              <qti-response-else-if>
                  <qti-match>
                      <qti-multiple>
                          <qti-base-value base-type="identifier">Item0</qti-base-value>
                      </qti-multiple>
                      <qti-variable identifier="REPONSE0" />
                  </qti-match>
                  <qti-set-outcome-value identifier="FEEDBACK0">
                      <qti-base-value base-type="identifier">FEEDBACK0</qti-base-value>
                  </qti-set-outcome-value>
                  <qti-set-outcome-value identifier="SCORE0">
                      <qti-base-value base-type="float">0</qti-base-value>
                  </qti-set-outcome-value>
              </qti-response-else-if>
              <qti-response-else-if>
                  <qti-match>
                      <qti-multiple>
                          <qti-base-value base-type="identifier">Item2</qti-base-value>
                      </qti-multiple>
                      <qti-variable identifier="REPONSE0" />
                  </qti-match>
                  <qti-set-outcome-value identifier="FEEDBACK2">
                      <qti-base-value base-type="identifier">FEEDBACK2</qti-base-value>
                  </qti-set-outcome-value>
                  <qti-set-outcome-value identifier="SCORE0">
                      <qti-base-value base-type="float">0</qti-base-value>
                  </qti-set-outcome-value>
              </qti-response-else-if>
              <qti-response-else>
                  <qti-set-outcome-value identifier="FEEDBACK3">
                      <qti-base-value base-type="identifier">FEEDBACK3</qti-base-value>
                  </qti-set-outcome-value>
                  <qti-set-outcome-value identifier="SCORE0">
                      <qti-base-value base-type="float">0</qti-base-value>
                  </qti-set-outcome-value>
              </qti-response-else>
          </qti-response-condition>
      </qti-response-processing>
  
      <qti-modal-feedback outcome-identifier="FEEDBACK1" identifier="FEEDBACK1" show-hide="show">
          <qti-content-body>Good answer.</qti-content-body>
      </qti-modal-feedback>
      <qti-modal-feedback outcome-identifier="FEEDBACK0" identifier="FEEDBACK0" show-hide="show">
          <qti-content-body>We must multiply the numerator only.</qti-content-body>
      </qti-modal-feedback>
      <qti-modal-feedback outcome-identifier="FEEDBACK2" identifier="FEEDBACK2" show-hide="show">
          <qti-content-body>Pay attention to the sign! </qti-content-body>
      </qti-modal-feedback>
      <qti-modal-feedback outcome-identifier="FEEDBACK3" identifier="FEEDBACK3" show-hide="show">
          <qti-content-body>No comment.</qti-content-body>
      </qti-modal-feedback>
  
  </qti-assessment-item>

3.7.5 Rubric Blocks

The qti-rubric-block element is the container for the rubric block content, which can be placed anywhere within the qti-item-body node of an AssessmentItem. A rubric block identifies part of the content that represents instructions to one or more of the actors that view the item.

Although rubric blocks are defined as simple blocks they must not contain interactions. The visibility of nested qti-rubric-blocks is determined by the outermost element. In other words, if an element is determined to be hidden then all of its content is hidden including conditionally visible elements for which the conditions are satisfied and that therefore would otherwise be visible.

If you use a stylesheet within a rubric block, the stylesheet is scoped only to that specific rubric block, and should not be used for other content within an AssessmentItem or any other rubric block. The stylesheet within the rubric block would also apply to any catalog content, if it were placed in that same rubric block. The assumption is that the rubric block also inherits from the AssessmentItem, and the rubric block stylesheet is intended to add styles or override AssessmentItem styles.

The qti-rubric-block element has two attributes, "use" and "view".

Rubric Block Attributes (element: qti-rubric-block)

Name Usage Value(s) Default
use required

Vocabulary:

  • instructions
  • scoring
  • navigation
  • ext: custom
No default
view required

Vocabulary:

  • author
  • candidate
  • proctor
  • scorer
  • testConstructor
  • tutor
No default

The content within the qti-rubric-block should only be presented to the specified actors when the role of the actor is known. For example, in a testing session, a candidate would not have any content in the qti-rubric-block where the view="scorer" as the content is intended for the scorer, not the candidate.

In addition to the use and view attributes, QTI 3 introduces a limited set of shared classes which are used to clarify the presentation expectations for the rubric block. The classes include:

  • qti-rubric-discretionary-placement : to indicate that the delivery/presentation system should provide the content to the intended view actors, but they are not necessarily placed inline with the content. The rubric block content can be displayed somewhere within the delivery platform's interface.
  • qti-rubric-inline : to indicate that the delivery/presentation system should provide content to the intended view actors in the order they appear within the AssessmentItem file. For example, if a rubric block showing scoring information for scorer is placed after an interaction, the scoring information should be visually placed after the interaction is presented for any scorer.

The content of the rubric block is stored within the qti-content-body node, and contain the QTI 3 limited HTML set. It cannot contain any QTI interactions.

Rubric blocks can also optionally include a qti-catalog-info node to store catalogs that support the rubric block content.

An example of using multiple rubric blocks for different views and uses is shown below. Note that the use of the shared classes is optional, but included in the example to demonstrate good practice.

Rubric Block in an AssessmentItem

<?xml version="1.0" encoding="UTF-8" ?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd" 
identifier="rubric_block" title="A Variety of Rubric Blocks in an Item"
adaptive="false" time-dependent="false" xml:lang="en" >

  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier">
    <qti-correct-response>
      <qti-value>optionD</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float">
    <qti-default-value>
      <qti-value>0</qti-value>
    </qti-default-value>
  </qti-outcome-declaration>

  <qti-item-body>

    <qti-rubric-block class="qti-rubric-discretionary-placement" view="tutor" use="instructions">
      <qti-content-body>
        <p>Help the candidate understand the information that is directly supplied in the text
          (2 km distance, a single year), and the information that is <em>implied</em> in the text
          (walking TO and FROM the lessons, 52 weeks in a year).</p>
      </qti-content-body>
    </qti-rubric-block>

    <qti-rubric-block class="qti-rubric-discretionary-placement" view="candidate" use="instructions">
      <!-- Rubric Blocks can have their own style sheet references -->
        <qti-stylesheet href="styles/choice-instructions.css" type="text/css" />
      <!-- The Rubric content is put inside the qti-content-body node -->
        <qti-content-body data-catalog-idref="catchoicedirs">
          <p class="directions">Select the option that best represents the correct answer.</p>
        </qti-content-body>
      <!-- Rubric Blocks can reference and contain Catalogs! -->
        <qti-catalog-info>
          <qti-catalog id="catchoicedirs">
            <qti-card support="sign-language">
              <qti-card-entry xml:lang="ase" default>
                <qti-html-content>
                  <video width="320" height="240" controls="controls">
                    <source src="asl/ss_choice_directions.m4v" type="video/mp4" />
                  </video>
                </qti-html-content>
              </qti-card-entry>
            </qti-card>
          </qti-catalog>
        </qti-catalog-info>
    </qti-rubric-block>

    <p>Tom walks back and forth to his harmonica lessons once a week. His house on Ordinary Dr.
      is a 2 kilometre walk to his teacher's house on Spectacular St.</p>
  
    <qti-rubric-block class="qti-rubric-inline" view="proctor" use="instructions">
      <qti-content-body>Some instructional text for the proctor here...</qti-content-body>
    </qti-rubric-block>

    <qti-choice-interaction response-identifier="RESPONSE" max-choices="1">
      <qti-prompt>
        How many kilometres will Tom walk in a year for his harmonica lessons?
      </qti-prompt>
      <qti-simple-choice identifier="optionA" fixed="true">
        <p>About 50</p>
      </qti-simple-choice>
      <qti-simple-choice identifier="optionB" fixed="true">
        <p>About 100</p>
      </qti-simple-choice>
      <qti-simple-choice identifier="optionC" fixed="true">
        <p>About 200</p>
      </qti-simple-choice>
      <qti-simple-choice identifier="optionD" fixed="true">
        <p>About 400</p>
      </qti-simple-choice>
    </qti-choice-interaction>

    <qti-rubric-block class="qti-rubric-inline" view="scorer" use="scoring">
      <qti-stylesheet href="styles/scoring-rubric.css" type="text/css" />
      <qti-content-body>An actual scoring rubric could go here.</qti-content-body>
    </qti-rubric-block>

  </qti-item-body>
  <qti-response-processing 
    template="https://www.imsglobal.org/question/qti_v3p0/rptemplates/match_correct.xml"/>
</qti-assessment-item>

3.7.6 Printed Variable, MathML Variable, and Param Expansion.

Printed variable (qti-printed-variable) elements may be used to insert the values of template or outcome variables into test- and item-level content, such as within feedback, template, and rubric blocks, within most HTML5 elements, and within such  interaction components as prompts and choices.  This is useful in generating item content from templates, for customizing feedback and messages, and for similar use cases.  

The format  attribute of the qti-printed-variable element can be used to control the formatting of the printed variable. Appendix A of Section 2 of this document gives a list of possible formatting options.  

A delivery system which supports printed variables updates them in all content currently displayed to users immediately after response processing and outcome processing are completed. Similar to printed variables, the values of template variables with math-variable="true" are substituted into < mi> and < ci>  elements within MathML blocks, and template variables with param-variable="true" are substituted into object param elements

3.7.7 Shared Stimulus

From within an AssessmentItem, you can optionally reference one or more stimulus files that are necessary to respond to the item. The stimulus may or may not be shared across multiple items.  A stimulus reference might look like the example below:

Figure 106 @@@ TODO caption
<qti-assessment-stimulus-ref identifier="Stimulus1" href="passages/unbelievableNight.xml" title="An Unbelievable Night" />

Both the identifier and href attributes are required attributes.  The href is a URI, and the title attribute is optional.  The stimuli must be contained as separate resources in the QTI package.

Shared stimulus content can be used by any number of AssessmentItem's, allowing a single copy of the content to be used by more than one QTI item. Associated alternative accessibility definitions can be contained implicitly with the stimulus content (i.e., reference to an external file is NOT to be used) allowing round-tripping of the shared stimulus information within a package. If a package is exported from system A, imported into System B, exported by System B and finally imported by System A, then System A must be able to recognize/identify/process the original shared stimulus information.

An example of a reference to an AssessmentStimulus from an AssessmentItem is shown below.  In this example it is left to the delivery platform to determine the stimulus rendering location within the qti-item-body.  This may reduce interoperability between delivery platforms.

Assessment Stimulus Reference in an AssessmentItem

<qti-assessment-item ...>
    <qti-response-declaration></qti-response-declaration>
    <qti-outcome-declaration></qti-outcome-declaration>

    <qti-assessment-stimulus-ref identifier="Stimulus1" href="passages/unbelievableNight.xml"/>

    <qti-item-body>
     <qti-order-interaction></qti-order-interaction>
    </qti-item-body>
    <qti-response-processing></qti-response-processing>
  </qti-assessment-item>

To improve interoperability, it is possible to be more prescriptive about the placement of the shared stimulus within an qti-item-body.  In the following example, QTI 3 Shared CSS is used to create a two-column layout in an item, where the stimulus is injected into the left-most column of the layout, and the item's stem and interaction are placed into the right-most column of the layout.  Placement of the stimulus is specified through the use of a <div> (any QTI 3 HTML5 qti-item-body element may be used) with a reference to the identifier of the shared stimulus by means of a data-stimulus-idref attribute.  Though not required, best practice is to add a class="qti-shared-stimulus" to the element - in this example, a <div> - used to specify the insertion location in the itemBody.

Assessment Stimulus Ref with Explicit Placement within an qti-item-body

<?xml version="1.0" encoding="UTF-8"?>
<qti-assessment-item xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqtiasi_v3p0 
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_asiv3p0_v1p0.xsd" 
identifier="unbelievable-night-item2" title="Where did the crocodile come from?" 
adaptive="false" time-dependent="false" xml:lang="en" >
  <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier">
    <qti-correct-response>
      <qti-value>B</qti-value>
    </qti-correct-response>
  </qti-response-declaration>
  <qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float">
    <qti-default-value>
      <qti-value>0</qti-value>
    </qti-default-value>
  </qti-outcome-declaration>

  <qti-assessment-stimulus-ref identifier="Stimulus1" 
    href="Passages/UnbelievableNight/unbelievableNight.xml" title="An Unbelievable Night" />

  <qti-item-body>
    <div class="qti-layout-row">
      <div class="qti-layout-col6">

  <!-- Be explicit about the placement of the stimulus in the qti-item-body.  Here, we place the
          stimulus in the left-most column of the two-column item layout by specifying a docking <div> with 
          data-stimulus-idref that refers to the identifier of the above qti-assessment-stimulus-ref.  -->

        <div class="qti-shared-stimulus" data-stimulus-idref="Stimulus1"></div>

      </div>
      <div class="qti-layout-col6">
        <p>Read the passage "The Unbelievable Night" before answering the following question</p>
        <qti-choice-interaction max-choices="1" response-identifier="RESPONSE">
          <qti-prompt data-catalog-idref="content4">Where did the crocodile come from?</qti-prompt>
          <qti-simple-choice identifier="A" data-catalog-idref="content3">the bathroom</qti-simple-choice>
          <qti-simple-choice identifier="B" data-catalog-idref="content6">a magazine cover</qti-simple-choice>
          <qti-simple-choice identifier="C" data-catalog-idref="content7">under the bed</qti-simple-choice>
          <qti-simple-choice identifier="D" data-catalog-idref="content5">a nearby river</qti-simple-choice>
        </qti-choice-interaction>
      </div>
    </div>
  </qti-item-body>
  <qti-response-processing 
  template="https://purl.imsglobal.org/spec/qti/v3p0/rptemplates/match_correct.xml"/>
</qti-assessment-item>

An example of an AssessmentStimulus is shown below. In addition to the stimulus content provided in the qti-stimulus-body, this example also contains a custom stylesheet and a catalog reference.

Example of Assessment Stimulus

<qti-assessment-stimulus xmlns="http://www.imsglobal.org/xsd/qti/imsqtiasi_v3p0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.imsglobal.org/xsd/qti/imsqti_stimulusv3p0_v1p0
  https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqti_stimulusv3p0_v1p0.xsd"
  identifier="Stimulus1" xml:lang="en">
  <qti-stylesheet href="stylesheets/unbelievable_night.css" type="text/css" />
  <qti-stimulus-body>
    <!-- Use this div  to constrain the styles in the injected stylesheet and
         avoid style collisions in the delivery platform. -->
    <div class="qti-shared-stimulus-wrapper">
      <div>
        <img height="210" width="400"
             alt="Picture of a door opening to a hallway. A person's shadow is cast on the
             door and hallway." src="images/exemplarSection01_title.png"/>
      </div>
      <h2 class="passage-title">An Unbelievable Night</h2>
      <p class="author-line">by Franz Hohler</p>
      <p><span data-catalog-idref="1234">Anina</span> was ten years old,
        so even half asleep she could find her way from her room to the bathroom.
        The door to her room was usually open a crack, and the nightlight in the hallway
        made it light enough to get to the bathroom past the telephone stand.
      </p>
    </div> <!-- /shared-stimulus-wrapper -->
  </qti-stimulus-body>
    <qti-catalog-info>
      <qti-catalog id="1234">
        <qti-card support="linguistic-guidance">
          <qti-html-content>Anina is the name of a girl.</qti-html-content>
        </qti-card>
      </qti-catalog>
    </qti-catalog-info>
  </qti-assessment-stimulus>

The associated content package manifest XML that includes the AssessmentStimulus is shown below.

<manifest xmlns="http://www.imsglobal.org/xsd/qti/qtiv3p0/imscp_v1p1"
xmlns:lom="http://ltsc.ieee.org/xsd/LOM" 
schemaLocation="http://www.imsglobal.org/xsd/qti/qtiv3p0/imscp_v1p1
https://purl.imsglobal.org/spec/qti/v3p0/schema/xsd/imsqtiv3p0_imscpv1p2_v1p0.xsd
http://ltsc.ieee.org/xsd/LOM   https://purl.imsglobal.org/spec/md/v1p3/schema/xsd/imsmd_loose_v1p3p2.xsd">
  <metadata/>
  <organizations/>
  <resources>
    <!-- This shared stimulus is referenced by Item1, Item2, and Item3 -->
    <resource identifier="Stimulus1" type="imsqti_stimulus_xmlv3p0" href="passages/unbelievableNight.xml">
      <file href="passages/unbelievableNight.xml"/>
      <file href="passages/images/exemplarSection01_title.png"/>
      <file href="passages/images/exemplarSection01_croc.png"/>
      <file href="passages/images/exemplarSection01_flamingos.png"/>
      <file href="passages/stylesheets/unbelievable_night.css"/>
    </resource>
    <resource identifier="Item1" href="exemplar06.xml" type="imsqti_qtiitem_xmlv3p0">
      <file href="exemplar06.xml"/>
      <dependency identifierref="Stimulus1"/>
    </resource>
    <resource identifier="Item2" type="imsqti_qtiitem_xmlv3p0" href="exemplar04.xml">
      <file href="exemplar04.xml"/>
      <dependency identifierref="Stimulus1"/>
    </resource>
    <resource identifier="Item3" type="imsqti_qtiitem_xmlv3p0" href="exemplar05.xml">
      <file href="exemplar05.xml"/>
      <dependency identifierref="Stimulus1"/>
    </resource>
  </resources>
</manifest>

3.7.8 Companion Materials

Companion materials are described within the <qti-companion-materials-info> node, and include assessment materials that are required to be available to test takers while answering a specific item. Materials may include interactive tools, like calculators or rulers. The specific materials tags, and their best practice usage are described below.

3.7.8.1 Calculators

All calculators would have access to all number digits, decimal key, equals button, and Clear button. Spoken (read aloud) capability should be something that is configurable to either allow, or not allow, during testing. Additionally, some programs allow for reading the numbers or functions as you use them, but do not allow reading the number as a whole. This is usually for Math-related content. The four possible calculators that can be specified are Basic, Standard, Scientific, and Graphing. Descriptions of each are included below.

Basic Calculator:In the <qti-calculator-type> tag, use the "Basic" vocabulary. The best practice assumed functions: Add, Subtract, Multiply, Divide.

Example usage:

<qti-companion-materials-info>
     <qti-calculator>
        <qti-calculator-type>Basic</qti-calculator-type>
        <qti-description>4 function calculator</qti-description>
     </qti-calculator>
  </qti-companion-materials-info>

Standard Calculator:In the <qti-calculator-type> tag, use the "Standard" vocabulary. The best practice assumed functions: all basic calculator functions, Square root (√), Percentage (%) , Plus/Minus (a.k.a. Sign Change), Memory Functions.

Scientific Calculator:In the <qti-calculator-type> tag, use the "Scientific" vocabulary. The functions may include, but are not limited to: ALL standard calculator functions, a p key, square ( x2) , cube (x3),  x to the y (xy), cube root , xth root , logarithm keys, log, ln, base 10, base e,Trigonometry function keys with an INVERSE key for the inverse functions, sin, cos, tan, hsin (hyperbolic sin), hcos, (hyperbolic cos), htan (hyperbolic tan), DEG, RAD, GRAD conversion, a capacity to work in both degree and radian mode, a reciprocal key (1/ x) – calculate the inverse of the displayed value, permutation and/or combination keys ( nP r , nC r), parentheses keys, metric conversion, permutation and combination keys, nPr,  cPr, x!

Graphing Calculator:In the <qti-calculator-type> tag, use the "Graphing" vocabulary. A Graphing calculator includes many of the same functions of a scientific calculator, plus the ability to display equations graphically.

3.7.8.2 Rule

Allows for the presentation of a measuring device for use on the computer with the supplied content. Use the qti-description tag for text description, as a human readable description of the functionality/capability of the rule. Provide the system of measurement using the rule system (which provides for choosing between metric (SI) and US measurement systems), then set the minimum length of the rule, the minor increment of the rule, and the major increment of the rule using the unit type (related to the rule measurement system).

Example usage:

<qti-companion-materials-info>
     <qti-rule>
        <qti-description>A metric ruler with increments on one side of the rule.</qti-description>
        <qti-rule-system-SI>
           <qti-minimum-length>10</qti-minimum-length>
           <qti-minor-increment unit="Meter">0.5</qti-minor-increment>
           <qti-major-increment unit="Meter">1.0</qti-major-increment>
        </qti-rule-system-SI>
     </qti-rule>
  </qti-companion-materials-info>
3.7.8.3 Protractor

The test taker will be supplied with an on-screen protractor while responding to the item. A human readable description can be included in the description tag. Provide the measurement system using the increment tag, which lets you provide a value for either the metric (radians) or US (degrees) systems of angular measurement.

Example usage:

<qti-companion-materials-info>
     <qti-protractor>
        <qti-description>A floating, transparent protractor that can be moved over the angles in the item.</qti-description>
        <qti-increment-US>
           <qti-minor-increment unit="Degree">1.0</qti-minor-increment>
           <qti-major-increment unit="Degree">5.0</qti-major-increment>
        </qti-increment-US>
     </qti-protractor>
  </qti-companion-materials-info>
3.7.8.4 Digital Materials

These are content or reference materials that relate to the item content. The materials can include some level of interactivity, but no QTI interactions. Examples could be a map, a table of information, a sheet of math formulas, an interactive periodic table of elements, or even graphic creation tools. Use the <qti-digital-material> tag and provide a link to the material by use of the qti-file-href tag.

An optional label and icon representing the digital material's resource may be provided which the delivery system may use if it wants to provide a link to the resource, or a button to launch the resource.

A MIME type may also be provided (via the attribute mime-type) which may allow the delivery engine to optimize the delivery of the resource.

Example usage:

<qti-companion-materials-info>
     <qti-digital-material>
        <qti-file-href>directory001/someDigitalFile.exe</qti-file-href>
     </qti-digital-material>
   <qti-digital-material label="The Periodic Table" mime-type="application/pdf">
        <qti-file-href>directory001/tableOfTheElements.pdf</qti-file-href>
        <qti-resource-icon>directory001/table.svg</qti-resource-icon>   
 </qti-digital-material>
</qti-companion-materials-info>

Digital Materials are intended to be presented to candidates during an assessment session. However, these materials are meant to assist, remind, guide, or in the case of a formative assessment, may even instruct the candidate. The candidate's interaction with these materials is not a requirement to responding to any assessment items, and no there are no scoring implications for the use of the materials by candidates.

The reference to the materials from within the item is often done to indicate that the particular reference materials are associated with the item, and that the candidate should have access to the materials while the assessment item is presented to the candidate. Because there is no indication as to how the materials are to be presented to candidates, the delivery system has discretion over the manner of presentation. Assessment programs often provide direction as to their expectations around the presentation of reference materials for candidates.

If candidates are required to access the materials to answer questions (like a reading passage), use the assessment stimulus structures (see Section 3.7.7 ) instead of digital materials. 3.7.8.5  Physical Materials

These are external materials needed to work with, or respond with, when the test taker responds to the item. Use the <qti-physical-material> tag, then describe the materials using text.

Example usage:

<qti-companion-materials-info>
     <qti-physical-material>
        Supply scissors and 2 sheets of 8.5 x 11 inch white paper.
     </qti-physical-material>
  </qti-companion-materials-info>

3.7.9 HTML5 Accessibility Structures

Within an QTI 3 item, content presented to candidates is largely authored using HTML in the itemBody, qti-catalog-info, and qti-modal-feedback nodes. Any prompts or interactions within the itemBody use QTI 3 specific elements, which are commonly converted to HTML elements at the time of delivery to the candidate. While authoring QTI 3 content, and transforming any markup code to delivery code, it is important to ensure that the content is presentable to as wide an audience as possible. In addition to making content more accessible to all candidates, using accepted web-delivery standards provides access to candidates using assistive technology (AT).

Many of the recommendations around the techniques that provide accessibility to candidates come from the World Wide Web Consortium's (W3C) Web Content Accessibility Guidelines (WCAG) 2.1. Implementers are encouraged to use WCAG to provide guidance on making their assessments accessible. The practices recommended below and throughout this document are certainly not definitive, exhaustive, or complete. However, using the native HTML structures will reduce the amount of special accessibility markup required for assessment delivery.

Using semantically-rich markup aids AT because the content structure and meaning can be programmatically determined. The WCAG 2.1 documentation defines "programmatically determined" as:

determined by software from author-supplied data provided in a way that different user agents, including assistive technologies, can extract and present this information to users in different modalities.

There are several HTML elements that are also useful for accessibility that can be used within an item, or an assessment interface. The elements: h1, h2, h3, h4, h5, h6, figure, main, nav, aside, ul (unordered list), ol (ordered list), table, footer, audio, video, p (paragraph) – all provide semantic meaning to the content within the element, and that meaning is used by assistive technology to be conveyed to the user, as well as providing navigational assistance. Implementers are encouraged to take advantage of native HTML elements to aid in providing meaningful, understandable content to candidates.

3.7.9.1 Use of Headings and Labels

By using descriptive headings and labels in assessment items (and assessment interfaces), the assessment experience for all candidates, including Assistive Technology (AT) users, is substantially improved. WCAG success criteria cover many of the aspects of using headings and labels in web content. The success criteria for headings and labels include:

  • 2.4.6 Headings and Labels
  • 2.4.10 Section Headings
  • 3.2.4 Consistent Identification
  • 3.3.2 Labels and Instructions
  • 4.1.2 Name, Role, Value

In addition to headings providing useful descriptions of the content that follows, they can provide structure to the content and allow AT users to navigate through and around the content using keyboard shortcuts. This allows the AT users to skim, read, and focus their attention on the specific portions of the content that are important to them, without the need of rereading unimportant information, and freeing them from a content-linear user experience.

Heading levels should maintain their hierarchical order, as computer programs would assume that heading levels with lower numbers are not within heading sections with higher numbers.

Having labels for interactive components allows assistive technology users (particularly screen reader users) to understand the purpose of the interactive component, as well as identifying the current object why the computer device has in focus. The use of WAI-ARIA to provide state information (or for labelling custom created web components) is also extremely helpful for AT users, and is discussed in more detail in Section 2.4.1, as well as within many of the item examples (particularly the transformation to delivery examples).

3.7.9.2 Alt Text and Long Descriptions

Images (pictures, illustrations, graphs, charts, icons, etc.) intended to provide meaningful content (non-decorative images) should include a short description of the image. The length of the description can vary from a few words to a couple of sentences. If the description needs to exceed two or three sentences, or the description would benefit from text formatting (use of lists, data tables, mathematical notation, etc.), consider making a shorter description that identifies the image, then add a long description for the image.

For assessments, the amount of information, and the specific information provided, is particularly important. In some cases, over describing the image can be a hindrance to understanding the image, or may add unintended distractions for the candidate, so authors should include only the amount of information that is important to the task, and for which a sighted candidate might need to consider when responding to the item.

Decorative images should include the empty alt text string (alt=""), as this coding convention is used by AT to skip even mentioning the image in any way. In some cases, assessments (particularly for younger candidates) include images to increase the engagement of the assessment, though the image is not critical to answer the question. Authors will need to judge whether adding simple descriptions like "Picture of a duck" is useful for the candidate. In many cases, treating these engagement images as "decorative" may be appropriate.

If the image has a caption which is intended for all candidates (regardless of accessibility requirements), consider using the HTML5 <figure> element which allows for a caption by using the <figcaption> element. The <figure> element can also be useful when displaying a series of images together. When providing multiple images within a figure, the <figcaption> can be used to describe the grouping of images collectively. If you use a caption for an image, you should also include at least a short identifying description in the alt text for any images within the figure.

For more complicated images, the simple description provided in the alt text string may be inadequate to describe all the information within the image, and writing a long string of text describing the image can be difficult to navigate for AT users. In these cases, it is recommended that a long description of the image be provided for candidates who could benefit from them.

See Section 5.2.1.1 for additional information on alternative text, and Section 5.2.1.2 for examples of long descriptions.

3.7.9.3 Audio and Video Tracks

The QTI 3 standard allows the use of the HTML5 elements audio and video. These are useful not only because they provide semantic meaning for the media object, but because they allow the use of tracks, which are used to include alternative representations of the auditory and visual aspects of the media.

To provide captions for a video object, use the "captions" vocabulary in the "kind" attribute in the track element, as shown in the code snippet below:

<video width="320" height="240" controls>
     <source src="qti3video.mp4" type="video/mp4" />
     <source src="qti3video.ogg" type="video/ogg" />
  <track src="qti3video_captions_en.vtt" kind="captions" srclang="en" />
</video>

The above example refers to a WebVTT file for the captions. Most browsers have media players that automatically display a Closed Caption (CC) icon in the controls bar if you supply a captions track, but check your particular delivery implementation to ensure that candidates can access the track. The media players then synchronize the captions information supplied in the WebVTT file with the video playback.

Some video files include the captions in the video file itself.

While you can provide multiple languages as subtitles for videos, this is typically not done for assessment content, as the captions provided are expected to be in the language of the assessment content, and if the content is also provided in a different language, that content is provided in a completely different Assessment Item (QTI 3 refers to these as item "variants").

There is a notable exception, where some assessments provide "stacked" translations, where the content switches back and forth between two languages by providing a chunk of content in one language (like a paragraph of text), then following that chunk with the second language translation. For stacked translated content, it would make sense to include multiple languages, as well as providing the language in the "srclang" attribute using a valid [BCP 47] language tag, as well as using the "label" attribute of the track (label="English") to identify the captions for the different language versions. Typically, those language labels appear in a list when the user selects the Closed Caption (CC) icon.

QTI 3 allows for the Media Fragments URI 1.0 notation (l ink to W3C documentation ) as recommended by the W3C as of 25 September, 2012. For example, if you wanted to play only the first 20 seconds of a video file, you add the media fragment notation to the end of the src URI, as shown in the example below:

<video width="320" height="240" controls>
     <source src="asl/item123_1.m4v#t=00:00:00,00:00:20.3" type="video/mp4" />
</video>

3.7.10 PNP Activated Content and the Use of Catalogs for Resource Storage

Within an QTI 3 Item, you can provide support-specific content through the use of catalog resources. Catalog content in a QTI 3 Item is considered "dormant" because it is only presented to candidates if their PNP information or their program's business rules indicate that the delivery system should provide them with the support-specific content within the catalog.

It should be noted that general accessibility information should NOT be supplied within catalogs, but rather should be included as content readily available to all users using accepted web-based accessibility markup practices. General accessibility information would include things like alt text for images, captions for videos with audio, roles for sections of content, headings, labels, and text descriptions for non-text content.

An item can contain none, one, or many catalogs, all contained within the qti-catalog-info node within an AssessmentItem file, inserted after the qti-item-body content.

A single catalog can contain one or many supports, which are enumerated using "cards" within the qti-catalog node. The "support" attribute of the card describes which support is contained within the card. Each catalog must only contain one of any of the particular supports. For example, you cannot have a catalog with 2 cards with a support="additional-directions". If the support is intended to match the predefined supports (see Section 3.7.10.1) of the AfA 3.0 PNP, the support name in the support attribute will exactly match the support name of the PNP. If the support is not intended to match the predefined supports, then the support name is considered "custom" and should follow the custom support conventions (see