Home

Ham Radio Test

Motivation

I've been meaning to develop a generic multi-choice application in XQuery/XSLT, both as a teaching example and to use for revison. One of my exams uses multiple-choice questions and the students would welcome more practice. I don't need a fully-fledged grading system, which Blackboard provides anyway, so a simple interface to let students check their own understanding will be useful.

Background

WA5ZNU has formated the question bank for the Ham Radio Technician Test into XML and then used XForms with Alain Couthures XSLT implementation to create an interface to the questions which allows the reader to page through the question bank and to either see or hide the correct answers.

Restructured XML

There are a few improvement which can be made to the original XML:

I had to make a few hand edits to insert missing hyphens in a few places

Leigh (WA5ZNU ) took these suggestions on hand, edited the XML for a few more typos and that is now the version in use here.

XSLT Implementation : Version 1

This approach uses XSLT with the Saxon engine and XQuery running on the eXist database. XQuery is used here only to connect the XML file , the XSLT script and any parameters from the URL.

Transformations are done on the server whereas the XForms approach uses the Browser only. However if the platform is available, XQuery/XSLT offer some advantages. In particular the site is searchable and linkable.

The specific question group displayed is set by a parameter to the XQuery script.

XQuery/XSLT implementation : Version 2

To allow the viewer to reveal the answer to a chosen question, I added hide/show coding (XSLT & JavaScript).

Index

We can generate an index of the Groups in the Question bank with XSLT and apply this server-side or client side (since it is un-parameterised)

Marking

Adding a form and some radio buttons to the Question sheet, and doing a little XQuery to get the answers gives us an interactive quiz.

Generalization

The XML format will do for other quizes as well. In fact there is no dependency on the number of responses so they are not restricted to be exactly 4 or the same number for each question. The main change is parameterization of the location of the XML question bank document. The subElement /Group terminology will need parameterising too.

Care is needed over the scoping of identifiers. In the Radio test, all ids (SubElement, Group and Question) are unique within the question pool. There are places where this property is used but Question id could be local to a group without much (or any change).

To do