Personality Quiz Maker
4. Add the Quiz
Join the Discussion
More of this Feature
Question/Answer Script Main Quiz Script Stylesheet Results Page Random Quiz Addon
Now that we have created three files (one Javascript containing your quiz questions and answers, a second Javascript containing the quiz script itself, and a stylesheet file defining how your quiz should look) all that remains is to add the actual script into your web page.
There are two pieces of HTML that you need to add to your page to add a quiz to the page. The first piece of code goes in the head of the page.
<script src="quizsp.js" type="text/javascript"></script>
<link rel="stylesheet" href="quizp.css" type="text/css">
If you have qiven your files different names when you created them then simply change the filenames within the above code when you add it to your page so that it references the three files by the names that you gave them.
With that added to the head of your page the quiz script will be run just as soon as it can work out where in the page that it should display the quiz. To tell the quiz where to display the two questions that it displays on each page we just need to insert two div tags into the body of the page where we want the questions to appear. (Of course if you changed the number of questions to display one each page from 2 to 1 then you must only add the first div as adding the second will get the quiz confused).
<div id="quiz2"></div>
The final task now that we have our quiz page done is to set up the results pages. NEXT >>

