Test Format

A test file consists of an file of arbitrary HTML, with XML-style annotations (modified to use {} delimiters instead of <>) embedded to mark elements of a test.

The format is specified by the following grammar in DTD:

<!ELEMENT test ( title, prologue?, item+, epilogue? ) >

<!ELEMENT title ( #PCDATA ) >

<!ELEMENT item ( question, answer+ ) >

<!ELEMENT question ( #PCDATA ) >

<!ELEMENT answer ( #PCDATA ) >

<!ATTLIST answer correct ( true | false ) "false" >

<!ELEMENT prologue ( #PCDATA ) >

<!ELEMENT epilogue ( #PCDATA ) >
To allow for whitespace markup, any HTML between an end tag and a begin tag is ignored in the ultimate output.
To make things concrete: below is HTML source for a sample test. Note that <p> has been added in a number of places simply so that the test file will display as HTML more pleasingly than if all the test text ran together.

See how the annotated test source file displays as HTML.

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
  <head>
    <title>Sample Test</title>
  </head>

  <body>
    <h1>Sample Test</h1>

    Below is a sample test:

    <p>
    {test}
      {item}
        {question}
          What is the <em>minimum</em> speed limit?
        {/question}<p>

        {answer correct="true"}
          45
        {/answer}<p>

        {answer}
          55
        {/answer}<p>

        {answer}
          65
        {/answer}<p>

        {answer}
          70
        {/answer}<p>
      {/item}<p>

      {item}
        {question}
          What <a href="http://www.worldtime.org">time</a>
          is noon?
        {/question}<p>

        {answer}
          10:00
        {/answer}<p>

        {answer}
          11:00
        {/answer}<p>

        {answer correct="true"}
          12:00
        {/answer}<p>

        {answer}
          1:00
        {/answer}<p>
      {/item}<p>

      {item}
        {question}
          What has four sides?
        {/question}<p>

        {answer}
          Triangle <img alt="Triangle"
          src="http://peb.cs.cmu.edu/icons/TRIANGLE.GIF">
        {/answer}<p>

        {answer correct="true"}
          Square <img alt="Square"
          src="http://peb.cs.cmu.edu/icons/SQUARE.GIF">
        {/answer}<p>

        {answer}
          Circle <img alt="Circle"
          src="http://peb.cs.cmu.edu/icons/CIRCLE.GIF">
        {/answer}<p>
      {/item}<p>
    {/test}<p>

  That was the test.
  </body>
</html>