<xs:schema xmlns:e="http://ylioppilastutkinto.fi/exam.xsd"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xhtml="http://www.w3.org/1999/xhtml" targetNamespace="http://ylioppilastutkinto.fi/exam.xsd" elementFormDefault="qualified" version="1.0" xml:lang="fi">

  <!-- Import relevant XHTML subset -->
  <xs:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="xhtml11.xsd" />

  <xs:element name="exam">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="e:exam-versions" />
        <xs:element name="exam-title" type="e:Flow" minOccurs="0" />
        <xs:element name="exam-instruction" type="e:Flow" minOccurs="0" />
        <xs:element name="exam-grading-instruction" type="e:Flow" minOccurs="0" />
        <xs:element ref="e:table-of-contents" minOccurs="0" />
        <xs:element ref="e:external-material" minOccurs="0" />
        <xs:element ref="e:section" maxOccurs="unbounded" />
        <xs:element ref="e:references" minOccurs="0" />
        <xs:element name="exam-footer" type="e:Flow" minOccurs="0" />
      </xs:sequence>
      <xs:attribute name="exam-schema-version" type="e:exam-schema-version" />
      <xs:attribute name="date" type="xs:date" />
      <xs:attribute name="exam-code" type="e:exam-code" />
      <xs:attribute name="day-code" type="e:day-code" />
      <xs:attribute name="exam-stylesheet" type="xs:string" />
      <xs:attribute name="max-answers" type="xs:positiveInteger" />
      <xs:attribute name="lang" type="xs:language" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>

    <xs:key name="exam-version-key">
      <xs:selector xpath=".//e:exam-version" />
      <xs:field xpath="@lang" />
      <xs:field xpath="@exam-type" />
    </xs:key>

    <xs:unique name="attachment-unique">
      <xs:selector xpath=".//e:attachment" />
      <xs:field xpath="@name" />
    </xs:unique>

    <xs:keyref name="attachment-link-keyref" refer="e:attachment-unique">
      <xs:selector xpath=".//e:attachment-link" />
      <xs:field xpath="@ref" />
    </xs:keyref>

  </xs:element>

  <xs:attributeGroup name="localizable">
    <xs:attribute name="lang" type="e:exam-language-type">
      <xs:annotation>
        <xs:documentation>The exam language.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="exam-type" type="e:exam-type-list">
      <xs:annotation>
        <xs:documentation>
          You may want to create separate versions of the exam for students with disabilities. If not
          specified, the contents are used in all exam versions for this language.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:attributeGroup name="stylable">
    <xs:attribute name="class" type="xs:NMTOKENS" />
  </xs:attributeGroup>

  <xs:attributeGroup name="hidable">
    <xs:attribute name="hidden" type="xs:boolean" use="optional" default="false">
      <xs:annotation>
        <xs:documentation>Piilotetaanko elementti koetilanteessa.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:simpleType name="exam-schema-version">
    <xs:restriction base="xs:string">
      <xs:enumeration value="0.5" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="exam-code">
    <xs:restriction base="xs:string">
      <xs:enumeration value="A5" />
      <xs:enumeration value="A" />
      <xs:enumeration value="BA" />
      <xs:enumeration value="BB" />
      <xs:enumeration value="BI" />
      <xs:enumeration value="DC" />
      <xs:enumeration value="EA" />
      <xs:enumeration value="EC" />
      <xs:enumeration value="ET" />
      <xs:enumeration value="FA" />
      <xs:enumeration value="FC" />
      <xs:enumeration value="FF" />
      <xs:enumeration value="FY" />
      <xs:enumeration value="GC" />
      <xs:enumeration value="GE" />
      <xs:enumeration value="HI" />
      <xs:enumeration value="I" />
      <xs:enumeration value="IC" />
      <xs:enumeration value="KE" />
      <xs:enumeration value="L1" />
      <xs:enumeration value="L7" />
      <xs:enumeration value="M" />
      <xs:enumeration value="N" />
      <xs:enumeration value="PA" />
      <xs:enumeration value="PC" />
      <xs:enumeration value="PS" />
      <xs:enumeration value="QC" />
      <xs:enumeration value="SA" />
      <xs:enumeration value="SC" />
      <xs:enumeration value="TC" />
      <xs:enumeration value="TE" />
      <xs:enumeration value="UE" />
      <xs:enumeration value="UO" />
      <xs:enumeration value="VA" />
      <xs:enumeration value="VC" />
      <xs:enumeration value="W" />
      <xs:enumeration value="YH" />
      <xs:enumeration value="Z" />
      <!-- only Swedish codes -->
      <xs:enumeration value="CA" />
      <xs:enumeration value="CB" />
      <xs:enumeration value="O5" />
      <xs:enumeration value="O" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="day-code">
    <xs:restriction base="xs:string">
      <xs:enumeration value="E" />
      <xs:enumeration value="X" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="section-type">
    <xs:restriction base="xs:string">
      <xs:enumeration value="H" />
      <xs:enumeration value="T" />
      <xs:enumeration value="D" />
      <xs:enumeration value="E" />
      <xs:enumeration value="X" />
      <xs:enumeration value="A" />
      <xs:enumeration value="B" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="Flow" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:group ref="xhtml:xhtml.Flow.mix" />
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="LocalizableFlow" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:group ref="xhtml:xhtml.Flow.mix" />
    </xs:choice>
    <xs:attributeGroup ref="e:localizable" />
    <xs:attributeGroup ref="e:hidable" />
  </xs:complexType>

  <xs:simpleType name="exam-language-type">
    <xs:restriction base="xs:string">
      <xs:enumeration value="fi-FI">
        <xs:annotation>
          <xs:documentation>Finnish</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="sv-FI">
        <xs:annotation>
          <xs:documentation>Swedish</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="exam-type">
    <xs:restriction base="xs:string">
      <xs:enumeration value="normal">
        <xs:annotation>
          <xs:documentation>A version of the exam designed for students without any disabilities.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="visually-impaired">
        <xs:annotation>
          <xs:documentation>A version of the exam designed for visually impaired students.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="hearing-impaired">
        <xs:annotation>
          <xs:documentation>A version of the exam designed for hearing impaired students.</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="exam-type-list">
    <xs:restriction>
      <xs:simpleType>
        <xs:list itemType="e:exam-type" />
      </xs:simpleType>
      <xs:minLength value="1"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="exam-versions">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="e:exam-version" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="exam-version">
    <xs:complexType>
      <xs:attribute name="lang" type="e:exam-language-type" use="required" />
      <xs:attribute name="exam-type" type="e:exam-type" default="normal" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="localization">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:group ref="xhtml:xhtml.Flow.mix" />
      </xs:choice>
      <xs:attributeGroup ref="e:localizable" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="table-of-contents">
    <xs:complexType>
      <xs:sequence />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="section">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="section-title" type="e:Flow" />
        <xs:element ref="e:audio-test" minOccurs="0" />
        <!-- TODO: Validate that section has at least one question. -->
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="section-instruction" type="e:Flow" />
          <xs:element ref="e:question" maxOccurs="unbounded" />
        </xs:choice>
      </xs:sequence>
      <xs:attribute name="max-answers" type="xs:positiveInteger" />
      <xs:attribute name="cas-forbidden" type="xs:boolean" default="false" />
      <xs:attribute name="type" type="e:section-type">
        <xs:annotation>
          <xs:documentation>
            YTL specific type code that is only used in packaging exams for matriculation examination. Use 'H' to denote hearing section of the exam. The other options have more cosmetic effect on exam packaging. This attribute does not have effect on how sections are displayed in the exam.
          </xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="meta" type="xs:string" />
      <xs:attributeGroup ref="e:localizable" />
    </xs:complexType>
  </xs:element>

  <xs:element name="question">
    <xs:complexType mixed="true">
      <xs:sequence>
        <xs:element name="question-title" type="e:Flow" />
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="question-instruction" type="e:Flow" />
          <xs:element name="question-grading-instruction" type="e:Flow" />
          <xs:element ref="e:external-material" />
          <xs:group ref="xhtml:xhtml.Flow.mix" />
          <xs:element ref="e:question" />
        </xs:choice>
      </xs:sequence>
      <xs:attribute name="max-answers" type="xs:positiveInteger" />
      <xs:attribute name="meta" type="xs:string" />
      <xs:attributeGroup ref="e:localizable" />
    </xs:complexType>
  </xs:element>

  <xs:element name="external-material">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="e:attachment" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attributeGroup ref="e:localizable" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <!-- Attachments -->

  <xs:attributeGroup name="sourcable">
    <xs:attribute name="src" type="xs:string" use="required" />
    <xs:attribute name="meta" type="xs:string" />
  </xs:attributeGroup>

  <xs:element name="attachment">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="attachment-title" type="e:Flow" />
        <xs:group ref="xhtml:xhtml.Flow.mix" maxOccurs="unbounded" />
        <xs:element ref="e:reference" minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attribute name="name" type="xs:NMTOKEN" />
      <xs:attributeGroup ref="e:localizable" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="attachment-links">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="e:attachment-link" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attribute name="type" type="e:attachment-link-type" default="long" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="attachment-link-type">
    <xs:restriction base="xs:string">
      <xs:enumeration value="short" />
      <xs:enumeration value="long" />
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="attachment-link">
    <xs:complexType>
      <xs:sequence />
      <xs:attribute name="ref" type="xs:NMTOKEN" use="required" />
      <xs:attribute name="type" type="e:attachment-link-type" default="long" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="question-number">
    <xs:complexType>
      <xs:attribute name="suffix" type="xs:string" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="translation">
    <xs:complexType>
      <xs:attribute name="key" type="xs:string" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="image">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="image-title" type="e:Flow" minOccurs="0" />
      </xs:sequence>
      <xs:attributeGroup ref="e:sourcable" />
      <xs:attributeGroup ref="e:localizable" />
      <xs:attributeGroup ref="e:stylable" />
    </xs:complexType>
  </xs:element>

  <xs:element name="image-overlay">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="e:image" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attributeGroup ref="e:localizable" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="video">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="video-title" type="e:Flow" minOccurs="0" />
        <xs:element name="video-transcription" type="e:Flow" minOccurs="0" />
      </xs:sequence>
      <xs:attributeGroup ref="e:sourcable" />
      <xs:attributeGroup ref="e:localizable" />
      <xs:attributeGroup ref="e:stylable" />
    </xs:complexType>
  </xs:element>

  <xs:element name="audio-test">
    <xs:complexType>
      <xs:sequence />
      <xs:attributeGroup ref="e:sourcable" />
    </xs:complexType>
  </xs:element>

  <xs:element name="audio">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="audio-title" type="e:Flow" minOccurs="0" />
        <xs:element name="audio-transcription" type="e:Flow" minOccurs="0" />
      </xs:sequence>
      <xs:attributeGroup ref="e:sourcable" />
      <xs:attribute name="times" type="xs:positiveInteger" />
      <xs:attributeGroup ref="e:localizable" />
      <xs:attributeGroup ref="e:stylable" />
    </xs:complexType>
  </xs:element>

  <xs:element name="audio-group">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:group ref="xhtml:xhtml.Flow.mix" />
        <xs:element ref="e:question" />
      </xs:choice>
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="file">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:group ref="xhtml:xhtml.Flow.mix" />
      </xs:choice>
      <xs:attributeGroup ref="e:sourcable" />
      <xs:attributeGroup ref="e:localizable" />
      <xs:attributeGroup ref="e:stylable" />
    </xs:complexType>
  </xs:element>

  <!-- References -->

  <xs:element name="reference">
    <xs:complexType>
      <xs:choice maxOccurs="unbounded">
        <xs:element name="author" type="e:LocalizableFlow" />
        <xs:element name="title" type="e:LocalizableFlow" />
        <xs:element name="publisher" type="e:LocalizableFlow" />
        <xs:element name="publication" type="e:LocalizableFlow" />
        <xs:element name="url" type="e:LocalizableFlow" />
        <xs:element name="publication-date" type="e:localizable-date" maxOccurs="unbounded" />
        <xs:element name="reference-date" type="e:localizable-date" maxOccurs="unbounded" />
        <xs:element name="modified-by" type="e:LocalizableFlow" />
        <xs:element name="translator" type="e:LocalizableFlow" />
        <xs:element name="translation-date" type="e:localizable-date" maxOccurs="unbounded" />
        <xs:element name="howpublished" type="e:LocalizableFlow" />
        <xs:element name="note" type="e:LocalizableFlow" />
      </xs:choice>
      <xs:attributeGroup ref="e:localizable" />
      <xs:attributeGroup ref="e:hidable" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="date">
    <xs:union memberTypes="xs:date xs:gYear" />
  </xs:simpleType>

  <xs:complexType name="localizable-date">
    <xs:simpleContent>
      <xs:extension base="e:date">
        <xs:attributeGroup ref="e:localizable" />
        <xs:attributeGroup ref="e:hidable" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:element name="references">
    <xs:complexType>
      <xs:sequence />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <!-- Formulas -->

  <xs:element name="formula">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:string">
          <xs:attribute name="mode" type="e:formula-mode" default="inline" />
          <xs:attribute name="assistive-title" type="xs:string">
            <xs:annotation>
              <xs:documentation>Assistive title for screen readers. Defaults to the LaTeX source code of the formula.</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="meta" type="xs:string" />
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="formula-mode">
    <xs:restriction base="xs:string">
      <xs:enumeration value="display" />
      <xs:enumeration value="inline" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Answer types -->

  <xs:group name="Answer.class">
    <xs:choice>
      <xs:element ref="e:text-answer" />
      <xs:element ref="e:hints" />
      <xs:element ref="e:scored-text-answers" />
      <xs:element ref="e:scored-text-answer" />
      <xs:element ref="e:dnd-answer-container" />
      <xs:element ref="e:choice-answer" />
      <xs:element ref="e:dropdown-answer" />
      <xs:element ref="e:audio-answer" />
    </xs:choice>
  </xs:group>

  <xs:element name="text-answer">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="hint" minOccurs="0" type="e:LocalizableFlow" />
        <xs:element name="answer-grading-instruction" minOccurs="0" type="e:Flow" />
      </xs:sequence>
      <xs:attribute name="type" type="e:text-answer-type" default="single-line" />
      <xs:attribute name="max-score" type="xs:positiveInteger" use="required" />
      <xs:attribute name="max-length" type="xs:positiveInteger" />
      <xs:attribute name="use-language-of-instruction" type="xs:boolean" default="false">
        <xs:annotation>
          <xs:documentation>Whether the student should answer the question in the language of instruction (typically the mother tongue) instead of the subject language. This attribute controls the HTML lang attribute of the input element, so a screen reader will read the answer using the correct language. Used only in secondary language exams. </xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attributeGroup ref="e:stylable" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="text-answer-type">
    <xs:restriction base="xs:string">
      <xs:enumeration value="integer" />
      <xs:enumeration value="single-line" />
      <xs:enumeration value="rich-text" />
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="hints">
    <xs:complexType mixed="true">
      <xs:choice maxOccurs="unbounded">
        <xs:group ref="xhtml:xhtml.Flow.mix" />
      </xs:choice>
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="scored-text-answers">
    <xs:annotation>
      <xs:documentation>
        Deprecated. Use
        <code>e:hints</code>
        instead.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:choice maxOccurs="unbounded">
        <xs:group ref="xhtml:xhtml.Flow.mix" />
      </xs:choice>
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="scored-text-answer">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="hint" minOccurs="0" type="e:LocalizableFlow" />
        <xs:element name="answer-grading-instruction" minOccurs="0" type="e:Flow" />
        <xs:element ref="e:accepted-answer" minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attribute name="type" type="e:text-answer-type" default="single-line" />
      <xs:attribute name="max-score" type="xs:positiveInteger" />
      <xs:attribute name="use-language-of-instruction" type="xs:boolean" default="false">
        <xs:annotation>
          <xs:documentation>Whether the student should answer the question in the language of instruction (typically the mother tongue) instead of the subject language. This attribute controls the HTML lang attribute of the input element, so a screen reader will read the answer using the correct language. Used only in secondary language exams. </xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attributeGroup ref="e:stylable" />
      <xs:attributeGroup ref="e:localizable" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="accepted-answer">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:string">
          <xs:attribute name="score" type="xs:positiveInteger" use="required" />
          <xs:attributeGroup ref="e:localizable" />
          <xs:attribute name="meta" type="xs:string" />
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

  <!-- Choice answers -->

  <xs:simpleType name="ordering">
    <xs:restriction base="xs:string">
      <xs:enumeration value="random" />
      <xs:enumeration value="fixed" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="direction">
    <xs:restriction base="xs:string">
      <xs:enumeration value="vertical" />
      <xs:enumeration value="horizontal" />
    </xs:restriction>
  </xs:simpleType>

  <xs:attributeGroup name="orderable">
    <xs:attribute name="ordering" type="e:ordering" default="random" />
  </xs:attributeGroup>

  <xs:element name="choice-answer">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="e:choice-answer-option" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attribute name="direction" type="e:direction" />
      <xs:attributeGroup ref="e:orderable" />
      <xs:attributeGroup ref="e:stylable" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="choice-answer-option">
    <xs:complexType mixed="true">
      <xs:choice maxOccurs="unbounded">
        <xs:group ref="xhtml:xhtml.Flow.mix" />
      </xs:choice>
      <xs:attribute name="score" type="xs:integer" />
      <xs:attribute name="type" type="e:choice-answer-option-type" default="normal" />
      <xs:attributeGroup ref="e:stylable" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="choice-answer-option-type">
    <xs:restriction base="xs:string">
      <xs:enumeration value="normal" />
      <xs:enumeration value="no-answer" />
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="dropdown-answer">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="e:dropdown-answer-option" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attributeGroup ref="e:orderable" />
      <xs:attributeGroup ref="e:stylable" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="dropdown-answer-option">
    <xs:complexType mixed="true">
      <xs:choice maxOccurs="unbounded">
        <xs:group ref="xhtml:xhtml.Flow.mix" />
      </xs:choice>
      <xs:attribute name="score" type="xs:integer" />
      <xs:attributeGroup ref="e:stylable" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="dnd-answer-container">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="e:dnd-answer" minOccurs="1" maxOccurs="unbounded" />
        <xs:element ref="e:dnd-answer-option" minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attribute name="dnd-type" type="e:dnd-type" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="dnd-type">
    <xs:restriction base="xs:string">
      <xs:enumeration value="connect" />
      <xs:enumeration value="classify" />
      <xs:enumeration value="order" />
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="dnd-answer">
    <xs:complexType mixed="true">
      <xs:sequence>
        <xs:element name="dnd-answer-title" minOccurs="1" maxOccurs="1" type="e:Flow" />
        <xs:element ref="e:dnd-answer-option" minOccurs="1" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attribute name="max-score" type="xs:positiveInteger" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="dnd-answer-option">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="1" maxOccurs="unbounded">
        <xs:group ref="xhtml:xhtml.Flow.mix" />
      </xs:choice>
      <xs:attribute name="score" type="xs:positiveInteger" />
      <xs:attribute name="meta" type="xs:string" />
    </xs:complexType>
  </xs:element>

  <xs:element name="audio-answer">
    <xs:complexType>
      <xs:attribute name="max-score" type="xs:positiveInteger" use="required" />
    </xs:complexType>
  </xs:element>

</xs:schema>
