1. Home
  2. Computing & Technology
  3. JavaScript

Alternate Analysis Quiz

5. Analysis Body Script

Depending on the number of questions in your quiz and the distribution of values between the various answers the exact meaning of the different percentage values that are obtained by people doing your quiz will almost certainly be different from that of every other quiz. You will have to decide therefore what the different percentage ranges for your results are to be and what is to be displayed for each range.

The final step in creating your analysis quiz is to define the results to be displayed for each percentage range. The following form allows you to have up to four different results that will be selected to be displayed based on the percentage value obtained from the quiz. All that you need to do is to enter the possible results and the boundary conditions that separate them into the form below.

If you know HTML then you can use that to format your results. If you don't know HTML then you can enter your results in plain text and the form will attempt to format it for you.

Results
Above answer when result is or less.
Above answer when result is or less.
Above answer when result is or less.
Above answer when result is 100 or less.
Result entries contain HTML.

Once you have finished entering your results, copy the code from the above text box and save it as a file called quizresb.js.

You now add this quiz to the body section of the page where the appropriate result is to appear using the following code:

<script src="quizresb.js"
type="text/javascript">
</script>
Quiz Head Script | Quiz Body Script | Comment Page Scripts| Analysis Head | Analysis Body
Explore JavaScript
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

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

All rights reserved.