1. Home
  2. Computing & Technology
  3. JavaScript

Single Personality Quiz

3. Results Pages

Join the Discussion

Questions? Comments?

Now that we haver created our personality quiz, all that remains to be done is to create our six separate results pages. There is no actual Javascript required for these pages, all we actually need to do is to make sure that we create the pages with the right names for the script to call based on the selections within the quiz. The only limitation on the result pages is that they must all be in the same folder (directory), use the same prefix on all of the file names, and have the rest of the file names match that generated by the quiz.

When we set up the quiz we supplied a prefix for the results page name (it is the value assigned to resPage in the pquizhead.js script if you need to change it). For the purposes of this discussion let's assume that we used a prefix of quizresult (just substitute your actual prefix whereever I mention quizresult in the following discussion).

This version of the quiz will always select just one of the six personalities as the result (even if it has to make a random selection between equally high scoring totals). The names that our six answer pages will simply have a, b, c, d, e, and f added to the end of the prefix and so our pages will be (based on our prefix of quizresult).

  • quizresulta.htm
  • quizresultb.htm
  • quizresultc.htm
  • quizresultd.htm
  • quizresulte.htm
  • quizresultf.htm

You simply need to set up these results pages with appropriate content based on the meanings that you used when creating your answers for the six personalities in the first place.

The quiz script generator assumes that the results pages will be in the same folder (directory) as the quiz pages. If this is not the case then all you need to do is to add the appropriate path to the front of the resPage field in the head script to point to the folder where the result pages can be found.

Quiz Head Script | Quiz Body Script | Results Page

Explore JavaScript

More from About.com

  1. Home
  2. Computing & Technology
  3. JavaScript

©2008 About.com, a part of The New York Times Company.

All rights reserved.