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

bowersj2 lon-capa-cvs@mail.lon-capa.org
Fri, 13 Jun 2003 19:11:56 -0000


bowersj2		Fri Jun 13 15:11:56 2003 EDT

  Modified files:              
    /loncom/interface	lonquickgrades.pm 
  Log:
  Fix bug 1653 - can't go to maps in /uploaded. Thus, for consistency, 
  can't go to any maps.
  
  This *really* sucks for the quickgrades screen, but I don't think we 
  have alternatives unless *all* maps can be browsed.
  
  
Index: loncom/interface/lonquickgrades.pm
diff -u loncom/interface/lonquickgrades.pm:1.13 loncom/interface/lonquickgrades.pm:1.14
--- loncom/interface/lonquickgrades.pm:1.13	Fri Mar 28 13:14:59 2003
+++ loncom/interface/lonquickgrades.pm	Fri Jun 13 15:11:56 2003
@@ -107,6 +107,7 @@
     #  the counts to the parent map.)
 
     my $totalParts = 0; my $totalPossible = 0; my $totalRight = 0;
+    my $now = time();
 
     # Pre-run: Count parts correct
     while ( $depth > 0 ) {
@@ -117,21 +118,22 @@
         {
             # Get number of correct, incorrect parts
             my $parts = $curRes->parts();
-            if (scalar(@{$parts}) > 1) { shift @{$parts}; } # lose the first "0"
-            $totalParts += scalar(@{$parts});
+            $totalParts += $curRes->countParts();
             my $partsRight = 0;
             my $stack = $iterator->getStack();
             
             for my $part (@{$parts}) {
                 my $status = $curRes->getCompletionStatus($part);
+                my $thisright = 0;
                 if ($status == $curRes->CORRECT || $status == $curRes->CORRECT_BY_OVERRIDE
-                    || $status == $curRes->EXCUSED) {
+                    || $status == $curRes->EXCUSED || $status == $curRes->ANSWER_SUBMITTED) {
                     $partsRight++;
                     $totalRight++;
+                    $thisright = 1;
                 }
 
                 my $dateStatus = $curRes->getDateStatus($part);
-                if ($status != $curRes->OPEN_LATER) {
+                if ($curRes->opendate($part) < $now) {
                     $totalPossible++;
                 }
             }
@@ -173,13 +175,6 @@
         if ($curRes == $iterator->END_MAP()) { $depth--; }
 
         if (ref($curRes) && $curRes->is_map()) {
-            my $stack = $iterator->getStack();
-            my $src = Apache::lonnavmaps::getLinkForResource($stack);
-            my $srcHasQuestion = $src =~ /\?/;
-            my $link = $src.
-                ($srcHasQuestion?'&':'?') .
-                'symb='.&Apache::lonnet::escape($curRes->symb()).
-                '"';
             my $title = $curRes->compTitle();
             
             my $correct = $curRes->{DATA}->{CHILD_CORRECT};
@@ -196,7 +191,7 @@
                 
                 for (my $i = 1; $i < $depth; $i++) { $r->print($indentString); }
                 
-                $r->print("<a href='$link'>$title</a></td>");
+                $r->print("$title</td>");
                 $r->print("<td align='center'>$correct / $total</td></tr>\n");
             }
         }
@@ -209,7 +204,7 @@
         my $ratio = $unaccountedCorrect / $unaccountedTotal;
         my $color = mixColors(\@start, \@end, $ratio);
         $r->print("<tr><td bgcolor='$color'>");
-        $r->print("Problems Not Contained In Sequences</td><td align='center'>");
+        $r->print("Problems Not Contained In A Folder</td><td align='center'>");
         $r->print("$unaccountedCorrect / $unaccountedTotal</td></tr>");
     }