--- loncom/interface/lonquickgrades.pm 2003/06/13 19:11:56 1.14 +++ loncom/interface/lonquickgrades.pm 2003/06/18 19:31:38 1.15 @@ -108,6 +108,7 @@ HEADER my $totalParts = 0; my $totalPossible = 0; my $totalRight = 0; my $now = time(); + my $topLevelParts = 0; my $topLevelRight = 0; # Pre-run: Count parts correct while ( $depth > 0 ) { @@ -137,7 +138,13 @@ HEADER $totalPossible++; } } - + + if ($depth == 1) { # in top-level only + $topLevelParts += scalar(@{$parts}); + $topLevelRight += $partsRight; + $r->print($curRes->compTitle() . '
'); + } + # Crawl down stack and record parts correct and total for my $res (@{$stack}) { if (ref($res) && $res->is_map()) { @@ -164,9 +171,6 @@ HEADER my $indentString = '     '; - my $unaccountedTotal = $totalParts; - my $unaccountedCorrect = $totalRight; - # Second pass: Print the maps. $r->print(''); $r->print('' . "\n\n"); @@ -180,19 +184,17 @@ HEADER my $correct = $curRes->{DATA}->{CHILD_CORRECT}; my $total = $curRes->{DATA}->{CHILD_PARTS}; - $unaccountedTotal -= $total; - $unaccountedCorrect -= $correct; - if ($total > 0) { my $ratio; $ratio = $correct / $total; my $color = mixColors(\@start, \@end, $ratio); $r->print(""); - $r->print("\n"); + $r->print("$thisIndent$title"); + $r->print("\n"); } } @@ -200,12 +202,12 @@ HEADER } # If there were any problems at the top level, print an extra "catchall" - if ($unaccountedTotal > 0) { - my $ratio = $unaccountedCorrect / $unaccountedTotal; + if ($topLevelParts > 0) { + my $ratio = $topLevelRight / $topLevelParts; my $color = mixColors(\@start, \@end, $ratio); $r->print(""); + $r->print("Problems Not Contained In A Folder"); } my $maxHelpLink = Apache::loncommon::help_open_topic("Quick_Grades_Possibly_Correct");
SequenceDone / Total
"); - for (my $i = 1; $i < $depth; $i++) { $r->print($indentString); } + my $thisIndent = ''; + for (my $i = 1; $i < $depth; $i++) { $thisIndent .= $indentString; } - $r->print("$title$correct / $total
$thisIndent$correct / $total
"); - $r->print("Problems Not Contained In A Folder"); - $r->print("$unaccountedCorrect / $unaccountedTotal
"); + $r->print("$topLevelRight / $topLevelParts