sbr.items
Class NewVAS

java.lang.Object
  extended by sbr.items.NewVAS

public class NewVAS
extends java.lang.Object

Generates the web code to add a visual analog scale item to the survey. Implements, in Java VAS Generator by Frederik Funke & Ulf-Dietrich Reips (University of Zurich, CH)

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

Field Summary
static int ARROW
          Constant to indicate using an arrow to indicate the selection on the visual analog scale.
static int LINE
          Constant to indicate using an line to indicate the selection on the visual analog scale.
static java.lang.String[] LINES
          Names of lines in an array to allow them to be selected in the rest of the program.
static java.lang.String[] MARKER
          Constant string array with names to allow combobox for selection of the type of indicator.
static int MEDIUM
          Constant for a medium line in the visual analog scale.
static int POINT
          Constant to indicate using an point to indicate the selection on the visual analog scale.
static int THICK
          Constant for a think line in the visual analog scale.
static int THIN
          Constant for a thin line in the visual analog scale.
static int X
          Constant to indicate using an X to indicate the selection on the visual analog scale.
 
Constructor Summary
NewVAS()
           
 
Method Summary
 java.lang.String getAddScriptsVAS()
          Returns the text that has to follow the body tag in the html code in the web page.
 java.lang.String getBodyVAS(java.lang.String text, int length, int resolution, java.lang.String lAnchor, java.lang.String rAnchor, int lineWidth, int marker, int questNum)
          Returns the body script for the visual analog scale.
 java.lang.String getEndVAS()
          Return the text that has to precede the /body tag at the end
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THIN

public static final int THIN
Constant for a thin line in the visual analog scale.

See Also:
Constant Field Values

MEDIUM

public static final int MEDIUM
Constant for a medium line in the visual analog scale. This is the default.

See Also:
Constant Field Values

THICK

public static final int THICK
Constant for a think line in the visual analog scale.

See Also:
Constant Field Values

LINES

public static final java.lang.String[] LINES
Names of lines in an array to allow them to be selected in the rest of the program.


X

public static final int X
Constant to indicate using an X to indicate the selection on the visual analog scale.

See Also:
Constant Field Values

ARROW

public static final int ARROW
Constant to indicate using an arrow to indicate the selection on the visual analog scale.

See Also:
Constant Field Values

POINT

public static final int POINT
Constant to indicate using an point to indicate the selection on the visual analog scale.

See Also:
Constant Field Values

LINE

public static final int LINE
Constant to indicate using an line to indicate the selection on the visual analog scale.

See Also:
Constant Field Values

MARKER

public static final java.lang.String[] MARKER
Constant string array with names to allow combobox for selection of the type of indicator.

Constructor Detail

NewVAS

public NewVAS()
Method Detail

getAddScriptsVAS

public java.lang.String getAddScriptsVAS()
Returns the text that has to follow the body tag in the html code in the web page.

Returns:
String html this is the include text for the beginning of the web page so that the javascript routines needed to do a visual analog scale are added to the webpage.

getBodyVAS

public java.lang.String getBodyVAS(java.lang.String text,
                                   int length,
                                   int resolution,
                                   java.lang.String lAnchor,
                                   java.lang.String rAnchor,
                                   int lineWidth,
                                   int marker,
                                   int questNum)
Returns the body script for the visual analog scale. This code goes in the position in the body of the survey where the item is to be found.

Parameters:
text - the text of the question.
length - the linear length of the scale in pixels.
resolution - the number of discrete points that can be selected
lAnchor - the left hand anchor text.
rAnchor - the right hand anchor text.
lineWidth - the width of the line for the scale
marker - the marker to give feedback to the user
questNum - the number of the question in the scale
Returns:
String html. the code for the question that goes in the body of the web page

getEndVAS

public java.lang.String getEndVAS()
Return the text that has to precede the /body tag at the end

Returns:
String html. This is the code to execute the needed script at the end of the page.