<!--
		SIF Implementation Specification (New Zealand) 3.1
		(8 December, 2020
)
		
		Infrastructure Version: v3.1
	-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sifassociation.org/datamodel/nz/3.1" targetNamespace="http://www.sifassociation.org/datamodel/nz/3.1" elementFormDefault="qualified" version="3.1 (rc 5)">
  <xs:complexType name="StudentAttainmentType">
    <xs:sequence>
      <xs:element name="StudentAttainmentRefId" minOccurs="0" nillable="true" type="RefIdType" />
      <xs:element name="StudentAttainmentLocalId" minOccurs="0" nillable="true" type="LocalIdType" />
      <xs:element name="GrantingProvider" minOccurs="0" type="ProviderObjectReferenceType" />
      <xs:element name="Attainment" minOccurs="0" type="ObjectReferenceType" />
      <xs:element name="Student" minOccurs="0" type="StudentObjectReferenceType" />
      <xs:element name="AuthorisingStaffMember" minOccurs="0" nillable="true" type="ObjectReferenceType" />
      <xs:element name="DateAttained" minOccurs="0" nillable="true" type="xs:date" />
      <xs:element name="YearAttained" minOccurs="0" nillable="true" type="xs:gYear" />
      <xs:element name="JustificationList" minOccurs="0" nillable="true" type="JustificationListType" />
      <xs:element name="SubjectAreaList" minOccurs="0" nillable="true" type="SubjectAreaListType" />
      <xs:element name="EndorsementLevel" minOccurs="0" nillable="true" type="NZCodeSetsNCEAEndorsementLevelType" />
      <xs:element name="RecordAudit" minOccurs="0" nillable="true" type="RecordAuditType" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="StudentAttainment" type="StudentAttainmentType">
    <xs:unique name="StudentAttainmentKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./StudentAttainmentRefId" />
    </xs:unique>
  </xs:element>

  <xs:complexType name="StudentAttainmentCollectionType">
    <xs:sequence>
      <xs:element name="StudentAttainment" type="StudentAttainmentType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="StudentAttainments" type="StudentAttainmentCollectionType" />

</xs:schema>