### Homework summary for \$User

For each problem a period (.) indicates the problem has not been attempted, a "C" indicates the problem has been answered 100% correctly, and a number from 0 to 99 indicates the percentage of partial credit earned. An "X" indicates the database contains invalid information.

!; # Dump the contents of the DBM files: my (\$setNum,\$psvn,\$percentRight,@setList); my (\$key,@problems,\$string,\$twoString,@tempSort, \$total,\$totalRight,\$status,\$longStatus,\$valid_status,\$msg,\$attempted,\$probValue,\$num,\$i); print < Set Status Score Out
of EOF ##get number of problems \$string = ' Problem
'; \$twoString = ''; for (\$i=1; \$i <= \$maxNoOfProbs;\$i++) { \$twoString .= &threeSpaceFill(\$i); } \$string .= "
\$twoString
"; print "\$string"; print < EOF @setList = sort by_due_date @SetNumberKeys; foreach \$SetNumber (@setList) { (my \$SetNumber_display = \$SetNumber) =~ s/_/ /g; \$key = \$setNumberHash{\$SetNumber}; &attachProbSetRecord(\$key)|| print "no Record \$key\n"; \$timeNow = time; \$msg = 'NOT OPEN YET'; if ((\$timeNow >= \$openTimes{\$SetNumber}) and \$timeNow < \$dueTimes{\$SetNumber}) { \$msg = 'OPEN'; } elsif (\$timeNow >= \$dueTimes{\$SetNumber}) { \$msg = 'PAST DUE DATE'; } @problems = &getAllProblemsForProbSetRecord(\$key); \$string = ''; @tempSort = sort( { \$a <=> \$b } @problems); \$total=0; \$totalRight = 0; foreach \$num (@tempSort) { \$valid_status = 0; \$status = &getProblemStatus(\$num,\$key); \$attempted = getProblemAttempted(\$num,\$key); if (!\$attempted){ \$longStatus = '. '; } elsif (\$status >= 0 and \$status <=1 ) { \$valid_status = 1; \$longStatus = int(100*\$status+.5); if (\$longStatus == 100) { \$longStatus = 'C '; } else { \$longStatus = &threeSpaceFill(\$longStatus); } } else { \$longStatus = 'X '; } \$string .= \$longStatus; \$probValue = &getProblemValue(\$num,\$key); \$total += \$probValue; \$totalRight += round_score(\$status*\$probValue) if \$valid_status; } print < \$SetNumber_display \$msg \$totalRight \$total

\$string
EOF } print '
'; print &htmlBOTTOM('studentSummary.pl', \%inputs); exit(0); ## subroutines sub threeSpaceFill { my \$num = shift @_; if (\$num < 10) {return "\$num".' ';} elsif (\$num < 100) {return "\$num".' ';} else {return "\$num";} }