Webinquiry
'Online inquiry feedback system'
1. What is Webinquiry?
Webinquiry makes it possible to automatically
create a data-file from inquiries on webpages. It was specifically designed
with inquiries in mind. This means that:
-
Submissions are anonymous
-
Unanswered questions are handled properly,
with a user-definable no-answer character
-
Webinquiry can handle both checked and un-checked
options for the one data-file: like in
Would you like to know more about [
] cookies, [ ] cakes, or [ ] pastry? (Please select options that apply)
-
Numerical data is stored in a separate file
from textual data for easy analysis
-
Data is stored in separated-values-list files.
The separation character can be set differently for each inquiry. The file
is compatible with the SPSS statistical package (use a tab as separation
character between each field).
-
One Webinquiry application can handle many
different inquiries
-
If you are working with many people who need
their own inquiry, Webinquiry will make Carbon Copies of the feedback files
for those people
-
Webinquiry automatically generates a data-file
the first time an inquiry is used
-
Error handling included
-
Submissions are responded with a owner-definable
HTML file that can be fetched from the owners folders
2. What are the questions?
The first thing you need to do when want to
make an online inquiry, is to define the questions you would like to ask.
Write down all those burning questions, you want to ask your readers. Specify
with each question what the type of the answers is: variable numbers (integers,
floating point), scales with ranges and intervals, text answers, etcetera.
Once you have done that, it is time to create the webpage with the questions.
3. Developing the form
in the webpage
We will create the webpage with HTML. Part
of HTML is a set of user interface elements, such as buttons, radio buttons,
check boxes, combo boxes and editable text fields. We will use the elements
to create preset answer possibilities with each questions.
--- under development --->
1. Start the form with stating: <FORM
METHOD="post" ACTION="http://myserver.domain/cgi-bin/my_inquiry.py">. Don't
point to webinquiry.py, it won't work.
2. After the <FORM ...> tag, on the
next line, place: <INPUT TYPE="hidden" NAME="inquiry" VALUE="place the
name of your inquiry as set in <myinquiry>.setName, see below, here">.
With this parameter, Webinquiry will know which template for the inquiry
to use. If you don't know the chosen name of the inquiry from Webinquiry
yet, just use a good title for the inquiry. The title must be unique to
your inquiry.
3. Place the statement for the end of the
form: </FORM>
4. Now, let's put in all the questions.
Take a good look at a primer on HTML if you want to make things perfect.
We need to place all these questions before the </FORM> tag, so let's
make some space before that line .... and start inserting the questions.
<--- under development ---
After a succesful submission, Webinquiry
can redirect a webpage as response to the inquiry submission. In this page
you can say thank you to the submitter or, perhaps, ask the next set of
questions. So, actually, you will need to design two webpages: one
with the inquiry form and one with the 'thank you message'.
When the webpages are ready, put them on
your website. E.g. place them in the directory where your website resides,
make the right link to the questions but leave the 'thank you message'
un-linked.
4. Setting up the Webinquiry
on the webserver
Now that the HTML page has been designed,
it is time to adjust Webinquiry on your webserver to make the system work.
This is typically a job for the webmaster. The distribution archive comes
with an example of an inquiry application.
Let's go through each of the statements
one by one;
You need to use the [REQUIRED] statements
with each inquiry you define.
-
<myinquiry> = webinquiry.Inquiry()
With this statement, an inquiry object
is created, named <myinquiry>. This statement must be placed in the
script before any of the following statements. [REQUIRED]
-
<myinquiry>.setName("<myinquiry>")
name of the Inquiry form, must be unique
to this application. Does not need to be the same name as the name in the
first line (previous statement). This must be the same word that is used
in the hidden parameter 'inquiry' in the HTML form. [REQUIRED]
-
<myinquiry>.setFolder("C:/data/myinquiry/")
The location where the statistical data,
the stories and the response to the filled out inquiry are stored. Requires
trailing '/' or '\'. The webserver must have permission to write in this
directory. [REQUIRED]
-
<myinquiry>.setCCFolders([
"D:/backup/myinquiry/",
"Q:/john/courses/me23/"
])
Carbon copies of the Inquiry responses
are send to these folders, overwriting existing files, requires trailing
'/' or '\'. Defaults to no Carbon Copy folders at all.
-
<myinquiry>.setSepchar(",")
Sets the separator between each field
in the data-file, in this example a comma. Defaults to a comma if no separator
is set. SPSS expects a tab as separator, use "\011" in that case (the ASCII
number for a tab).
-
<myinquiry>.setEmptychar("")
Sets the character for a field that has
not been filled out by the person who has submitted the inquiry. Defaults
to no character at all, which is required by SPSS.
-
<myinquiry>.setVars([
['var1', 'variable 1'],
['var2', 'variable 2'],
])
This is the most powerful feature of Webinquiry.
This is the definition of variables that you want to be included in the
data-file, which normally excludes text like notes, remarks etcetera. Webinquiry
will filter out all other fields in the submitted inquiry and place them
in the stories file. Because Webinquiry knows which data to expect, it
will also know if someone didn't fill out a question, or did not select
a checkbox. Checkboxes that haven't been selected will result in an empty
field (or with the character from setEmptychar()) in this way. If Webinquiry
wouldn't do this, the fields in the data-file would vary for each submission,
because a not-selected entry or question would cause all following fields
to shift one position to the left. Each variable that needs to be included
in the data-file must get its own tuple, like ['var1', 'variable 1']. The
first string in the tuple will be used in the first line of the data-file,
the second string must be used in the HTML form. SPSS limits the length
of the first string and the characters in that string(no spaces for instance).
If you're not using SPSS this may not be a problem, use what you prefer
in that case. The words/characters in the second string, the one for the
HTML form, are free of choice however. If this option is not set, all results
will be written in the stories-file.
-
<myinquiry>.setResponse("http://www.mycompany.com/thankyou.html")
Sets the URL of the webpage that will
be shown to the submittant of the inquiry if the submission was succesful,
in this case 'thankyou.html' at www.mycompany.com. If there was an error,
Webinquiry will send an error message. If you get an "error HTTP 403" or
some number like that after submitting the inquiry, it probably means that
something is wrong in the location of that URL, for instance it doesn't
exist or you are not allowed to see it.
-
<myinquiry>.setDataname('statdata.txt')
Sets the name of the file for the statistical
data. Defaults to "statdata.txt". The data-file will be stored in the Folder
location.
-
<myinquiry>.setStoryname('stories.txt')
Sets the name of the file for the rest
of the submitted data, which is usually text. Defaults to "stories.txt".
The stories-file will be stored in the Folder location.
-
<myinquiry>.add()
After each set of statements for
an inquiry object, insert this statement. It will commit the changes to
the object. [REQUIRED]
5. Webinquiry software
Webinquiry is a CGI application written in
Python. This means that (a) it runs from a webserver and (b) it needs the
Python interpreter to run with your webserver. Python is freely available
from http://www.python.org.
5.2. Installation
Just unzip the archive and place the scripts
in the cgi-bin directory of your webserver.
Edit the my_inquiry.py file in an ASCII
editor according to the rules stated above. Remove the examplary "tpi3"
inquiry (e.g. remove every line that starts with "tpi3"), although you
might want to keep it as an example. If you are running Webinquiry on a
UNIX server, you need to edit the the first line of each Python script
file to point to your copy of the Python interpreter. You are free to use
another filename than my_inquiry.py, if the webserver allows you to.
The webservers needs to have permission
to read from and write to the folders that are set in setFolder() and setCCFolders()
of the inquiries that are defined.
5.3. Legal notice
Webinquiry was tested and developed with "Python
1.5.1" on "Windows NT 4.0 sp3" with "Microsoft Peer Webservices" and on
"Silicon Graphics Irix 5.3" with the "Apache 1.3.2" webserver. Webinquiry
is developed by Jeroen Pulles. The software
is provided as-is. The developer is not repsonsible for any damage caused
by the application. The user has the right to modify the application and
distribute it under another name.