[thelist] Markup for a Quiz

Maximillian Schwanekamp lists at neptunewebworks.com
Fri Dec 24 02:48:24 CST 2004

Steve Axthelm wrote:
 > Definition lists perhaps?

Rosalie Sennett wrote:
> Definition lists will not not give you the letters and numbers. You need
> Ordered lists. You must nest them so that your questions will continue
> numerically and the answers will keep starting over.

Yeah I thought of that, but it seemed to me that a group of possible 
answers to a question, though customarily presented with alphanumeric 
tokens, are not really a sequence per se; In the context of a web app, 
where the user isn't responsible for passing the unique identifier from 
the test to an answer sheet, the letters and numbers would just be 
presentational (to emulate the look of a paper test). Thus an ordered 
list seems to me inappropriate.

Definition lists, which have a term plus a number of separate 
definitions for the term seemed to me closer to the mark for the 
questions and possible choices, but I'm using radio buttons which are 
grouped with labels...  What was tripping me up was that I was thinking 
I would need to put the fieldset around the DDs alone, which would be 
invalid.  The Duh! moment came when I realized I could put the entire DL 
inside the fieldset and all would be well.   I came up with this:
<h1>Site title</h1>
<h2>Section title</h2>
<h3>Course Exam</h3>
<form action="test.htm" method="post" name="form1" id="form1">
     <h4>A Chapter</h4>
     <p>Some intro text about this chapter and the questions for it.</p>
         <h5>Question 1</h5>
             <dt>What is the first letter of the alphabet?</dt>
             <dd><label for="q-1-1"><input type="radio" name="q-1" 
id="q-1-1" value="a" />A</label></dd>
             <dd><label for="q-1-15"><input type="radio" name="q-1" 
id="q-1-15" value="b" />B</label></dd>
             <dd><label for="q-1-274"><input type="radio" name="q-1" 
id="q-1-274" value="c" />C</label></dd>
The UL is there because the "Chapters" aren't necessarily chapters, but 
may be a group of articles or other non-sequential topic areas.

Thanks for the input!

Maximillian Von Schwanekamp
Dynamic Websites and E-Commerce
NeptuneWebworks.com <http://www.neptunewebworks.com/>
voice: 541-302-1438
fax: 208-730-6504

More information about the thelist mailing list