#!/usr/bin/perl -w require "cgi-lib.pl"; &ReadParse; $answer1 = $in{'rq1'}; $answer2 = $in{'rq2'}; $answer3 = $in{'rq3'}; $answer4 = $in{'rq4'}; $player = $in{'plyrName'}; $beginscore = 40; $numcorrect = 0; $totalquest = 4; @wronganswers = (); if($answer1 eq "farmers"){ $numcorrect = 1; } elsif($answer1 ne "farmers"){ $beginscore = $beginscore - 10; $q1 = "Question 1 from Speech 1"; push(@wronganswers, $q1); } if($answer2 eq "700%"){ $numcorrect += 1; } elsif($answer1 ne "700%"){ $beginscore = $beginscore - 10; $q2 = "Question 2 from Speech 1"; push(@wronganswers, $q2); } if($answer3 eq "2,365"){ $numcorrect += 1; } elsif($answer1 ne "2365"){ $beginscore = $beginscore - 10; $q3 = "Question 3 from Speech 1"; push(@wronganswers, $q3); } if($answer4 eq "grassland"){ $numcorrect += 1; } elsif($answer1 ne "grassland"){ $beginscore = $beginscore - 10; $q4 = "Question 4 from Speech 1"; push(@wronganswers, $q4); } if($beginscore == 40){ &pgeTop(); print "Hello $player.

\n"; print "You completed the questions for Speech 1. You gave $numcorrect correct responses out of four questions.\n"; &pgeBottom(); } if($beginscore < 40){ &pgeTop(); print "

Hello $player.

\n"; print "You completed the questions for Speech 1. You gave $numcorrect correct response(s) out of four questions. Your responses were incorrect on the following questions:
\n"; print "

\n"; print "To correct your incorrect responses or to review the speech and questions press the BACK button on your browser.

\n"; print "

To send a copy of this report to your teacher, please enter:

Name of Class:and your

Teacher's E-Mail Address:

\n"; &pgeBottom(); } sub pgeTop { print "Content-type: text/html\n\n"; print " Results\n"; print "\n"; print "\n"; print "\n"; print "

results

\n"; print "

\n"; } sub pgeBottom { print "\n"; print "\n"; print "\n"; }