--- loncom/interface/lonquickgrades.pm 2002/11/22 20:07:11 1.5 +++ loncom/interface/lonquickgrades.pm 2002/11/22 20:39:14 1.6 @@ -156,6 +156,9 @@ sub real_handler { my $indentString = '     '; + my $unaccountedTotal = $totalParts; + my $unaccountedCorrect = $totalRight; + # Second pass: Print the maps. $r->print(''); $r->print('' . "\n\n"); @@ -176,25 +179,38 @@ sub real_handler { my $correct = $curRes->{DATA}->{CHILD_CORRECT}; my $total = $curRes->{DATA}->{CHILD_PARTS}; - my $ratio; - $ratio = $total==0 ? 1 : $correct / $total; - my $color = mixColors(\@start, \@end, $ratio); - $r->print(""); - $r->print("\n"); + if ($total > 0) { + my $ratio; + $ratio = $correct / $total; + my $color = mixColors(\@start, \@end, $ratio); + $r->print(""); + $r->print("\n"); + } } $curRes = $iterator->next(); } + # If there were any problems at the top level, print an extra "catchall" + if ($unaccountedTotal > 0) { + my $ratio = $unaccountedCorrect / $unaccountedTotal; + my $color = mixColors(\@start, \@end, $ratio); + $r->print(""); + } - $r->print("\n\n\n"); + my $maxHelpLink = Apache::loncommon::help_open_topic("Quick_Grades_Possibly_Correct"); $r->print("\n\n");
SequenceCorrect / Total
"); - - for (my $i = 1; $i < $depth; $i++) { $r->print($indentString); } + $unaccountedTotal -= $total; + $unaccountedCorrect -= $correct; - $r->print("$title$correct / $total
"); + + for (my $i = 1; $i < $depth; $i++) { $r->print($indentString); } + + $r->print("$title$correct / $total
"); + $r->print("Problems Not Contained In Sequences"); + $r->print("$unaccountedCorrect / $unaccountedTotal
Total Parts Correct: $totalRight
"); - $r->print("Number Of Parts Possibly Correct: $totalPossible
"); + $r->print("Max Possible To Date $maxHelpLink: $totalPossible
"); $r->print("Total Parts In Course: $totalParts