Multiple Personality Quiz

This quiz has no right and wrong answers. Instead each answer belongs to one of four different "personalities". A separate count of the number of answers selected for each "personality" will be kept and at the end one of fifteen different results pages will be displayed depending on the number of answers in each "personality". This script doesn't necessarily identify one "personality" but may produce a combined result if the results for two or more personalities are relatively evenly split.

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. pquizhead.js).

Question:
Personality A Answer
Personality B Answer
Personality C Answer
Personality D Answer
This entry contains HTML code.
 
Results Page Prefix: [abcd].htm

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

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

Step Three - select the JavaScript in the following textarea and save it as pquizbody.js.

pquizbody.js

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

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

Step Five - the quiz redirects to an answer page at the end of the script with the specific answer page it redirects to being determined by the answers selected during the quiz. The answer pages will all start with the value you entered as analPage in the first form and will have between one and four of the letters a, b, c, and d on the end. So if you entered 'quizresult' as the prefix for the page names the fifteen pages you need for the results are quizresulta.htm, quizresultb.htm, quizresultc.htm, quizresultd.htm, quizresultab.htm, quizresultac.htm, quizresultad.htm, quizresultbc.htm, quizresultbd.htm, quizresultcd.htm, quizresultabc.htm,quizresultabd.htm, quizresultacd.htm, quizresultbcd.htm, and quizresultabcd.htm. The first four of these will be displayed if over 50% of the answers were in the one personality. One of the next six will display if over 75% of the answers were in just two personalities and one of the following four will display if the personality not listed got less than 13% of the answers. The last page will display if the results are too evenly split to display any of the others.

 

This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow
Donate