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

www www@source.lon-capa.org
Mon, 28 Mar 2011 01:26:39 -0000


www		Mon Mar 28 01:26:39 2011 EDT

  Modified files:              
    /loncom/interface	lonquickgrades.pm 
  Log:
  Data collection seems to work
  
  
Index: loncom/interface/lonquickgrades.pm
diff -u loncom/interface/lonquickgrades.pm:1.82 loncom/interface/lonquickgrades.pm:1.83
--- loncom/interface/lonquickgrades.pm:1.82	Sat Mar 26 22:37:47 2011
+++ loncom/interface/lonquickgrades.pm	Mon Mar 28 01:26:39 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Quick Student Grades Display
 #
-# $Id: lonquickgrades.pm,v 1.82 2011/03/26 22:37:47 www Exp $
+# $Id: lonquickgrades.pm,v 1.83 2011/03/28 01:26:39 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -62,7 +62,8 @@
     $r->send_http_header;
 
     my $showPoints =
-        $env{'course.'.$env{'request.course.id'}.'.grading'} eq 'standard';
+        (($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'standard')
+      || ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories'));
     my $notshowSPRSlink =
         (($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'external')
       || ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals'));
@@ -266,8 +267,12 @@
 		    $totalRight += $score;
 		    $partsCount += $curRes->weight($part);
 
+                    $curRes->{DATA}->{PROB_SCORE}  += $score;
+                    $curRes->{DATA}->{PROB_WEIGHT} += $curRes->weight($part);
+
 		    if ($curRes->opendate($part) < $now) {
 			$totalPossible += $curRes->weight($part);
+                        $curRes->{DATA}->{PROB_POSSIBLE} += $curRes->weight($part);
 		    }
 		    $totalParts += $curRes->weight($part);
 		} else {
@@ -470,7 +475,7 @@
 #    my %data=&dumpdata($navmap);
 #    foreach (keys(%data)) {
 #        $r->print("\n<br />".$_.'='.$data{$_});
-#     }
+#    }
 }
 
 #
@@ -491,8 +496,12 @@
     while ($depth > 0) {
         if ($curRes == $iterator->BEGIN_MAP()) {$depth++;}
         if ($curRes == $iterator->END_MAP()) { $depth--; }
-        if (ref($curRes) && $curRes->is_map()) {
-            $returndata{$curRes->symb()}=$curRes->{DATA}->{CHILD_PARTS}.':'.$curRes->{DATA}->{CHILD_ATTEMPTED}.':'.$curRes->{DATA}->{CHILD_CORRECT};
+        if (ref($curRes)) {
+            if ($curRes->is_map()) {
+                $returndata{$curRes->symb()}='folder:'.$curRes->{DATA}->{CHILD_PARTS}.':'.$curRes->{DATA}->{CHILD_ATTEMPTED}.':'.$curRes->{DATA}->{CHILD_CORRECT};
+            } else {
+                $returndata{$curRes->symb()}='res:'.$curRes->{DATA}->{PROB_WEIGHT}.':'.$curRes->{DATA}->{PROB_POSSIBLE}.':'.$curRes->{DATA}->{PROB_SCORE};
+            } 
         }
         $curRes = $iterator->next();
     }