#!C:/perl/bin/perl.exe use CGI; $query = new CGI; @varlist= $query->param('varlist'); $v01x= $query->param('v01.x'); $v02x= $query->param('v02.x'); $v03x= $query->param('v03.x'); $v04x= $query->param('v04.x'); $v05x= $query->param('v05.x'); $pass= $query->param('pass'); $q01= "I feel that I'm a person of worth, at least on an equal plane with others."; $q02= "I feel that I have a number of good qualities."; $q03= "All in all, I am inclined to feel that I am a failure."; $q04= "I am able to do things as well as most other people."; $q05= "I feel I do not have much to be proud of."; print $query->header; print $query->start_html(-title=>'Self-Esteem Test'); print ""; print "
"; for($i = 0; $i <= 4; ++$i) { $variable= $varlist[$i]; $hiddenvariablename= "v" . $variable . ".x"; $variable= "v" . $variable . "x"; print $query->hidden($hiddenvariablename,$$variable); } if($pass <= 4){ $question= $varlist[$pass]; $question= "q" . $question; $variable= $varlist[$pass]; $variable= "v" . $variable; print "

"; print " $$question

"; print " Please click on the rating scale below to indicate the degree to which you agree with the statement above.

"; print"

"; $pass = $pass + 1; print $query->hidden('varlist',@varlist); print " "; print "
"; } else{ print ""; print "
"; print "You've answered all the questions. Click the button below to determine your self-esteem score.

"; for($i = 0; $i <= 4; ++$i) { $variable= $varlist[$i]; $hiddenvariablename= "v" . $variable . ".x"; $variable= "v" . $variable . "x"; print $query->hidden($hiddenvariablename,$$variable); } print ""; } print $query->end_html;