View Full Version : function for a quiz

04-17-2005, 06:56 PM

It's a bit difficult to explain what I need but I'll try.

There is a quiz that I have to make. It's of a map of an image, and the client must click on a number (19) of parts of the picture. On every clicking on the left must appear a note saying for example: "You have found 11 so far".

When the client finishes he must click on the "next" button and on the other page a result has to be displayed - for example: "You have found 11 damages".

The only thing that occured to my mind was a function that starts with the onClick function of every part of the mapped image (function quiz(x))but as far as the parts to click on are 19 the function "quiz(x)" happend to be so long because it has to check first if the person already clicked on this image, and second which image on count is it. So the function is about 2000 rows of script and I don't think this is normal.

If you have any idea of another way to check the answers, please let me know.

P.S. The "You have found 11 so far" I've made as 19 .gif images, because I don't know any other way to do it.
Also I must not use Java, just Java script.

Harry Armadillo
04-17-2005, 08:01 PM
Post a link to the page or attach a zip-file with your code, because without seeing what you've done it's difficult to comment.

But... 2000 lines of script does sound horribly bloated.

04-17-2005, 08:11 PM
I already found a sollution, Thanks anyway!

Best regards