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

www www@source.lon-capa.org
Fri, 03 Jun 2011 01:07:22 -0000


www		Fri Jun  3 01:07:22 2011 EDT

  Modified files:              
    /loncom/interface	lonquickgrades.pm 
  Log:
  Work on getting data for complete class list
  
  
Index: loncom/interface/lonquickgrades.pm
diff -u loncom/interface/lonquickgrades.pm:1.99 loncom/interface/lonquickgrades.pm:1.100
--- loncom/interface/lonquickgrades.pm:1.99	Fri Jun  3 00:04:47 2011
+++ loncom/interface/lonquickgrades.pm	Fri Jun  3 01:07:22 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Quick Student Grades Display
 #
-# $Id: lonquickgrades.pm,v 1.99 2011/06/03 00:04:47 www Exp $
+# $Id: lonquickgrades.pm,v 1.100 2011/06/03 01:07:22 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -35,6 +35,7 @@
 use Apache::lonlocal;
 use Apache::lonnet;
 use Apache::grades;
+use Apache::loncoursedata;
 
 sub handler {
     my $r = shift;
@@ -125,7 +126,6 @@
                  $navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted);
     }
     if ($cangrade) { $r->print("\n</form>\n"); }
-
     &endGradeScreen($r);
     return OK;
 
@@ -141,9 +141,22 @@
 sub getAllStudentData {
     my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
     my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+
     my %categories=&Apache::lonnet::dump('grading_categories',$cdom,$cnum);
-#FIXME: debugging output
-    return &getStudentCatGrade('korte','gerd',%categories);
+
+    my $classlist = &Apache::loncoursedata::get_classlist();
+
+    my $statusidx   = &Apache::loncoursedata::CL_STATUS();
+    my $usernameidx = &Apache::loncoursedata::CL_SNAME();
+    my $domainidx   = &Apache::loncoursedata::CL_SDOM();
+    my $fullnameidx = &Apache::loncoursedata::CL_FULLNAME();
+
+    foreach my $key (keys(%{$classlist})) {
+        my $student = $classlist->{$key};
+        my $perc=&getStudentCatGrade($classlist->{$student}->[$usernameidx],
+                                     $classlist->{$student}->[$domainidx],
+                                     %categories);
+    }
 }