#!C:/perl/bin/perl.exe
use CGI::Carp qw(fatalsToBrowser);
use CGI;
$query = new CGI;
#-----------------------------------------------
# Read in variables
#-----------------------------------------------
$pass= $query->param('pass');
$thisCondition= $query->param('thisCondition');
$mem1= $query->param('mem1');
$mem2= $query->param('mem2');
@itemIndex= $query->param('itemIndex');
@picIndex= $query->param('picIndex');
$p0r0= $query->param('p0r0');
$p0r1= $query->param('p0r1');
$p0r2= $query->param('p0r2');
$p0r3= $query->param('p0r3');
$p0r4= $query->param('p0r4');
$p0r5= $query->param('p0r5');
$p0r6= $query->param('p0r6');
$p0r7= $query->param('p0r7');
$p0r8= $query->param('p0r8');
$p1r0= $query->param('p1r0');
$p1r1= $query->param('p1r1');
$p1r2= $query->param('p1r2');
$p1r3= $query->param('p1r3');
$p1r4= $query->param('p1r4');
$p1r5= $query->param('p1r5');
$p1r6= $query->param('p1r6');
$p1r7= $query->param('p1r7');
$p1r8= $query->param('p1r8');
$p2r0= $query->param('p2r0');
$p2r1= $query->param('p2r1');
$p2r2= $query->param('p2r2');
$p2r3= $query->param('p2r3');
$p2r4= $query->param('p2r4');
$p2r5= $query->param('p2r5');
$p2r6= $query->param('p2r6');
$p2r7= $query->param('p2r7');
$p2r8= $query->param('p2r8');
$va01= $query->param('va01');
$va02= $query->param('va02');
$va03= $query->param('va03');
$va04= $query->param('va04');
$va05= $query->param('va05');
$va06= $query->param('va06');
$va07= $query->param('va07');
$va08= $query->param('va08');
$va09= $query->param('va09');
$va10= $query->param('va10');
$sex= $query->param('sex');
$age= $query->param('age');
$country= $query->param('country');
$takenbefore= $query->param('takenbefore');
$title = "Relationships Survey";
#-----------------------------------------------
# Survey Items
#-----------------------------------------------
# attachment (current or ex partner) - Relationship Structures
$a01 = "1. It helps to turn to this person in times of need.";
$a02 = "2. I usually discuss my problems and concerns with this person.";
$a03 = "3. I talk things over with this person.";
$a04 = "4. I find it easy to depend on this person.";
$a05 = "5. I don't feel comfortable opening up to this person.";
$a06 = "6. I prefer not to show this person how I feel deep down.";
$a07 = "7. I often worry that this person doesn't really care for me.";
$a08 = "8. I am afraid that this person may abandon me.";
$a09 = "9. I worry that this person won't care about me as much as I care about him or her.";
$a10 = "10. I don't fully trust this person.";
# Set Pass = 0
if($pass < 1){
$pass=0;
}
# get date and time
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = 1900 + $year;
$mon= $mon+1;
$hour = $hour - 1;
$date1= "$mon/$mday/$year";
$date2= "$hour:$min:$sec";
#Remove commas from free response
$mem1 =~ s/\n/
/g;
$mem1 =~ s/\r/ /g;
$mem1 =~ s/\,/ /g;
print $query->header;
print $query->start_html(-title=>'Relationships Survey');
#-----------------------------------------------
# Pass = 7
# Participant Feedback
#-----------------------------------------------
if ($pass == 7) {
print "