CIT041J Index > DHTML

CIT041J - DHTML

Read everything before doing anything.

Your task is to write a “flash cards” program that will display simple math problems for students and ask them to enter the answers.

Here is the page to start from. It contains the code for generating problems at random. Each problem will be stored in a variable named problemString. You have to write the functions that will display the problem, the score, and user feedback. The problem will go into the <span id="problem">. The feedback will go into the <p id="feedback"> and the score goes into the <p id="score">.

When you click “Check Answer” your script must check to see if the user’s response matches the correct answer. If so, you must update the score and give some positive feedback in green, as shown in the illustration below.

correct response

If the user’s response is incorrent, give appropriate feedback in red, as shown in the illustration below.

incorrect response

When the user clicks “Next Problem”, the user input area must be cleared out, the feedback must disappear, and the problem number must be updated.

This program allows you to try a problem as many times as you want; I could fix it, but that’s not the point of this assignment. The point is to use DHTML to update a page on the fly.