Instructions for installing Ron Pateman's CGI form into a HotPotatoes, Version 4, multiple choice quiz.

I'll use Kevin Coulson's Practice Quiz # 1 (at http://www.neiu.edu/~krcoulso/quiz1.htm) for this tutorial.

Open the "quiz1c.htm" file in pico.  This quiz has three files,  quiz1.htm, quiz1c.htm, and quizw.htm.  The quiz1.htm is the 'main' file.  The quiz1w.htm is the 'navigation' file.  The quiz1c.htm is the 'code' file.  The path of the file is '/home/staff/krcoulso/http/quiz1c.htm' and the URL of the file is 'http://www.neiu.edu/~krcoulso/http/quiz1c.htm'.

1) So, you would login to gamut and enter 'cd http' and then 'pico quizc.htm'.

2) Use 'control-w' to begin the 'search' program in pico

3) Type 'function WriteFeedback' into the search window

4) Use the up arrows to move the cursor two lines up

5) Hit 'enter' to make a blank line between

 }

and

{

6) Paste the line just below this one into that blank line:

document.recordForm.score.value=Score+" of "+Tries;

7) Go to the end of the file (you can scroll down using 'control-v') and just above the final two tags (</BODY>
</HTML>) paste this form:

<form   action="formq.cgi"  method=get  name="recordForm" target="_top">
      <!-- commonly customized fields -->
<input  type=hidden  name="data_file" value="qzscore.txt"  >
<input  type=hidden  name="emailto"  value="K-Coulson@neiu.edu" >
<input  type=hidden  name="return_url" value="index.html" >  Note: this is assuming your homepage is called 'index.html'
<input  type=hidden  name="email_subject"  value="Practice Quiz for Chapter 9">
      <!-- other fields -->
<input  type=hidden  name="vars"   value="login,name,score,quizname,comments" >
<input  type=hidden  name="req_vars" value="login,name,score">
<input  type=hidden  name="response"
        value="Your score has been recorded. Thanks for taking the quiz.">
      <!-- fields for quizname and score  -->
<input  type=hidden  name="quizname" value="None" >
<input  type=hidden  name="score"  value="0" >
<center>
<table  border="1" cellpadding=4 cellspacing=0 bgcolor="FFFFFF">
<tr>
   <td colspan=3 align=center bgcolor="FFFFFF"><font size=-1>To enter
   your score fill in the blanks and click the Record Score button</td>
</tr>
<tr>
   <td>First & Last Name:</td>
   <td>Login:</td>
   <td>&nbsp;</td>
</tr>
<tr>
   <td align=left><input  type=text  name=name  size=20 maxlength=50></td>
   <td align=center><input  type=text  name=login  size=10 maxlength=20></td>
   <td align=center><input  type=button  value="Record Score"
      onclick="recordForm.quizname.value=document.title;submit();">
</tr>
<tr>
   <td align=left colspan=2><input

      type=text name=comments size=35></td>
   <td align=center>Comments</td>
</tr>
</table></center>
</form>

8) Copy Ronald Patemans formq.cgi script into your http directory by typing this:

cp /home/student/rspatema/http/formq.cgi .

9) Create the correct permissions for the formq.cgi by typing 'chmod 755 formq.cgi'

10) Create the empty data form by typing 'pico qzscore.txt' and then pressing the space bar once and then typing 'control x' to save the file and exit

11) Create the correct permissions for the qzscore.txt by typing 'chmod 666 qzscore.txt'

12) Test it by taking the quiz and entering some test names and data, and make sure eveything is working.  You should get an email of the results and the results will be in your qzscore.txt file, too.