Quiz Me

Javascript

:Hits: 568
:Added On: 26 Jul 2008
:Rating:
A quiz for anyone with any amount of qustions and answers. Easy to customize.

Please enable javascript in your browser in order to participate in the quiz.

Score:

Notes

A. External JS File
You can choose to place the script in the head of your document or in an external .js file. Make sure that when inserting the head HTML, your source is the name of your .js file.
B. Adding Questions
One question is an array which consists of 3 or more values. These values are the question, followed by the numerical answer and as many options as you wish. They are to be enclosed with [] brackets. E.g. ['What is my question?', '3', 'A', 'B', 'C', 'D', 'E'] Following in the format of [question, numerical answer, options]. In the example, my numerical answer is 3 because the answer is C and C is the 3rd option - which means A is the first option. Edit under the first variable - quiz...
C. Customizing Explanations
Your explanation array must correspond to the question array. If your question is the 5th array, your explanation also has to be the fifth array. Edit under explain. It is self-explanatory. If you want to remove the explain function, simply remove the which surrounds .
D. Customizing End Message
At the end of the quiz, there will be a message to tell the participant that he/she has completed the quiz. You can edit that message at the endingmessage variable. Self-explanatory too.
E. Ideas For Customizing
You can always add an ajax function to submit the participant's answers and scores. I recommend putting a div(display:none) or hidden input to act as an answer holder. So every time the ans(); is triggered, the answer holder will be updated with new information, of course with additional javascripting. You can place an ajax function inside the }else{ of question(); where the quiz comes to an end.

Source

External Javascript File [quizme.js] . Head . Body
I am very interested to know who uses my scripts, for statistic purposes.
If you have the time, I would really appreciate if you could kindly fill in this form.
Please fill in all the fields so that the data will be saved. Thank you.
Name:
URL:
Rating:

Oldest to Newest

Comments

Name:
Email:
Website:
Comment:
By submitting your comments, you agree to the terms and conditions.