May require Netscape, so the tags do not get processed by Internet Explorer, despite the PRE and the .txt!


#!/opt/bin/perl

require "subparseform.lib";
&Parse_Form;

$name = $formdata{'name'};
if ($name eq "")                              # Checking for equality, PERL
     { $name = " *** YOUR 1st NAME *** "; }   #    uses eq for strings, but
                                              #    uses == for numbers...
print "Content-type:text/html\n\n";

print "\n\n$name";
print "'s results on Mark's 023 quiz.";
print "\n\n";

print "\n
\n"; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); if(($hour >= 0) && ($hour < 4)) { $greeting = "It late"; } elsif(($hour >= 4) && ($hour < 8)) { $greeting = "You are up early"; } elsif(($hour >= 8) && ($hour < 12)) { $greeting = "Good morning"; } elsif(($hour >= 12) && ($hour < 17)) { $greeting = "Good afternoon"; } elsif(($hour >= 17) && ($hour < 23)) { $greeting = "Good evening"; } else { $greeting = "It is almost midnight"; } if ($wday == 0) {$theDay = "Sunday";} elsif ($wday == 1) {$theDay = "Monday";} elsif ($wday == 2) {$theDay = "Tuesday";} elsif ($wday == 3) {$theDay = "Wednesday";} elsif ($wday == 4) {$theDay = "Thursday";} elsif ($wday == 5) {$theDay = "Friday";} elsif ($wday == 6) {$theDay = "Saturday";} print "

\nQuiz results... $greeting, $name!\n"; print "\n \n"; print "
Hope you are having a good $theDay\n"; $yday = $yday + 1; # it is a leap year in 2000 $daysLeft = 366 - $yday; $theYear = 1900 + $year; $nextYear = $theYear + 1; print "
Its day $yday of year $theYear. Only $daysLeft days till"; print " $nextYear!\n

"; print ""; print "

\n"; print ""; print "Q1: "; print "You chose $formdata{'remainder'}\n"; print " as your 1st CRC remainder, $name.\n"; if ($formdata{'remainder'} eq "1010") { print "
Way to go $name, 1010 is correct!
\n"; } else { print "
Sorry $name, $formdata{'remainder'} is wrong.
\n"; } print "
\n"; print "Q2: You chose $formdata{'remainder2'}\n"; print " as your 2nd CRC redundancy bits remainder.
\n"; if ($formdata{'remainder2'} eq "0000") { print "Way to go $name, you are correct!\n"; print "
The remainder bits can be 0000, all zeroes!\n"; } else { print "Sorry $name, did you enter all 4 binary digits?\n"; print "
$formdata{'remainder2'} is the wrong 4 bit remainder."; } print "


\n"; print "\n"; if ($formdata{'chmod'} eq "755") { print "Q3: Awesome $name, you know your chmod permissions!\n"; } else { print "Q3: Sorry, $name, but $formdata{'chmod'} is the wrong chmod value.\n"; } print "\n"; print "

\n"; print "
"; if ($formdata{'codeword'} eq "r3") { print "Q4: Ya baby! You got the Hamming correction idea down.\n"; } else { print "Q4: Wrong. See codeword help!\n"; } print "
"; if ($formdata{'codeword2'} eq "r1") { print "Q5: Yes! You got the only uncorrupted 12 bit codeword!\n"; } else { print "Q5: Wrong. See codeword help!\n"; } print "
"; if ($formdata{'codeword3'} eq "r3") { print "Q6: Yes! You found codeword that has to be resent!\n"; } else { print "Q6: Wrong. For codeword help!\n"; } print "
"; print "
  1. \n"; print "To see the Q4, Q5, Q6 Hamming codeword frames together\n"; print " instead of the animation, click here."; print " The 8 bits of data are sent as a 12 bit code word, and all \n"; print "single-bit errors can be detected, like parity, and corrected, \n"; print "unlike parity.
  2. It is an ERROR CORRECTING CODE.\n"; print "
  3. Photoshop was used to create the two slides, and the\n"; print "gifmerge program on chaos merged them into 4 second animation \n"; print "that repeats forever.\n
\n

"; print "\n


\n
\n\n";