Quiz Maker 3

The quiz Javascript on this page processes multiple choice quizes having four possible answers to each question one of which is obviously the correct answer and the other three being wrong. You can have as many questions in the quiz as you require subject only to the length of time that it will take to load the resulting web page.

Step One - Fill out the following form for each question that you want to contain within your quiz. Each time you press the "Add Question" button the code in the textarea immediately below will be updated to add the new question and answers to those you have already added to the quiz. Once you have all your questions entered highlight the content of the text area and copy/paste it into a new JavaScript file (eg. quizhead.js).

Answer One
Answer Two
Answer Three
Answer Four
Answer Page:
This entry contains HTML code.

Step Two - add the following code immediately before the </head> tag in the page where you want the quiz displayed.

<script src="quizhead.js" type="text/javascript"></script>

Step Three - select whether you want to only display the answer page if they get the question right or whether you want to always display the answer page and then copy/paste one of the following two scripts and save it as quizbody.js.

right only

Step Four - attach this script into the body of your question page where you want the quiz question to appear using:

<script src="quizbody.js" type="text/javascript"></script>

Step Five - as each quiz question redirects to an answer page we need to add some code to those answer pages to redirect to the next quiz question. To do this, first highlight and copy/paste the following styles into a separate file called quizans.js


We then attach this code to each answer page by placing the following immediately before the </body> tag.

<script src="quizans.js" type="text/javascript"></script>

We then simply add a link into each answer page to take people to the next question by placing the following somewhere toward the bottom of the page.

<a href="javascript:quiz();">Next Question</a>


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow