ExamMail

An automatic exam-marking program for the Internet.

Concept by John Oyston
Copyright (C) 1996,1997 by Carsten Schafer and John Oyston


Brief Instructions

ExamMail consists of six parts:
  1. The exam (demo1.htm), an HTML form with some hidden fields and comment tags around the questions.
  2. A configuration file (demo1.cfg), a text file with the answers and various configuration options.
  3. The CGI script (exammail.cgi) itself, which requires PERL 4.
  4. Cgi-lib.pl, a small PERL library needed by the CGI script.
  5. A couple of graphics files (back.jpg and rbline.gif) to make things look pretty.
  6. The "demo1exp.htm" file, an HTML document. The CGI script returns a web page with a link to this web page, which can be used to offer details of the correct answers, or to tell the candidate where to go or what to do next.

The CGI script has to be modified to put the correct path to PERL on the first line. The default location of sendmail program and the default e-mail address for the examiner can be set up in the main part of the CGI script, but this is not essential. The .cfg file also needs the correct location for the sendmail program and the examiner's e-mail address. (The version in the .cfg file will override the version in the .cgi file if both are set. In the initial set up, it is best to make both conform. In later tests, the same cgi script can be reused, with a new .cfg file to incorporate any changes.) The easiest installation is just to put all the files in one directory on your server in which you can run CGI scripts (some servers only allow CGI scripts to run in cgi-bin, others allow them to run anywhere). Remember to send the PERL script and cgi-lib library as ASCII, not binary, files, and to set the CHMOD permission on the CGI script to 755. Once you have done this the program should be ready to run!
Now you can write a new version of the test, with your own questions. This is best done by copying the questions from the demonstration test and writing over the old text.

Details of the Format of the .cfg file:

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
      

Detailed Configuration:

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:

  1. The "path to PERL" on the server
  2. The location of the sendmail program on the server
  3. 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"
	

Contact Information:

NAMEPHONEE-MAILWEB
Carsten Schafer
(Programmer)
(705) 726-7942 cschafer@barint.on.ca http://www.barint.on.ca/~cschafer
Dr John Oyston
(Concept)
(705) 325-2201 x 906 oyston@oyston.com http://www.oyston.com/anaes

Visit the ExamMail Home Page