Lecture examinations


Download and unzip the above file exam.zip. Then:

  1. Import the resulting Exam Project into your IDEA IDE by choosing »File --> Open...« subsequently selecting the Exam/pom.xml file.

  2. Also import Exam into your Oxygenxml IDE using »Project« --> »Open Project« subsequently selecting the Exam/sda1.xpr file.


Consider lectures and related examination results:

<examinations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="exam.xsd" >
    <lecture id="113105">Software Development 1</lecture>
    <lecture id="113771">Database systems</lecture>
    <lecture id="113305">Structured Data and applications 1</lecture>
    <result lecture="113105" matriculationNumber="12345" status="final">1,7</result>
    <result lecture="113771" matriculationNumber="12345">2,3</result>
    <result lecture="113771" matriculationNumber="55621">1,0</result>
    <result lecture="113771" matriculationNumber="12345" status="preliminary">3,0</result>
    <result lecture="113305" matriculationNumber="55621">2,0</result>    

The following data integrity rules shall apply:

  1. <lectures> and <examinationResults> must be present.

  2. <lectures> must have at least one <lecture> child.

  3. Each <lecture> has got a unique positive id value of integer type within <lectures> .

  4. <examinationResults> may have an arbitrary number of <result> children.

  5. Each examination <result>

    • must contain a mark from {1,0; 1,3; 1,7; 2,0; 2,3; ...; 4,3 }. Thus e.g. <result ...>1,5</result> is invalid.

    • refers to exactly one <lecture> by virtue of its <result lecture="..."> attribute referencing a corresponding <lecture id="..."> element.

    • must have a unique (lecture , matriculationNumber) attribute value combination within <examinationResults>. The following example is thus invalid:

      <result lecture="113305" matriculationNumber="12345">2,0</result>    
      <!-- o.k., different matriculationNumber -->
      <result lecture="113305" matriculationNumber="54321">2,0</result> 
      <!-- o.k., different lecture -->
      <result lecture="113771" matriculationNumber="12345">2,0</result>  
      <!-- Error: Identical (lecture, matriculationNumber) -->
      <result lecture="113305" matriculationNumber="12345">2,0</result>  
    • may have an attribute <result status="..."> containing either of {"final", "preliminary"}.


Complete your schema's implementation in Schema/catalog.xsd using the Oxygenxml IDE. Hints:

  1. Consider the list of predefined data types near the page's bottom.

  2. The Text content and attributes slide is your friend. Regarding the list of marking steps {1,0; 1,3; 1,7; ... } you may define a <xs:simpleType name="grades"> and refer to it using <xs:extension base="grades"> .

  3. A composed key is being defined by adding multiple <xs:field> elements:

    <xs:key name="..."> <!-- A composed key consisting of two attributes -->
      <xs:selector xpath="..."/>
      <xs:field xpath="@attrib1"/>
      <xs:field xpath="@attrib2"/>
  4. Junit execution of de.hdm_stuttgart.mi.sda1.test.ex1.SchemaTest from within IntelliJ executes all unit tests based on files residing in your project's folder SchemaTest. Some of these files, e.g. SchemaTest/0102invalid_missingId.xml, contain comment hints regarding expected errors with respect to the intended Schema/exam.xsd.

     ... <!-- Expected error: Mandatory @id attribute is missing -->...

    Clicking on file names within test failure reports will open e.g. SchemaTest/0102invalid_missingId.xml in IDEA. However opening the same file in Oxygenxml manually may save time due to better XML support.

  5. Never touch your project's unit tests in the SchemaTest folder: The automated tests may end up throwing meaningless exceptions.

  6. Edit Schema/exam.xsd only by small steps executing the tests immediately. Schema changes may cause already working tests to fail again. In case of spoiling your schema undo is your friend.


  • XPath uses the dot (.) for selecting an element's content e.g. "food" in <cat>food</cat> .

  • Prefer XSD standard types rather than defining own types by restriction.

Project upload

Export your project by hitting »File« --> »Export to Zip File« in IDEA creating an e.g. solution-1.zip file. Then enter your ILIAS browser, hit the choose file button selecting solution-1.zip and subsequently click upload. Do not forget to advance to the next question for actually saving your upload. Common pitfalls:

  • Do not select the wrong archive! In particular avoid choosing the original exam.zip skeleton.

  • After uploading check for solution_1.zip being visible in the examination system.

  • You may upload multiple versions i.e. solution_2.zip etc. . Only your least uploaded archive will become subject to marking.

  • When approaching examination ending time check your input for completeness.

  • Projects residing just on your local workstation cannot be recovered after exam termination.