Приглашаем посетить
Multiple Choice Grader
BASIC INFORMATION
Name: Selena Sol's Multiple Choice Grader
Version: 3.0
Last Modified: 08-02-96
DESCRIPTION
This application is used to grade and database multiple choice quiz
results.
COPYRIGHT INFORMATION
This application was written by Selena Sol (selena@eff.org,
http://www.eff.org/~erict) having been inspired by countless other Perl
authors. Feel free to copy, cite, reference, sample, borrow, resell or
plagiarize the contents. However, if you don't mind, please let me know
where it goes so that I can at least watch and take part in the
development of the memes. Information wants to be free, support public
domain freware. Donations are appreciated and will be spent on further
upgrades and other public domain scripts.
Finally, PLEASE SEND WORKING URL's to selena@eff.org. I maintain a list
of implementations around the world.
SUPPORT
This script comes with no gaurentees or warranties. I am not a
programming professional. I am a web-hobbiest and my scripts are
continually evolving as I learn more. Don't expect the scripts to be
perfect.
Bug reports are greatly appreciated but installation support is
extremely discouraged. I have attempted to include as much information as
I could think of in this README and in the Customization and Installation
FAQ available at http://www.eff.org/~erict/Scripts/. Please try ALL
available sources of information BEFORE you email me. But if you must,
make sure to include the following bits of information (I may not respond
to your email if you do not answer ALL of the following questions):
1. What type of Web server are you running?
2. What type of Operating System is the Web server running on?
3. What is the "exact" error message from the Web?
4. What is the "exact" error message in your web server's error log?
5. What is the "exact" error message you receive when running the script
from the command line.
6. Are you running this script on an ISP? If so, what is the email
address of the Sysadmin there?
7. Are you using a virtual server setup? If so, what is the root path set
in your Web server's environment?
8. In which directory is the Perl interpreter located?
9. In which directory is sendmail located (if you are using a script which
demands use of sendmail)
Again, I MAY NOT ANSWER YOUR QUESTION unless you have answered all nine of
these questions.
BASIC INSTALLATION (DOWNLOADING THE SCRIPT)
It is recommended that you point your Web browser to "Selena Sol's Script
Archive" to get the latest version of this script. The Script Archive is
located at the following URL:
http://www.eff.org/~erict/Scripts/
From the "Script Archive" frontpage follow the hyperlinks to the detailed
page dedicated to this script. Then click on the hyperlink "Download the
scripts as a single tar file".
BASIC INSTALLATION (UNARCHIVING THE APPLICATION)
Once you have downloaded the TAR file (a single file containing all
associated files in their relative positions under the root directory),
transfer the TAR file to an executable directory on your web server and
untar them. On UNIX systems, you may type the following at the
command line:
tar xvfp filename.tar
(If you are using a non-UNIX Operating System, you may
download a TAR/UNTAR program by pointing your Web browser
to http://www.shareware.com).
BASIC INSTALLATION (SETTING PERMISSIONS)
Your Web server must have permission to read, write or execute as needed.
Each sub-directory and file in the application has its own correct
permissions level associated with it. Once you have unarchived (UNTAR)
the application, you must then set the correct permissions. On UNIX
systems, you will use the "chmod" command. The following table is a
quick guide to setting permissions for UNIX servers.
PERMISSION COMMAND
rwxrwxrwx chmod 777 filename
rwxrwxr-x chmod 775 filename
rwxr-xr-x chmod 755 filename
rw-rw-r-- chmod 664 filename
rw-r--r-- chmod 644 filename
Note: Not setting your permissions correctly is the
NUMBER 1 reason why installations fail. Take time to
get this right.
The actual permissions required for the subdirectories and files used by
this application are listed in the next section.
BASIC INSTALLATION (FILES, DIRECTORIES, AND PERMISSIONS)
The TAR file will then expand into a root directory called
Multiple_choice. Multiple_choicewill contain several sub-directories and
several files. The diagram below depicts the directory structure as well
as the permissions which must be applied to the files and subdirectories
used by the application.
Multiple_choice Root Directory (drwxr-xr-x)
|____Results Sub-directory (drwxr-xr-x)
| |____results.data (-rw-rw-rw-)
|____cgi-lib.pl (-rw-r--r--)
|____cgi-lib.sol (-rw-r--r--)
|____multiple_choice.answers (-rw-r--r--)
|____multiple_choice.cgi (-rwxr-xr-x)
|____multiple_choice.setup (-rw-r--r--)
|____multiple_choice_questions.cgi (-rwxr-xr-x)
Multiple_choice is the root directory and must be set to be readable and
executable by the web server
Results is a subdirectory which contains the datfiles containing results
of different surveys. The subdirectory must be readable,
writable and executable by the web server. It contains one file
results.data by default.
results.data is a sample data file used to keep track of the
results of the example survey generated by
multiple_choice_questions.cgi. The file must be readable
and writable by thwe web server. Initially, this file
will be empty, but as the script is used, it will
automatically write to the data file with a pipe delimited
list of results using the format:
correct number of answers|Name|email|date
For example...
3|Selena Sol|selena@eff.org|July 19, 1996
It is possible to change what information is recorded, but
you must modify the main script.
cgi-lib.sol is used for the lock file routines which protect the data
file from being written to by two people at the same time. This
file must also be readable by the web server.
cgi-lib.pl is used to read and parse incoming form data.
multiple_choice.answers is the file containing the right answers to
questions. It is a pipe delimited database in which each row is
in the format of
question number|Correct answer
The distribution answer file reads as follows:
1|Fred
2|The United States
3|4
and corresponds to the questions generated by
multiple_choice_questions.cgi
Be very attentive to spelling and spacing. It is essential that
these values are the same as those used in the multiple chgoice
web-based question form. This also means that if you have
transferred the file using an incorrect method, or have edited it
with an editor which places control characters into the data, you
must delete those extra characters. I recommend editing the
answer file on the web server with an editor which acts like a UNIX
editor. This file must be readable by the web server.
multiple_choice.cgi is the main body of the application. This file
must be readable and executable by the web server.
multiple_choice.setup is the file used to define various server specific
variables and options. The file must be readable by the web
server. The file defines the following variables:
$display_correct_answers determines whether or not you want the
user to see the correct answers to questions she missed
taking the exam. If it is set to yes, the correct answers
will be displayed, set it to no and they won't.
$display_detailed_results determines whether or not you want the
user to see an question by question overview of how they
did. A detailed list will show exactly which questions
the user missed. Set it to yes to get a full display, no
to get no display and keep the user guessing.
$number_of_results_to_display is the number of results that you
want to display per screen. If the results database is
huge, you do not want to output screens and screens of
results.
$answer_file is the location of the asnwer database file.
$results_database is the location of the results database file.
$title is just the name of the page that is outputted to the user.
$lock_file is a file that this program creates so that two users
cannot write to the results file at the same time, thus
corrupting the file. Just leave this one the way it
is...it is totally used by the program and you do not need
to create the file or anytthing...the program will do
it on its own....
$url_of_this_script is the url of the main script
multiple_choice.cgi
$location_of_cgi_lib and $location_of_cgi_sol are the locations of
the two library files on the server.
The setup file also contains the subroutine grading_scale which
simply outputs HTML information about how the client should
interpret their grade.
multiple_choice_questions.cgi is just a sample cgi script which
generates an HTML form. You need not use a CGI to do this....you can
just use a regular HTML file. I did it this way so that all the files
could be kept together. Thus, to try out this script you must use
http://www.your.host/cgi-bin/multiple_choice_questions.cgi
This script will output an HTML quetion form which will post to
multiple_choice.cgi. This file must be executable by the web server
Of interest is the fact that each radio button for each questio
must have the same NAME value
RUNNING THE SCRIPT
In the distribtion, I have included the file multiple_choice_questions.cgi
which is a script that generates a sample multiple choice form. You
should point your web server to something like the following:
http://www.foobar.com/cgi-bin/Multiple_choice/multiple_choice_questions.cgi
However, it is not necessary to use a script generated HTML form. Just
make sure that the form points to multiple_choice.cgi with the <FORM> tag.