Download Perl Scripts

Questionnaire 50706-1201Questionnaire - $0 Version 50706-1201
Add to Cart



back
download
support
demo/see it work
RSS Feed
_______________________________________

Questionnaire by Intelliscript.net
(c) 2004 CrookedBush.com Inc. and Jason Silver
All Rights Reserved

_______________________________________

This script allows you to put multiple quizzes and questionnaires on your site.
Just use one script for multiple quizzes. It's easy to set up and your visitors
will love it.

Report any bugs or improvement suggestions to jasonsilver@crookedbush.com.

Yours,
Jason Silver

_______________________________________
Overview:
--------

How It Works:

Create a separate .cgi file for each quiz, then call the quiz using the format:

http://www.yourserver.com/cgi-bin/questionnaire.pl?q=../path_to/the_quiz/name_of_quiz

The user's browser and your server will collect the answers and either evaluate them
or email you the results--- or both!


_______________________________________
Installation Overview:
-----------------------
1. Set some options at the beginning of the scripts
2. Use FTP to upload the files
4. Set exectute permissions on the Perl script, and write permissions on the
text files
4. Test the script

_______________________________________
Here's How!
-----------

1. Using a text editor like textpad, or notepad, open the .pl file(s)
Change the path to perl so that it's
configured for your server.
It's usually:
#!/usr/local/bin/perl
or
#!/usr/bin/perl

2. Change the variables,

For example,

$emailprog = '/usr/lib/sendmail'; # your mailer program...
$from_address = 'youradminemail@yoursite.com'; # this address is only for admin purposes.

3. You may optionally change the header and footer information in the questionnaire.pl
script. This information is near the bottom. If you are unfamiliar with editing Perl
scripts then this probably is not a good idea.

4. Use an FTP program like WS_FTP or CuteFTP (just some examples I'm aware of)
and upload the files to your server's cgi-bin.

5. Set permissions (CHMOD):
.pl files: 755
.cgi files: 777, or 766 if 777 is not allowed.

NOW, TEST IT:

6. From a browser, open the .pl file and call one of the sample quizzes.

------------------------
SETTING UP YOUR OWN QUIZ
------------------------

Create a text file for the questions, using the following as a template. Save it as your_quiz.cgi
but use your own filename. Upload it to your server.
------------------------

[settings]
title=Title of Your Quiz
summary=Summary of your quiz<br>All on one line, using HTML for line breaks.<p>You may use <b>bold</b> and other tags.</p>
mailto=Name of Person who Gets Results <youremail@yourserver.com> Leave this blank if you wish.
email_results=0 but make it 1 if you want results mailed to above address.
closing=Thanks for filling out the Quiz.<br>Yours,<br>The Staff
total_summary=Red,3&Blue,1&Yellow=1&Green=3 This means answers are worth points...


[questions]

Each question starts with a q, then the question number, then options.

q1=This is the question, such as what is your favourite colour?
q1Type=radio
q1Len=0
q1Size=2
q1Req=1 This is 1 because it is a required response.
q1Opt1=Red
q1Opt2=Blue
q1Total=Favourite Things

q2=Tell me about yourself, use detail.
q2Type=memo
q2Len=0
q2Size=15
q2Req=1

q3=What is your full name?
q3Type=text
q3Len=100
q3Size=15
q3Req=1

q4=<br><b>This could be a HEADING</b><br><br>4. And you put in a fake number here. What's your favourite candy colour?
q4Type=radio
q4Len=0
q4Size=4
q4Req=0
q4Opt1=Red
q4Opt2=Blue
q4Opt3=Yellow
q4Opt4=Green
q4NoNum=1 Then make sure no num is turned on so the number isn't repeated.
q4Total=Favourite Things
q4Factor=1.6363636363636363636363636363636 The factor is for offsetting sections for results that have differing numbers of questions.

There is now a new element in the INI file, which is called external_formula. It is set now to this:

external_formula=formula_subroutine.pl

Here's where you put it:

[settings]
title=Title of Your Quiz
summary=Summary of your quiz<br>All on one line, using HTML for line breaks.<p>You may use <b>bold</b> and other tags.</p>
mailto=Name of Person who Gets Results <youremail@yourserver.com> Leave this blank if you wish.
email_results=0 but make it 1 if you want results mailed to above address.
closing=Thanks for filling out the Quiz.<br>Yours,<br>The Staff
total_summary=Red,3&Blue,1&Yellow=1&Green=3 This means answers are worth points...
external_formula=formula_subroutine.pl

The script checks to see if there is a value to external_formula, and if there is,
it tries to open that file and run any code in it.

In this example, the value in external_formula is forumula_subroutine.pl. Open up
this file to see the example. You'll notice a place to evaluate your data and set up
your answers.

Each questionnaire can have it's own external_formula for doing complex math on survey results. You will need to understand some basic Perl programming to create these formulas. I can help if you need me to. If it's easy, I won't charge you (much).

As always, let me know of problems, questions, or requests for features.
Jason Silver


_______________________________________
www.CrookedBush.com




 
top next download faq demo/see it work xml pad file RSS Syndication OPML List - All Programs



[admin]

FileCABINET Script - Create a File Download section on your site.

In the Spotlight

COTCHA $0.00
Add to Cart
 COTCHA is an acronym for Coded Objective to Tell Computers and Humans Apart. Similar to the CAPTCHA scheme, this script can be integrated into any pre-existing web form and/or perl script to add an extra element of spam protection.
[more & download links]

What People Say

Crossword $5.00
Add to Cart I really like the new feature to adjust the score and it works much better as well.. Thanks for the updates on that!
Marie Alline
[more & download links]

Post Page Comment