For each test with name testname there must exist a file
called testname.cfg with the following information.
The compulsory changes are marked with "!!!".
# !!! THE LOCATION OF THE EXPLANATION FILE !!!
# the fully qualified URL or URL with respect
# to the location of exammail.cgi
# Do not use quotes around the URL
def_explain_url=http://something..
# the marking scheme ( score for correct, guess, wrong answer)
def_scheme=1,0,0
# the allowable password or ID number range (inclusive). If none, put "".
def_secrange=""
# the report terseness (0 - less ,1, 2 - most)
#0 gives no answers, 1 gives answers if candidate incorrect,
#2 gives all answers
def_report=1
# the horizontal rule to use
def_rule=<HR>
# the contents of the BODY tag for the generated Web page
def_body=BGCOLOR="#DDFFFF" TEXT="#000099" BACKGROUND="back.jpg"
# !!! THE PROGRAM TO DO THE E-MAILING !!! e.g.:
def_emailprog=/usr/ucb/mail
# !!! THE MARKER FOR THIS QUIZ !!!
#put your e-mail address here
def_marker=fred@compuserve.com
# the header to print at the top of the quiz evaluation
def_header=A New Test
# decreasing order grade values
grd=90,Excellent!
grd=80,Very Good!
grd=70,Good!
grd=60,Fair
grd=50,Poor
grd=0,Fail
# ALL the answers for each and every question
ans=q1,c
ans=q2,d
ans=q3,True
ans=q4,2
ans=q5,Friday
- If any of the def_ items are not given the
defaults in the program will be used (see below).
- The order of the ans= lines should be the same as presented
in the HTML form. The first field should match that of the
INPUT NAME= element. The second should match the answer's
INPUT VALUE= element. Case DOES matter.
- The order of the grd= lines should be in decreasing order
of percentage with 0,something as the last entry.
If the grd= lines are not
presented, the grade phrases within the program will be used.
- The order of the def_ lines does not matter.
- The only non-optional entries within this file are the ans=
lines.
Please see demo1.htm for the information required by exammail.cgi in the from the HTML form for the examination.
The essential parts of the exammail.cgi script which have to be changed are:
- The "path to PERL" on the server
- The location of the sendmail program on the server
- The examiner's e-mail addess
The last two can be over-ridden by changes in the .cfg file.
Optional changes (most of the variables below can be overriden by an entry in the
test's .cfg file), include:
def_pathtests can be adjusted to point to a secure location.
(This is optional, not recommended for first go at loading program)
Adjust the location of the answer files:
In exammail.cgi adjust the variable $pathtests to
where the test
results will be stored. ie. /usr/oyston/testresults/
making sure to include the trailing slash.
(Leaving this variable alone will cause exammail.cgi to
look in the current directory, which is OK, but means that knowledgeable users
may find the answers as well!)
- $def_scheme:
- The default marking scheme in the following order
points for: correct answer, guess or blank, incorrect answer
examples:
$def_scheme = "5,0,0";
$def_scheme = "2,0,-1";
- $def_secrange:
- The security range to allow.
The ID imported from the form has to be within this inclusive range.
example:
$def_secrange = "0-1200";
- $def_rule:
- The HTML markup for the horizontal rule to use.
$def_rule = "<BR><IMG SRC=\"rbline.gif\"><BR>";
- $def_marker:
- The email address of the marker
Make sure you escape each @ with a \
This may also be a list of addresses such as:
$def_marker = "m1\@bus.com m2\@bus2.com";
- $def_report:
- The terseness level for the report (0,1,2)
For level 0: only number of correct, incorrect, blanks is printed.
level 1: incorrect or blank answers are highlighted.
level 2: all questions and answers are reported.
$def_report = 2;
- $def_grades:
- The default word grades.
The format being the same as in the .cfg file.
x,Phrase
Where x is a percentage value such that if percentage >= x
The Phrase is the grade.
The last entry has to be "0,Phrase" and represents the grade
given for anything not stated before.
- $def_emailfile:
- This is the root of the temporary file used
to prepare the email sent to the candidate.
The actual file is constructed by appending a unique number to
this variable, so that multiple quiz takers do not get the
wrong e-mail. This file is removed after e-mail is sent.
- $def_tmppath:
- The directory given in the path has to be writable by the
WWW server running the Perl script.
A good location usually is /tmp/ (notice trailing slash.)
- $def_emailprog:
- This is the name of the program doing the grunt work of sending
e-mail. On most Unix machines, this is /bin/mail.
It has to accept the following arguments:
/bin/mail -s "Subject" email_addr ...
- $def_pathtests:
- this is the directory path (including slash)
of where the test answers and word grades are kept.
If the exammail.cgi script is run inside
public_html/ then a
good path to use would be ../, effectively preventing
a browser from being able to see the anwers and word grades.
The filename for the config file is constructed as follows:
configfile = def_pathtests + testname + ".cfg"