#! /usr/bin/perl -wT use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use strict; # generate the begining of the web page. my $title = "CSGA 5030 Project 3: Arithmetic Drilling"; print header, "\n"; print start_html($title), "\n"; print h1($title), "\n"; #print < $a $op $b = EndHTML #### #! /usr/bin/perl -wT use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use strict; # generate the begining of the web page. my $title = "CSGA 5030 Project 3: Arithmetic Drilling"; my $qweb = "http://www.dsm.fordham.edu/~sheehan/cgi-bin/netwebprog-grad/proj3/question"; print header, "\n"; print start_html($title), "\n"; print h1($title), "\n"; my $question = param("question"); my $correctanswer = param("trueAnswer"); my $proposedans = param("proposedAnswer"); my $tq = param("totalQuestions"); my $ac = param("answeredCorrectly"); print "Question: $question\n"; print "Your answer: $proposedans\n"; print "True answer: $correctanswer\n"; print ""; ++$tq; # increment total number of questions asked if ($proposedans != $correctanswer){ print "Incorrect!\n"; }else { print "Correct!\n"; ++$ac; } my $percent = int(($ac/$tq)*100); print ""; print qq(

Score so far: $ac out of $tq ($percent percent)

\n); print qq(Try another problem\n); print "\n"; print qq(Start over with a clean slate\n);