Steverz
Aug 9th 2007, 10:44 am
I have an HTML page I am creating. It will contain a large list of questions to be answered. For here though, I will shorten it for simplicity.
The HTML page for this example will have two columns and ten rows. If the User answers the question correctly, then the background color in the answer cell (the rows in the first column) will change to Green. If the answer is wrong, then the background will change to Red.
In this example let's say that we have 10 questions to answer T or F (ture or false). Answers for questions 1,2,5 and 9 are to be false and the others true. How would that be coded? So, if a User answers questions 1,2 correctly then the backgound in the answer cell of the table will change to green while the background for the incorrectly answered question of 5 and 9 would be red. Hope this is clear.
Here are a few examples:
Question 1 is to be True and the User types in T. The background color behind the T now changes to Green.
Question 2 is to be True and the User types in a F. The background color behind the F is to change to Red.
Question 3 is to be False and the User types in a F. The background color behind the F is to change to Green.
Question 4 is to be False and the User types in a T. The beckground color behind the T changes to Red.
As you can see, if the User types in the correct answer, the background color changes to Green. If they type in an incorrect answer, the background color changes to Red.
I do not know alot about Javascript so alot of help on this code is greatly appreciated.
The HTML page for this example will have two columns and ten rows. If the User answers the question correctly, then the background color in the answer cell (the rows in the first column) will change to Green. If the answer is wrong, then the background will change to Red.
In this example let's say that we have 10 questions to answer T or F (ture or false). Answers for questions 1,2,5 and 9 are to be false and the others true. How would that be coded? So, if a User answers questions 1,2 correctly then the backgound in the answer cell of the table will change to green while the background for the incorrectly answered question of 5 and 9 would be red. Hope this is clear.
Here are a few examples:
Question 1 is to be True and the User types in T. The background color behind the T now changes to Green.
Question 2 is to be True and the User types in a F. The background color behind the F is to change to Red.
Question 3 is to be False and the User types in a F. The background color behind the F is to change to Green.
Question 4 is to be False and the User types in a T. The beckground color behind the T changes to Red.
As you can see, if the User types in the correct answer, the background color changes to Green. If they type in an incorrect answer, the background color changes to Red.
I do not know alot about Javascript so alot of help on this code is greatly appreciated.