#!/usr/bin/perl -w use CGI qw(:cgi-lib); #require "cgi-lib.pl"; &ReadParse; $answer2 = $in{'rq2'}; $answer3 = $in{'rq3'}; $answer4 = $in{'rq4'}; $player = $in{'plyrName'}; $beginscore = 40; $numcorrect = 0; $totalquest = 4; @wronganswers = (); if($answer2 eq undef){ &pgeErrTop(); &errmessage(); &pgeErrBottom(); } elsif($answer3 eq undef){ &pgeErrTop(); &errmessage(); &pgeErrBottom(); } elsif($answer4 eq undef){ &pgeErrTop(); &errmessage(); &pgeErrBottom(); } elsif($player eq undef){ &pgeErrTop(); &errmessage(); &pgeErrBottom(); } if($answer2 ne undef && $answer3 ne undef && $answer4 ne undef && $player ne undef) { if($answer2 eq "pun"){ $numcorrect = 1; } elsif($answer2 ne "pun"){ $beginscore = $beginscore - 10; $q1 = "Question 1 from Speech 4"; push(@wronganswers, $q1); } if($answer3 eq "acetyl"){ $numcorrect += 1; } elsif($answer3 ne "acetyl"){ $beginscore = $beginscore - 10; $q2 = "Question 2 from Speech 4"; push(@wronganswers, $q2); } if($answer4 eq "60"){ $numcorrect += 1; } elsif($answer4 ne "60"){ $beginscore = $beginscore - 10; $q3 = "Question 3 from Speech 4"; push(@wronganswers, $q3); } if($beginscore == 40){ &pgeTop(); print "

\n"; print "
\n"; print "You completed the questions for Speech 4. You gave $numcorrect correct responses out of three questions.\n"; $gameresults = "1948 campaign results for $player for Speech 4. $player gave $numcorrect correct responses out of three questions.\n"; print "