[LON-CAPA-cvs] cvs: loncom /interface lonquickgrades.pm

bowersj2 lon-capa-cvs@mail.lon-capa.org
Wed, 25 Jun 2003 19:01:23 -0000


bowersj2		Wed Jun 25 15:01:23 2003 EDT

  Modified files:              
    /loncom/interface	lonquickgrades.pm 
  Log:
  Count points in the top-level map correctly.
  
  
Index: loncom/interface/lonquickgrades.pm
diff -u loncom/interface/lonquickgrades.pm:1.18 loncom/interface/lonquickgrades.pm:1.19
--- loncom/interface/lonquickgrades.pm:1.18	Wed Jun 25 14:46:09 2003
+++ loncom/interface/lonquickgrades.pm	Wed Jun 25 15:01:23 2003
@@ -135,7 +135,6 @@
         {
             # Get number of correct, incorrect parts
             my $parts = $curRes->parts();
-            $totalParts += $curRes->countParts();
             my $partsRight = 0;
 	    my $partsCount = 0;
             my $stack = $iterator->getStack();
@@ -145,11 +144,12 @@
 		    my $score = $curRes->weight($part) * $curRes->awarded($part);
 		    $partsRight += $score;
 		    $totalRight += $score;
-		    $partsCount += $curRes->weight();
+		    $partsCount += $curRes->weight($part);
 
 		    if ($curRes->opendate($part) < $now) {
 			$totalPossible += $curRes->weight();
 		    }
+		    $totalParts += $curRes->weight($part);
 		} else {
 		    my $status = $curRes->getCompletionStatus($part);
 		    my $thisright = 0;
@@ -164,6 +164,7 @@
 		    }
 		    
 		    my $dateStatus = $curRes->getDateStatus($part);
+		    $totalParts++;
 		    if ($curRes->opendate($part) < $now) {
 			$totalPossible++;
 		    }
@@ -171,7 +172,7 @@
             }
 
             if ($depth == 1) { # in top-level only
-		$topLevelParts += scalar(@{$parts});
+		$topLevelParts += $partsCount;
 		$topLevelRight += $partsRight;
 		$r->print($curRes->compTitle() . '<br>');
 	    }