#!C:/perl/bin/perl.exe use CGI::Carp qw(fatalsToBrowser); use CGI; $query = new CGI; $pass= $query->param('pass'); $v1= $query->param('v1'); $v2= $query->param('v2'); $v3= $query->param('v3'); $v4= $query->param('v4'); if($pass < 1){ $pass = 0; } print $query->header; print $query->start_html(-title=>'Attitudes towards fruits and vegetables'); print ""; #_________ # Pass=1 #_________ if($pass == 1){ # find the participant mean $yourmean= &averageScores($v1,$v2,$v3,$v4); # save the data to a text file open(INFO, ">>$ENV{'DOCUMENT_ROOT_OLD'}/www/relationshipsresearch.com/P593/sub5.txt"); print INFO "$v1,$v2,$v3,$v4,$yourmean"; print INFO "endline\n"; close (INFO); # find the sample mean for fruit (variable for each person is the second (so 1st) element in data row) &AVGandSD('sub5.txt',4); # provide feedback print "
"; print "![]() | ";
print "";
print "";
print " "; print ""; print "Your mean attitude toward vegetables is $yourmean. "; print "The sample mean attitude toward fruits and vegetables is $Mean and the standard deviation is $SD. | ";
} # End Pass=1
#_________
# Pass=0
#_________
if($pass == 0){
print "