If you are looking for the REG form details, click here.

Psych Web Form Templates by bee

Here's some quick details about how to get HTML pages together in order to do web questionnaires or surveys on watarts (faculty/grads) or artsweb (undergrads). I'll use the term "survey" throughout this documentation. For links to learning HTML and other web resources, there's a few links you can use tucked away in the "World Wide Web" section of the beeHive). Following the W3Schools link there to the Try-It-Yourself page is a good place to start. HTML Reference is also pretty straightforward.

Typically you'll need to create the following files:

  1. index.html - this is an info page
  2. consent.html - this is a consent page where the subjects would agree to participate and depending on the survey, also enter a userid/password.
  3. declined.html - this is the page that would be presented if the subject declines participation
  4. page1.html - the first page of the survey
  5. page2.html, page3.html - additional pages of the survey if needed.
  6. thanks.html - a thank you page
  7. passfile.txt - the file of userids and passwords

I'd really encourage you to avoid using things like Word or other WYSIWYG HTML editors - most toss in a lot of extraneous html which can make creating clean HTML problematic. Since most surveys are pretty straightforwrd, stick to Notepad, Wordpad or something which creates clean HTML. NVU is also on all Nexus stations in the department (see the Gotchas below for some settings in NVU you'll want to use).


1. index.html

Typically an info page. This is the first page that the subject will see when they first view the URL you provided them with:
------------------------cut here----------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="ROBOTS" CONTENT="NOINDEX">
<META NAME="ROBOTS" CONTENT="NOFOLLOW">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<title>Survey</title>
</head>
<BODY bgcolor="#ffffff">

Information stuff would go here... Yada yada yada...

<P>

<form method="post" action="---CGIFORM---">
<input type="hidden" name="frompage" value="index.html">
<input type="hidden" name="sonaid" value="---SONAID---">
<input type="hidden" name="lastvv" value="0">
<input type="submit" value="Continue">
</form>

</body>
</html>
------------------------cut here----------------------

Notes:


2. consent.html

The consent/login page. The stuff in red is not required if you use the -sonastudy option (see below).
------------------------cut here----------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<title>Survey</title>
</head>
<BODY bgcolor="#ffffff">

<form method="post" action="---CGIFORM---">
<input type="hidden" name="frompage" value="consent.html">
<input type="hidden" name="sonaid" value="---SONAID---">
<input type="hidden" name="lastvv" value="1">

Consent details go here... Yada yada yada...

<p>
I agree to participate in this study:
<blockquote>
<input type="radio" name="vv0001" value="Accept">Accept<br>
<input type="radio" name="vv0001" value="Decline">Decline
</blockquote>

<p>
If you agree to participate, please enter your login information:
<blockquote>
Userid: <input type="text" name="sid" size="12">
<BR>
Password: <input type="password" name="password" size="12">
</blockquote>

<blockquote>
<input type="submit" value="Submit">
<input type="reset">
</blockquote>

</form>

</body>
</html>
------------------------cut here----------------------

Notes:


3. declined.html

A page for people who decline consent.
------------------------cut here----------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<title>Survey</title>
</head>
<BODY bgcolor="#ffffff">

You have declined consent... Yada yada yada...

<P>

Thanks for your time... Yada yada yada...

<P>

If you have any questions... yada yada yada...

<blockquote>
Your name
<br>Department of Psychology
<br> University of Waterloo
<br>email and other stuff
</blockquote>

</body>
</html>
------------------------cut here----------------------

Notes:


4. page1.html

The first page of the survey.

Below is an example that asks a few questions

------------------------cut here----------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<title>Survey</title>
</head>
<BODY bgcolor="#ffffff">

<form method="post" action="---CGIFORM---">
<input type="hidden" name="frompage" value="page1.html">
<input type="hidden" name="sid" value="---SID---">
<input type="hidden" name="password" value="---PASSWORD---">
<input type="hidden" name="sonaid" value="---SONAID---">
<input type="hidden" name="condition" value="---CONDITION---">
<input type="hidden" name="lastvv" value="3">

<h2>Survey</h2>
<hr>

The purpose of this study is to find out what you know
about the Three Stooges.

<P><HR><P>

<OL>

<LI> Who's your favourite Stooge?
<select name="vv0001">
<option value="">Please Select
<option value="1">Mo
<option value="2">Larry
<option value="3">Curly Joe
</select>

<LI> Why?
<select name="vv0002">
<option value="">Please Select
<option value="1">Great personality
<option value="2">Nice hair
<option value="3">Gluton for punishment
</select>

<LI> If you were Curly Joe, which would you prefer to have Mo do to you?
<select name="vv0003">
<option value="">Please Select
<option value="1">Two finger poke in your eyes
<option value="2">Stomp on your toes
<option value="3">Nose pull and slap
</select>

</OL>

<P><HR><P>
<input type="submit" value="Submit">
<input type="reset">

</form>
</body>
</html>
------------------------cut here----------------------

Notes:

  • variable names must be vv0001, vv0002, etc.
  • there must be exactly 4 digits in the 'vvnnnn' variable name.
  • the lastvv line must contain the number corresponding to the last variable - ie. if the last variable used is vv0231, then the value in the lastvv line must be "231". Make sure this is always correct otherwise all your data may not be saved.


    5. page2.html, page3.html, etc

    Same deal as page1.html.

    Notes:


    6. thanks.html

    Toss in a page to make the person feel good about completing the form...
    ------------------------cut here----------------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
    <title>Survey</title>
    </head>
    <BODY bgcolor="#ffffff">
    
    Thanks for your time... Yada yada yada...
    
    <P>
    
    If you have any questions... yada yada yada...
    
    <blockquote>
    Your name
    <br>Department of Psychology
    <br> University of Waterloo
    <br>email and other stuff
    </blockquote>
    
    </body>
    </html>
    ------------------------cut here----------------------
    

    Notes:


    7. passfile.txt

    You'll need a file containing userids and passwords which can be used to login on the consent page. Each line should simply contain a userid and password like so:
    ------------------------cut here----------------------
    s0001 Ue6FiyIW
    s0002 sJU99sbA
    s0003 8fDT3A8h
    ...etc
    ------------------------cut here----------------------
    

    If you need to match MT id#'s to your subject IDs, just add a third field containing the MT id#'s and this will also get saved in with each submitted form:

    ------------------------cut here----------------------
    s0001 Ue6FiyIW f5615
    s0002 sJU99sbA f5977
    s0003 8fDT3A8h f4635
    ...etc
    ------------------------cut here----------------------
    

    Notes:




    When you are done creating the pages...

    1. make sure all your folders and filenames are lowercase and contain no spaces.
    2. [Optional] use the Weblint Gateway or W3C Markup Validation Service to confirm there are no problems with your HTML. Just "Validate by File Upload". This step isn't required, but it can help if you have problems with your HTML.
    3. Additional HTML documentation can be found at:
    4. I've been working on a program which will hook up web studies for you so that folks don't need to track me down for each study. Try this:
      1. Transfer your html files to your watarts (faculty/grads) or artsweb (undergrads) account. There's various ways of doing this so pick your favourite. If you aren't sure how to do this, go to a Nexus station and do this:
        1. Create a new folder in your N:\public_html folder and place the html files and passfile.txt file there. Again, make sure there's no space or funny characters in the folder name you create.
        2. Using the example of your userid being 'johndoe' and the web directory name you want to set up is 'mywebstudy' (this name should not contain spaces or other "funny characters"), do the following...
        3. if it doesn't already exist, create a fodler under your home called 'public_html'.
        4. in the 'public_html' directory, create a folder called 'mysebstudy' (or whatever name you give your study - remember, no spaces) and avoid creating folders within folders.
        5. transfer all your html files and passfile.txt into this new directory.
        [[[If you are working on a home machine, laptop or non-Psych Nexus station, you can download winscp from http://winscp.net/eng/download.php to transfer your files - the "portable executable" is a standalone program which doesn't require an install. If you are working from a non-Psych Nexus station, you can also open open "Start --> Programs --> Internet Tools --> File Transfer --> Secure File Transfer Client" and you can probably figure out how to connect and carry on using the above.]]]
      2. Once the files are in place, you'll just need to login to watarts (faculty/grads) or artsweb (undergrads) and an run a program to set things up. On a Nexus station, do this:
        1. double-click "Psych Shortcuts" on the desktop, then "Programs", then "putty artsweb" or "putty watarts" (depending on where your account is. The above will only work on Psych Nexus PCs.
        2. change to the directory where you have your web files. Eg. if you have them in public_html/mywebstudy, type:
          cd public_html/mywebstudy
        3. run the program which will set things up for you. Type:
          /u/bee/perl/makewebstudy.pl
          and follow the instructions.
        [[[If you are working on a home machine, laptop or non-Psych Nexus station, you can also download putty from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html - the putty.exe is a standalone program which doesn't require an install. If you are working from a non-Psych Nexus station, you can also open open "Start --> Programs --> Internet Tools --> Remote Login --> Secure Shell Client" and you can probably figure out how to connect and carry on using the above.]]]
      3. The program will give error messages if it finds things it's not expecting. If you run into an error, fix it and just re-run things. As long as you follow the format of the webformtemplate, it should work as expected. If you are using something from a previous study, you may need to edit the files a little to make things work.
    5. The responses from each submitted page will be stored in a file called 'output.txt' in the same folder that your put your html files into. Just download this file to your computer, start Excel and select File/Open. An import wizard will open and you can specify that you are working with "Delimited" data, and on the next screen indicate *only* the '|' character as a delimiter (uncheck the tab key which is a default), and also indicate that the "Text qualifier" is "{none}". It will then separate each variable into a separate column. From there you will probably have a handle on things... Apparently this format is also easily readable in SPSS, but I really don't know SPSS at all.
    6. Let me know if you have any special conditions in which case I'll need to tweak the program which processes the files.

    Fine Tuning

    Gotchas

    Here's some gotchas and additional notes:


    Jump to - beeHive - UW Psychology - UWInfo Home Page