HTML Exercises

Setup

Download this teachpack: webpages.scm for use with these assignments. Use Language|Add Teachpack... once you've downloaded the teachpack.

Teachpack Documentation

Note: you do not need all of these operations for each assignment.

An xexpr is either:
 
- (cons symbol 
        (cons (listof (list symbol string))
              (listof xexpr)))
- string
- symbol
final:xexpr -> nothing
Shows the xexpression in your web browser
web-dialog:(web-dialog ([(names ...) <xexpr>] ...) <body>)
Sends the <xexpr> to the browser and extracts the results, binding them to the names. Each <input> in the xexpr must be matched with a name in names.
 

Adapt the code from lecture for the following 3 questions.

1.1 More Kinds of Questions

Extend the question data definition to support both binary questions and questions with three alternatives. In the new kind of question, allow the alternatives to vary from question to question (unlike the boolean questions which are always "yes/no" questions). The correct answer must not be in a fixed position.

The changes to the data definition should guide your modifications to the code below!

1.2 More Questions

Bring your quiz up to 10 questions. Include these two questions (plus, of course, the two from class; you make up 6 more):

1) What was the last state to join the United States?

  • Alaska
  • Hawaii
  • Guam
(Hawaii is correct -- altho Guam might be correct some day)

2) What is read and black and white all over?

  • A newspaper
  • A bleeding zebra
  • What a stupid question
(the first is correct -- or, if you want, the third... but the second is wrong)

1.3 Status

Extend the quiz code from class to show the number of questions so far and the number correct so far on each question.

 
Robby Findler