StudentAcademicRecord wrong ordering of elements

Bug #837886 reported by Jon Nicholson
6
Affects Status Importance Assigned to Milestone
Open ADK for Java
Fix Committed
Undecided
Unassigned

Bug Description

This bug was discovered by Jon Kelly, which was discussed and confirmed in https://answers.launchpad.net/open-adk-java/+question/168193.

Using the OpenADK to generate a StudentAcademicRecord object results in a XML that does not validate due to the ordering of elements.

Example. The following message is generated by the OpenADK and sent to the ZIS:

<SIF_Message xmlns="http://www.sifinfo.org/infrastructure/2.x" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="2.0r1">
  <SIF_Response>
    <SIF_Header>
      <SIF_MsgId>1555E252514044AB8FCB0CE46769BC0B</SIF_MsgId>
      <SIF_Timestamp>2011-08-16T15:20:18-04:00</SIF_Timestamp>
      <SIF_Security>
        <SIF_SecureChannel>
          <SIF_AuthenticationLevel>0</SIF_AuthenticationLevel>
          <SIF_EncryptionLevel>0</SIF_EncryptionLevel>
        </SIF_SecureChannel>
      </SIF_Security>
      <SIF_SourceId>Aspen</SIF_SourceId>
      <SIF_DestinationId>SIFQuery</SIF_DestinationId>
    </SIF_Header>
    <SIF_RequestMsgId>83586C60A20B459797968482B9052179</SIF_RequestMsgId>
    <SIF_PacketNumber>1</SIF_PacketNumber>
    <SIF_MorePackets>No</SIF_MorePackets>
    <SIF_ObjectData><StudentAcademicRecord RefId="53544430303031454F66516371595802" SIF_RefId="53544430303031454F66516371595802" SIF_RefObject="StudentPersonal">
  <ReportingDate>2011-08-16</ReportingDate>
  <StudentSchoolEnrollmentData SchoolAttendedRefId="534B4C30303031454F66657671595802">
    <GradeLevel>
      <Code>03</Code>
    </GradeLevel>
  </StudentSchoolEnrollmentData>
  <StudentSchoolEnrollmentData SchoolAttendedRefId="534B4C30303031454F66657671595802"/>
  <StudentSchoolEnrollmentData>
    <GradeLevel>
      <Code>03</Code>
    </GradeLevel>
  </StudentSchoolEnrollmentData>
  <SchoolAttendanceHistory>
    <SchoolAttended RefId="534B4C30303031454F666576726D5802">
      <SchoolInfoData>
        <LocalId>02620065</LocalId>
        <SchoolName>Veterans Memorial School</SchoolName>
      </SchoolInfoData>
      <MarkingSystems>
        <MarkValueInfoData RefId="475253303030303030334F495A6B5802"/>
      </MarkingSystems>
    </SchoolAttended>
    <SchoolAttended RefId="534B4C30303031454F66657671595802">
      <SchoolInfoData>
        <LocalId>02620050</LocalId>
        <SchoolName>Oaklandvale Elementary School</SchoolName>
      </SchoolInfoData>
      <MarkingSystems>
        <MarkValueInfoData RefId="475253303030303030334F495A6B5802"/>
      </MarkingSystems>
    </SchoolAttended>
  </SchoolAttendanceHistory>
  <CurrentCourseActivity>
    <Courses>
      <Course>
        <MarkingPeriod>
          <MarkData MarkValueInfoDataRefId="475253303030303030334F495A6B5802">
            <Numeric>85</Numeric>
          </MarkData>
        </MarkingPeriod>
        <SchoolAttendedRefId>534B4C30303031454F66657671595802</SchoolAttendedRefId>
        <SchoolCourseInfoData>
          <CourseCode>5001e</CourseCode>
          <Description>Social Studies</Description>
        </SchoolCourseInfoData>
      </Course>
    </Courses>
  </CurrentCourseActivity>
</StudentAcademicRecord>
 </SIF_ObjectData>
</SIF_Response>
</SIF_Message>

The ZIS replies with the following error:

<b>SIF_Response</b> acknowledged (not successful) XML Validation Error. cvc-complex-type.2.4.d: Invalid content was found starting with element 'SchoolAttendedRefId'. No child element is expected at this point.

After investigation, it was discovered that the OpenADK is generating classes that do not comply with the SIF Specifications. According to the US SIF specification 2.0r1 (the version the message is being sent in) the following series of elements are expected:

/StudentAcademicRecord/CurrentCourseActivity/Courses/Course/MarkingPeriod

but according to the configuration file /open-adk-java/adk-generator/datadef/sif20r1/etranscripts.xml the following series of elements are (incorrectly) expected:

/StudentAcademicRecord/CurrentCourseActivity/Courses/Course/MarkingPeriods/MarkingPeriod

Because a MarkingPeriods element is expected by the ADK, it fails to order elements correctly when adding a MarkingPeriod to Course directly. This was confirmed when wrapping a MarkingPeriod element inside a MarkingPeriods element: the ADK correctly ordered the elements, but this does not produce XML that validates against the SIF spec.

The solution we found was to rebuild the ADK after editing the file:

/open-adk-java/adk-generator/datadef/sif20r1/etranscripts.xml (this can be viewed here: http://bazaar.launchpad.net/~open-adk-team/open-adk-java/trunk/view/head:/open-adk-java/adk-generator/datadef/sif20r1/etranscripts.xml)

On Line 246, replace the line:

<element name="MarkingPeriods" type="MarkingPeriods" flags="M" />

with:

<element name="MarkingPeriod" type="MarkingPeriod" flags="M" />

I believe lines 338--341 can also be removed, although I am not familiar enough with the US spec to know this for certain.

To quote Jon Kelly: "Making this change throughout all the etranscripts.xml and rebuilding fixed the generation and validation issue I was having."

Indeed, I have also checked the 2.4 SIF Specification against the respective XML file, and this issue appears there too. All versions need to be checked and corrected as appropriate.

Revision history for this message
Brian Sneddon (brian-sneddon) wrote :

MarkingPeriod element added to Course object in etranscipts.xml in each datadef sif2.0 - sif2.4 This solves the ordering problem with StudentAcademicRecord.

Changed in open-adk-java:
status: New → Fix Committed
Revision history for this message
besthoverboardhub (besthoverboardhub) wrote :

Ok, thanks for letting us know about it, you can also check https://apkcapture.com/spoofcard-mod-apk/ it provide you complete apk file with unlock features

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.