Topic: Marking up a quiz

Quick question:
I'm a stickler for semantic markup... is there a way that anyone has had success marking up a quiz in the past aside from just using form elements? My first thought is to use a definition list, but I'm open to other options.

The quiz has a simple format:
Question:
- Answer Possibility 1
- Answer Possibility 2
- Answer Possibility 3

Here was my thought about marking it up

<dl>
<dt>The Question:</dt>
<dd><input name='q1' type='radio' id='q1a' value='a'/><label for='q1a'>Answer A</label></dd>
<dd><input name='q1' type='radio' id='q1b' value='b'/><label for='q1b'>Answer B</label></dd>
<dd><input name='q1' type='radio' id='q1c' value='c'/><label for='q1c'>Answer C</label></dd>
</dl>

Last edited by JBChris (2008-07-16 11:04:35)

Web Developer - AM Design | I specialize in XHTML, CSS, PHP and jQuery

Re: Marking up a quiz

I've seen a handful using tables, just for form layout.
But I like your idea of a DL for each question, with term (question) and DD (answer elements).

Looks good to me.

Re: Marking up a quiz

I've never thought about it before - but the dl sounds like a decent semantic solution to me...

Daniel Marino | www.iamdanielmarino.com

Re: Marking up a quiz

Not sure if you've seen this already, check out the Accessible Quiz by Mike Fossett at WebSemantics.

"Change is inevitable, growth is intentional" - Glenda Cloud

Re: Marking up a quiz

Except that, by definition (har har), quizes aren't really terms and definitions. I would say that the DL would be a good idea though, if you're not opposed to straying a slight bit from true semantics.

Re: Marking up a quiz

I like the look of the <dl> as well.  Also nice styling wise.

James Cooper --  God loving, banjo playing, geek!