





|
Web Trivia
The web trivia applet allows
webmasters to add a trivia game to their web site. This version includes a tagline at the
bottom of the applet mentioning this web site. For a version without the tagline, e-mail
orders@codevision.com.
Follow these steps to add the web trivia applet to your web page:
- Download (right-click or option-click and "save target as") the
TriviaApplet.jar file.
- Download the trivia.txt file.
- Change the questions and answers in the trivia.txt file, making sure to keep the
same format. (All items end with a "~". A question is all on the same line and line starts with "Question:",
Answer "a. " is on the next line, "b. " is on the next, then "c. " on the next line
and "d. " on the next line. The letter corresponding to the correct answer is the next line.
Finally the 7th line
contains a line to be displayed to the user when they answer. This is repeated for
each question. There must be at least 20 questions, but could be many more.
- Upload the TriviaApplet.jar and trivia.txt file to the web server.
- Include a modified version of the following code to your web page:
<applet code="TriviaApplet.class" width=480 height=360 archive="TriviaApplet.jar" codebase="http://**web address of
TriviaApplet.jar**">
<param name="dataurl" value="http://**web address of the trivia.txt file**">
<param name="title" value="**Title to appear in the trivia game**">
<param name="background" value="255,255,255">
<param name="foreground" value="0,68,119">
<param name="font" value="Times, plain, 12">
<param name="titlefont" value="Times, bold, 18">
<param name="width" value="360">
<param name="message18" value="**Message if user gets 18 to 20 answers right**">
<param name="message14" value="**Message if user gets 14 to 17 answers right**">
<param name="message9" value="**Message if user gets 9 to 13 answers right**">
<param name="message0" value="**Message if user gets less than 9 answers right**">
</applet>
The only required parameters are dataurl, width, and the message parameters. Default values are
used if the other parameters don't exist. Foreground and background expect a number for red,
green, and blue. The font paramenters expect the font name, followed by style (plain, bold, or
italics), and point size.
|