################################################################ Quiz v1.0 by Tom and Linda Myro da@cyber-nurse.com Copyright 1998 Tom and Linda Myro -- all rights reserved Use and modification permitted for any good purpose, providing that you agree to hold Tom and Linda Myro, and Cyber-Nurse.com harmless in the even of any disaster, real or imagined, resulting from the use of this software. ################################################################# ################################################################ Quizmaster v1.0 by Tom and Linda Myro da@cyber-nurse.com Copyright 1998 Tom and Linda Myro -- all rights reserved Use and modification permitted for any good purpose, providing that you agree to hold Tom and Linda Myro, and Cyber-Nurse.com harmless in the even of any disaster, real or imagined, resulting from the use of this software. ################################################################# Quiz..an "easy" to use test and score script for any purpose Quiz was designed, like all of our scripts, to need minimal configuration within the perl script. Quiz allows for up to 25 questions (multiple choice works best) the entire output of the cgi script is controlled by the HTML form VIA hidden form fields. Quizmaster is a separate script, which simplifies (greatly) creating new quizes, by generating the HTML file for you, from a few questions in some web forms. Together, Quiz and Quizmaster would allow you to rapidly create an number of Quiz pages on your server. ############################################################# Quizmaster v1.0 Installation instructions ############################################################# 1) Create a directory somewhere where you have all of your HTML pages, this will house all of your quiz HTML pages...something like: /home/username/www/quiz 2) CHMOD this directory to 0777 3) Make sure the top line points to PERL on your server. 4) Set your password to whatever you'd like: $password = "whatever"; 5) set $quizmastercgilocation to the url of the quizmaster script. $quizmastercgilocation = "http://www.yoursite.com/cgi-bin/quizmaster.cgi"; 6) set $quizhtmldirectory to the full path of the quiz HTML directory you created in step 1. $quizhtmldirectory = "/home/username/www/quiz"; 7) Set $quizhtmldirectoryurl to the url of this same directory: $quizhtmldirectoryurl = "http://www.yoursite.com/quiz"; 8) Send quizmaster.cgi up to your cgi-bin (making sure you put it in the directory you specified in step 5), and CHMOD it to 0755 That's it. ############################################################# Quiz v 1.0 Installation instructions: ############################################################# Set the top line of quiz.cgi to the location of perl on your server. Set the location of sendmail on your server. It should look something like this: $sendmaillocation = "/usr/sbin/sendmail": Set the URL of the quiz.cgi script. Something like: $thisscripturl = "http://www.yourserver.com/cgi-bin/quiz.cgi"; Put the quiz.cgi file in a directory that can run cgi scripts (like your cgi-bin). Set the permission of quiz.cgi to 755 like: chmod 0755 quiz.cgi ####################################################################### USING QUIZv1.0 By Itself (without Quizmaster) ####################################################################### You need to create an html page for any quiz you might want to run on your site. I've included a template (quiz.htm) here for you to use, but I'll go over it part by part. Start your HTML page, the way you normally would, with the Title information and the tag attributes. Put any HTML you wish at the top of the page you need a
tag, with the action pointing to the url of quiz.cgi, and post as the method..like: Now make a bunch of HIDDEN input tags to control the output of quiz.cgi The NAME attributes must remain as listed, but the VALUE attributes must be changed to suit your needs and tastes. One for the title of you quiz One to choose whether to use a bgcolor or wallpaper in the cgi output 0 is for wallpaper, 1 is for bgcolor This one provides the bgcolor, by name This one provides the url of the wallpaper This one provides the text color for the cgi pages This one provides the link color This one provides the visited link color This one provides the active link color This next one must stay exactly as is: This one tells the script the number of questions in your quiz You need to make these, to tell the script the right answers to your quiz, you'll need one for each question, and the value must be IDENTICAL in EVERY way to the answer the user provides.. hence, when you make the form inputs for the quiz answers, we recommend using radio buttons, or drop down boxes, rather than text boxes Make one of these for each question, with the NAME attribute of q1ans - q25ans, depending on the number of questions in your quiz..thusly: etc.............. The next three are kind of a "congradulatory message" depending on how well the user did. You need to make 3 of them, This one is for 50% or less: This one is for 50-80% This one is for 80% or better The next two are for mailing the quiz results to someone Choose whether or not to email the results set to 0 for no, and 1 for yes. Put the email address of the inteded recipient here The CGI puts a "return link" at the bottom of its pages Put the return link url here Put the linked text for the return link here The next part is the part of the form the user sees quiz.cgi emails you with the users information..so You need text boxes for their name and email address now the questions.. Put your questions in whatever style you like, but for the user to provide answers, you need to make either an array of radio buttons, or a drop-down box. You need to make one of these for each of your questions, using the name attributes of q1res - q25res, depending on the number of questions, and question number A drop-down box would look like this The second one needs to look like this: default choice here another choice etc...for each question..... create a new array by changing "q1res" to "q2res" etc.... Almost done.. put in a submit button and end your form
Now you can add whatever HTML you like, and end your page in the usual manner. That's it.. Hope you find quiz useful. --Tom and Linda Myro