<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns="http://www.imsglobal.org/xsd/imsqti_usagedata_v2p2"
     targetNamespace="http://www.imsglobal.org/xsd/imsqti_usagedata_v2p2"
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
     version="IMS QTI USAGE 2.2.0"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified">

    <xs:annotation>
        <xs:documentation>
            XSD Data File Information
            =========================
            Author:         Colin Smythe (IMS Global, UK) and Mark McKell (IMS Global, USA)
            Date:           1st September, 2015
            Version:        2.2
            Status:         Final Release
            Description:    This is the Platform Specific Model of the Usage Data in the IMS QTI v2.2 Specification Information Model. Is is this representation that is used to produce the XSD binding for the IMS QTI v2.2 Usage Data XSD.

            History:        This version supercedes the full IMS QTI v2.1 specification.

            License:        IPR and Distribution Notices

                            This machine readable file is derived from IMS Global specification IMS Question and Test Interoperability (QTI) Version 2.2
                            found at http://www.imsglobal.org/question and the original IMS Global schema binding or code base
                            http://www.imsglobal.org/question.

                            Recipients of this document are requested to submit, with their comments, notification of any relevant 
                            patent claims or other intellectual property rights of which they may be aware that might be infringed by
                            any implementation of the specification set forth in this document, and to provide supporting documentation.

                            IMS takes no position regarding the validity or scope of any intellectual property or other rights that might
                            be claimed to pertain to the implementation or use of the technology described in this document or the extent 
                            to which any license under such rights might or might not be available; neither does it represent that it has 
                            made any effort to identify any such rights. Information on IMS procedures with respect to rights in IMS 
                            specifications can be found at the IMS Global Intellectual Property Rights web page: http://www.imsglobal.org/ipr/imsipr_policyFinal.pdf.

                            Copyright (c) IMS Global Learning Consortium 1999-2015. All Rights Reserved.

                            Use of this specification to develop products or services is governed by the license with IMS found on the IMS website: http://www.imsglobal.org/license.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 IMPLEMENTERS 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.

            Source UML File Information
            ===========================
            The source file information must be supplied as an XMI file (without diagram layout information).
            The supported UML authoring tools are:
            (a) Poseidon - v6 (and later)
            (b) Papyrus - v0.10.2 (and later)

            Source XSLT File Information
            ============================
            XSL Generator:    Specificationv1p0_GenerationToolv1.xsl
            XSLT Processor:   Saxon-PE-9.5.0.2
            Release:          1.0
            Date:             31st July, 2014
            Autogen Engineer: Colin Smythe (IMS Global, UK)
            Autogen Date:     2015-12-14

            IMS Global Auto-generation Binding Tool-kit (I-BAT)
            ===================================================
            This file was auto-generated using the IMS Global Binding Auto-generation Tool-kit (I-BAT).  While every
            attempt has been made to ensure that this tool auto-generates the files correctly, users should be aware
            that this is an experimental tool.  Permission is given to make use of this tool.  IMS Global makes no
            claim on the materials created by third party users of this tool.  Details on how to use this tool
            are contained in the IMS Global "I-BAT" documentation available at the IMS Global web-site:
            http://www.imsglobal.org.

            Tool Copyright:  2012-2015  (c) IMS Global Learning Consortium Inc.  All Rights Reserved.
        </xs:documentation>
    </xs:annotation>

    <!-- Generate Global Attributes (non-assigned) ******************************************************** -->

    <!-- ================================================================================================== -->

    <!-- Generate Global Attributes *********************************************************************** -->

    <!-- ================================================================================================== -->

    <!-- Generate Global List Types *********************************************************************** -->

    <!-- ================================================================================================== -->

    <!-- Generate Namespaced extension Group  ************************************************************* -->

    <!-- ================================================================================================== -->

    <!-- Generate Special DataTypes  ********************************************************************** -->

    <xs:complexType name="EmptyPrimitiveType.Type">
        <xs:complexContent>
            <xs:restriction base="xs:anyType" />
        </xs:complexContent>
    </xs:complexType>

    <!-- ================================================================================================== -->

    <!-- Generate the enumerated simpleType declarations ************************************************** -->

    <!-- ================================================================================================== -->

    <!-- Generate the simpleType elements based on IMS data-types (Parameter) ***************************** -->

    <!-- ================================================================================================== -->

    <!-- Generate the simpleType elements based on IMS data-types (Derived) ******************************* -->

    <!-- ================================================================================================== -->

    <!-- Generate the simpleType elements based on IMS data-types (Union) ********************************* -->

    <!-- ================================================================================================== -->

    <!-- Generate the simpleType elements based on IMS data-types (Complex) ******************************* -->

    <!-- ================================================================================================== -->

    <!-- Generate the derived data-type elements based upon simpleType ************************************ -->

    <xs:simpleType name="Date.Type">
        <xs:restriction base="xs:date">
            <xs:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="Identifier.Type">
        <xs:restriction base="xs:NCName" />
    </xs:simpleType>

    <!-- ================================================================================================== -->

    <!-- Generate the derived data-type elements based upon derived simpleType **************************** -->

    <!-- ================================================================================================== -->

    <!-- Generate the ComplexTypes ************************************************************************ -->

    <xs:complexType name="CategorizedStatistic.Type" abstract="false" mixed="false">
        <xs:annotation>
            <xs:documentation source="documentation">
                An item statistic that consists of multiple values, e.g. IRT Dispersion Parameters.       
            </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="targetObject" type="TargetObject.Type" minOccurs="1" maxOccurs="unbounded" />
            <xs:element name="mapping" type="Mapping.Type" minOccurs="1" maxOccurs="1" />
        </xs:sequence>
        <xs:attribute name="name" use="required" type="Identifier.Type" />
        <xs:attribute name="glossary" use="optional" type="xs:anyURI" />
        <xs:attribute name="context" use="required" type="xs:anyURI" />
        <xs:attribute name="caseCount" use="optional" type="xs:integer" />
        <xs:attribute name="stdError" use="optional" type="xs:double" />
        <xs:attribute name="stdDeviation" use="optional" type="xs:double" />
        <xs:attribute name="lastUpdated" use="optional" type="Date.Type" />
    </xs:complexType>

    <xs:complexType name="Mapping.Type" abstract="false" mixed="false">
        <xs:annotation>
            <xs:documentation source="documentation">
                A special class used to create a mapping from a source set of any baseType (except file a-
                nd duration) to a single float. Note that mappings from values of base type float should  
                be avoided due to the difficulty of matching floating point values, see the match operator
                for more details. When mapping containers the result is the sum of the mapped values from 
                the target set. See mapResponse for details.                                              
            </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="mapEntry" type="MapEntry.Type" minOccurs="1" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute name="lowerBound" use="optional" type="xs:double" />
        <xs:attribute name="upperBound" use="optional" type="xs:double" />
        <xs:attribute name="defaultValue" use="optional" default="0" type="xs:double" />
    </xs:complexType>

    <xs:complexType name="OrdinaryStatistic.Type" abstract="false" mixed="false">
        <xs:annotation>
            <xs:documentation source="documentation">
                An item statistic that consists of a single numeric value.                                
            </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="targetObject" type="TargetObject.Type" minOccurs="1" maxOccurs="unbounded" />
            <xs:element name="value" type="Value.Type" minOccurs="1" maxOccurs="1" />
        </xs:sequence>
        <xs:attribute name="name" use="required" type="Identifier.Type" />
        <xs:attribute name="glossary" use="optional" type="xs:anyURI" />
        <xs:attribute name="context" use="required" type="xs:anyURI" />
        <xs:attribute name="caseCount" use="optional" type="xs:integer" />
        <xs:attribute name="stdError" use="optional" type="xs:double" />
        <xs:attribute name="stdDeviation" use="optional" type="xs:double" />
        <xs:attribute name="lastUpdated" use="optional" type="Date.Type" />
    </xs:complexType>

    <xs:complexType name="UsageData.Type" abstract="false" mixed="false">
        <xs:annotation>
            <xs:documentation source="documentation">
                Usage data, most commonly item statistics, do not form part of an assessmentItem directly 
                because they always relate to some context or domain in which the statistics are valid. T-
                herefore, this specification defines a separate class for describing these statistics. Ea-
                ch statistic refers to both its context and to the assessmentItem(s) it relates to. There-
                fore, instances of this class are bound and packaged separately for interoperability.     
            </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element name="ordinaryStatistic" type="OrdinaryStatistic.Type" minOccurs="1" maxOccurs="1"/>
                <xs:element name="categorizedStatistic" type="CategorizedStatistic.Type" minOccurs="1" maxOccurs="1"/>
            </xs:choice>
        </xs:sequence>
        <xs:attribute name="glossary" use="optional" type="xs:anyURI" />
    </xs:complexType>

    <!-- ================================================================================================== -->

    <!-- Generate the derived ComplexTypes **************************************************************** -->

    <xs:complexType name="MapEntry.Type" abstract="false" mixed="false">
        <xs:annotation>
            <xs:documentation source="documentation">
                A map is defined by a set of mapEntries, each of which maps a single value from the source
                set onto a single float.                                                                  
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="EmptyPrimitiveType.Type">
                <xs:attribute name="mapKey" use="required" type="xs:normalizedString" />
                <xs:attribute name="mappedValue" use="required" type="xs:double" />
                <xs:attribute name="caseSensitive" use="optional" type="xs:boolean" />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="TargetObject.Type" abstract="false" mixed="false">
        <xs:annotation>
            <xs:documentation source="documentation">
                The targetObject is used to refer to an assessment object. This object may be an assessme-
                ntItem or some other type of object defined outside the scope of this specification, for  
                example, an entire test. In some cases it is desirable to refer not just to the assessment
                object but to a specific part of that object, in which case the optional partIdentifier c-
                an be used.                                                                               
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="EmptyPrimitiveType.Type">
                <xs:attribute name="identifier" use="required" type="xs:string" />
                <xs:attribute name="partIdentifier" use="optional" type="Identifier.Type" />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="Value.Type" abstract="false" mixed="false">
        <xs:annotation>
            <xs:documentation source="documentation">
                A class that can represent a single value of any baseType in variable declarations and re-
                sult reports. The base-type is defined by the baseType attribute of the declaration except
                in the case of variables with record cardinality.                                         
            </xs:documentation>
        </xs:annotation>
        <xs:simpleContent>
            <xs:extension base="xs:normalizedString">
                <xs:attribute name="fieldIdentifier" use="optional" type="Identifier.Type" />
                <xs:attribute name="baseType" use="optional">
                    <xs:simpleType>
                        <xs:annotation>
                            <xs:documentation source="documentation">
                                A base-type is simply a description of a set of atomic values (atomic to this specificati-
                                on). Note that several of the baseTypes used to define the runtime data model have identi-
                                cal definitions to those of the basic data types used to define the values for attributes 
                                in the specification itself. The use of an enumeration to define the set of baseTypes used
                                in the runtime model, as opposed to the use of classes with similar names, is designed to 
                                help distinguish between these two distinct levels of modelling.                          
                            </xs:documentation>
                        </xs:annotation>
                        <xs:restriction base="xs:string">
                            <xs:enumeration value="boolean" />
                            <xs:enumeration value="directedPair" />
                            <xs:enumeration value="duration" />
                            <xs:enumeration value="file" />
                            <xs:enumeration value="float" />
                            <xs:enumeration value="identifier" />
                            <xs:enumeration value="integer" />
                            <xs:enumeration value="pair" />
                            <xs:enumeration value="point" />
                            <xs:enumeration value="string" />
                            <xs:enumeration value="uri" />
                        </xs:restriction>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>

    <!-- ================================================================================================== -->

    <!-- Declaration of the elements (Complex) ************************************************************ -->

    <!-- ================================================================================================== -->

    <!-- Declaration of the elements (Derived) ************************************************************ -->

    <!-- ================================================================================================== -->

    <!-- Declaration of the root element(s) *************************************************************** -->

    <xs:element name="usageData" type="UsageData.Type" />

    <!-- ================================================================================================== -->

</xs:schema>
