Visual analogous scales
Ratingscales is a javascript library to create visual analogous response scales (VAS) in online surveys.
Different forms of scales can be created:
- VAS in form of a clickable line
- VAS in form of a slider
- VAS in form of a button scale
- Optionally the continuous scale can be divided into a limited number of categories
1. Change Log
- Note: Outdated script!
- The script is not maintained anymore. There are however more sophistacted alternatives, e.g. a corresponding jQuery plugin offering comparable functionality.
2. Disclaimer
The script does not work properly in some browser on linux and apple. As I don´t have access to these operating systems I cannot reproduce and fix these errors.
The precision of the scale is slightly limited and can vary from browser to browser in the range of one to two pixels.
3. License
Ratingscales is available under the GNU General Public License. It implements the javascript library wz_dragdrop.js by Walter Zorn published under the GNU GPL as well.
4. Installation
- Include "wz_dragdrop.js" and "ratingscales.js" directly AFTER the opening <body> tag:
<script type="text/javascript" src="wz_dragdrop.js"></script> <script type="text/javascript" src="ratingscales.js"></script>
- Include the following line BEFORE the closing </body> tag:
<script type="text/javascript">scales.init();</script>
- Create your scales by calling the function "scales.scale()". This function accepts up to 6 arguments:
- Name of the variable (= hidden form element) (required!)
- Type of scale ('click', 'slide' or 'button') (optional)
- Number of classes (optional)
- Settings for the image of the scale, e.g. 'scale.gif' (source, width and height) (optional)
Note: as string (takes source and uses default width/height)
or: as array, e.g. ['scale.gif', 100, 12] (sets source, width and height) - Settings for the image of the slider, e.g. 'cross.gif' (source, width and height) (optional)
Note: as string (takes source and uses default width/height)
or as array, e.g. ['cross.gif', 100, 12] (sets source, width and height) - Scale labels as a 2-dimensional array (optional)
- Change the default settings (optional):
- scales.scale_src: image source of scale
- scales.scale_width: width of scale
- scales.scale_height: height of sclae
- scales.cross_src: image source of slider
- scales.crossOv_src: image sourc of active slider
- scales.cross_width: width of slider
- scales.cross_height: height of slider
- scales.classes: number of classes
- scales.mode: type of scale ('click', 'slide' or 'button')
- scales.slide_clickable: make slider scales clickable
Note: Some functionality is experimental (e.g. classes). There is no guarantee whatsoever the script works as intended. Use it on your own risk.
5. Demonstration
Some examples using this scripts are shown on the demonstration page (in german).
6. Literature
Gnambs. T. (2008). Graphische Analogskalen in Internet-basierten Fragebögen. München: Akademischer Verlag.

Kommentar hinzufügen