1. Tech

Your suggestion is on its way!

An email with a link to:


was emailed to:

Thanks for sharing About.com with others!

Multiple Choice Quiz Maker

1. Question/Answer Script

Do you want to add a multiple choice quiz to your web page? This quiz uses the Javascript Document Object Model to dynamically insert one or two or even more quiz questions into a web page wher ever you want simply by placing an appropriate number of div tags in the body of your page where you want the questions to go. It also provides sufficient id and class names to allow you to change the appearance of the quiz to suit your own requirements.

You can also easily set up multiple quizes with this script without having to know any Javascript as the following instructions will take you step by step through all that you need to do to create your quiz and add it to your page.

Let's start by defining your questions and answers. We'll do this using the following form to create a Javascript file. To start, you simply enter a quiz question and between two and six answers indicating which answer is correct and press the "Add Question" button (if the advertising scripts on this page stop the form from working then use this copy of the form). The code for your script including all of the questions and answers you have entered so far will appear in the textarea below the button. Simply repeat the process until you have entered all of the questions and answers for the multiple choice quiz questions that you require.

Answer One
Answer Two
Answer Three
Answer Four
Answer Five
Answer Six

Once the above textarea contains all of your questions and answers you can use the "Highlight All" button to select all of the code and copy and paste it into a separate file. You can give this file whatever name you like as long as it ends in .js (for the example quiz I called this file quizqa1.js). The only change that you may want to make to the code in this file is to change the number of questions to display on each page by changing the 2 in the last line to 1 if you want to put each question on a separate page or to a higher number if you want more than two questions per page.

The next step is to set up a second Javascript file containing the multiple choice quiz script code that will display the quiz. NEXT >>

Related Video
Make a PowerPoint Multiple Choice Quiz
Excel Autosum Function

©2016 About.com. All rights reserved.