sbr.resources
Class BuildHead

java.lang.Object
  extended by sbr.resources.BuildHead

public class BuildHead
extends java.lang.Object

Version:
0.3
Author:
John H. Krantz, Ph.D.

Constructor Summary
BuildHead()
           
 
Method Summary
 java.lang.String[] getBodyStart(java.lang.String title, java.lang.String shortTitle, java.lang.String server, java.lang.String path, java.lang.String script, java.lang.String dataPath, java.lang.String target)
          Get the html code for the web page from the beginning of the page to the first question.
 java.lang.String getEnd(boolean doVAS, boolean allowCount)
          The web page code to end the form and webpage.
 java.lang.String getHead(java.lang.String title, boolean doVAS)
          Generate the code for the header of a web page
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildHead

public BuildHead()
Method Detail

getHead

public java.lang.String getHead(java.lang.String title,
                                boolean doVAS)
Generate the code for the header of a web page

Parameters:
title - the title of the survey. Will be placed both in the title field of the head and at the beginning of the survey.
doVAS - flag to indicate if the survey contains any visual analog scale items. If it does, the code to include the proper JavaScripts is added to the page.
Returns:
String html. This is the actual web page code (html)

getBodyStart

public java.lang.String[] getBodyStart(java.lang.String title,
                                       java.lang.String shortTitle,
                                       java.lang.String server,
                                       java.lang.String path,
                                       java.lang.String script,
                                       java.lang.String dataPath,
                                       java.lang.String target)
Get the html code for the web page from the beginning of the page to the first question. This part of the code includes the beginning of the form.

Parameters:
title - The title of the survey. The same title information is placed in the web page header.
shortTitle - This is the name of the survey to communicate with the server so that this particular study can be identified. The data will will have the name 'shortTitle.csv'.
server - The name of the server that will collect the data.
path - The path from the server root '/' to the script that will do the collection of the data. This path is 'cgi-bin/'. Notice that there is no slash at the beginning of the path. It is usually part of the name of the server.
script - The name of the script.
dataPath - The path from the root folder of the computer that has the server where the data will be stored.
target - The page where the script will direct the participant when the server has been submitted. This page is usually the debriefing or thank you page.
Returns:
String html. This is the web page code with all this information embedded.

getEnd

public java.lang.String getEnd(boolean doVAS,
                               boolean allowCount)
The web page code to end the form and webpage.

Parameters:
doVAS - the flag if any visual analog scale items are in the survey. This flag will cause the needed code to be added.
allowCount - flag to indicate if the survey make will allow me to count the use of this survey anonymously.
Returns:
String html. The needed html code.