Optical Mark Reader System based on SVG Print

Using the SVG Print Document as a container of OMR form metadata


Table of Contents

Introduction
Designing an OMR Form Document Markup Language
Requirements Overview
Possible Designs
Selected Design
Shared Questionnaire System
SQS SourceEditor
SQS MarkReader
Conclusion
Acknowledgment
Bibliography

Optical Mark Reading (OMR) is a traditional method for capturing human-marked data from document forms such as surveys and tests. Today, OMR is still a good choice for situations where there is no network connectivity or electricity supply, or where no desktop PCs, PDAs or smart phones are available. OMR systems only require a printer to make a hard copy of the form document, and an image scanner to optically scan answers.

Questionnaire surveys using OMR continue to be useful. They will coexist with web form questionnaires. SQS was developed as a proof-of-concept application to demonstrate the separation of presentation and content for form documents using OMR technology.

OMR software users are reluctant to risk vendor lock-in, because most OMR software has its own proprietary data formats for describing the logical structure and display elements of scannable form documents. To make matters worse, there is no common data format between different OMR software. Therefore, in this section, I propose a new OMR form document markup language as a common data format using the best of XML standards.

As for interoperability, an OMR form document should be some kind of XML instance using a subset of XML standard vocabularies and schemes.

OMR software should be designed for web-aware and transmedia questionnaire surveys, so that the questionnaires in OMR form documents can be easily translated into an HTML form, and answered through a web interface.

An OMR form document is a collection of OMR form elements, such as single, multiple or free answer questions. To markup OMR form elements, form control elements in XHTML or XForms may be usable.

On the other hand, as a host language, there are two possible categories of XML standards: source documents and result documents.

  • Structured document as source document:

    An OMR form document can be an extension of a structured document which has a hierarchical composition of logical elements: body, section, header, paragraph, list, table, inline image, and so on. Some kind of XHTML, DocBook and OpenOffice Writer are suitable as the host language of the OMR form document. In this case, the OMR form markup language is based on a design concept of separation of presentation and content.

  • Visual representation in print media as result document:

    An OMR form document must have a visual representation in print media as a set of two-dimensional vector graphic primitives to be printed on paper. OMR form elements in logical structures are also rendered as groups of 2D primitives. Geometric information of the answer area is used to process the questionnaire. A visual representation of OMR form documents can be created with typesetting systems or WYSIWYG editors. The possible host languages for markup of the visual elements include SVG Print, PDFXML, XPS, and OpenOffice Draw.

The elements in the logical structure must be transformed and typeset into two-dimensional vector graphics before printing. There are XML transforming and typesetting technologies that invoke W3C standards, such as XSLT and XSL-FO. A structured document can be translated into an XSL-FO document with XSLT, and typeset into a page model representation with an FO processor.

It is important to make initial layout of OMR form document contents in page model. There are two methods to make initial layout: automatic layout with typesetting and manually layout with WYSIWYG editor. The typesetting has advantage to manual layout. That is because the OMR form elements in structured document context are automatically bound to visual objects in page model context.

I developed two SQS applications as OMR form document processors: "SQS SourceEditor" as an OMR document editor, and "SQS MarkReader" as an OMR form engine. They are signed JavaWebStart applications distributed under the Apache License, Version 2.

SQS SourceEditor is an OMR document editor based on the OMR form document language. Figure 1, “SQS SourceEditor” shows the GUI looks like an outline editor with customized node icons and node editors; it can handle multiple DOM trees of XHTML+XForms documents with multiple tabs.


The quick export buttons, located in the toolbar, produce visual representations of OMR forms using the XSL-FO engine. The export result is a combination file of SVG Print and PDF document; an SVG Print file with OMR form metadata is attached to a host PDF file. Figure 2, “Translation of an OMR form structured document to its visual representation” shows a translation system of an OMR form structured document to its visual representation. Figure 3, “A visual representation of a question” shows an example of typesetted questionnaire text and answer areas. An answer area is in the dotted elliptical line. Figure 4, “The export result, a combination file of SVG Print and PDF document” shows that SVG Print file with OMR form metadata which has an ".sqm" extension. It is attached to a host PDF file.




To produce the SVG Print file, I made a quick hack on Apache FOP to build an SVG Print document when rendering PDF objects.

This SVG Print document is not used as the print source for the document, but as the container of processing information for the OMR engine to read answer areas at a later phase.

A structure of an SVG Print document exported by SQS SourceEditor is described below.

An <svg:page/> element is a representation of single page of an OMR form document. When a visual representation of form control is rendered as a PDF object, a set of <svg:g/> elements is created to specify a rectangle of each OMR answer area to be read. Each <svg:g/> element has <svg:rect/> and <xforms:select/> elements, as the same number of selectable answer items. It is to be described as OMR answer areas. Attributes with ".sqs" prefix are used to preserve the original context of the form control.


  ...
  <svg:page>
    <svg:g id="mark1-1">
      <svg:rect x="61.0" y="176.93902587890625" width="5.0" height="16.0">
        <svg:metadata>
          <xforms:select xforms:ref="answer[1]/mark[1]"
             sqs:qid="1" sqs:itemIndex="1" sqs:prev-xform-type="select1">
            <xforms:label>(1)</xforms:label> 
            <xforms:hint>Do you agree or disagree?: XHTML 2 Working Group expected to stop work for increasing resources on HTML 5.</xforms:hint> 
            <xforms:item>
              <xforms:label>agree</xforms:label> 
              <xforms:value>1</xforms:value> 
            </xforms:item>
          </xforms:select>
        </svg:metadata>
      </svg:rect>
    </svg:g>
    <svg:g id="mark1-2">
      <svg:rect x="230.09100341796875" y="176.93902587890625" width="5.0" height="16.0">
        <svg:metadata>
          <xforms:select xforms:ref="answer[1]/mark[2]"
            sqs:qid="1" sqs:itemIndex="2" sqs:prev-xform-type="select1">
            <xforms:label>(1)</xforms:label> 
            <xforms:hint>Do you agree or disagree?: XHTML 2 Working Group expected to stop work for increasing resources on HTML 5.</xforms:hint> 
            <xforms:item>
              <xforms:label>disagree</xforms:label> 
              <xforms:value>2</xforms:value> 
            </xforms:item>
          </xforms:select>
        </svg:metadata>
      </svg:rect>
    </svg:g>
    ...

In this paper, I proposed an integrated OMR application, named SQS, which is based on the W3C standards for document system for printing: XSL-FO and SVG Print.

SQS is carefully designed to provide a straightforward and easy-to-use OMR form application. It is a proof-of-concept demonstrating the separation of presentation and content for the OMR form document.

Through typesetting, an OMR form document is presented, and a set of OMR form metadata is produced. The presentation is produced as a ready-to-print PDF document. The OMR form metadata is produced as an SVG Print document, which describes the geometric information of the answer area, allowing the answers to be read by the OMR engine.

This research was supported by the Exploratory Software Project (MITOH Program) in 2007, which was conducted by the Information-Technology Promotion Agency(IPA), Japan.