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

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 10 Nov 2004 21:50:29 -0000


matthew		Wed Nov 10 16:50:29 2004 EDT

  Modified files:              
    /loncom/interface/statistics	lonstathelpers.pm 
  Log:
  &GetStudentAnswers now returns a hash of answers { $sname:$sdom => $answer,}
  
  
Index: loncom/interface/statistics/lonstathelpers.pm
diff -u loncom/interface/statistics/lonstathelpers.pm:1.30 loncom/interface/statistics/lonstathelpers.pm:1.31
--- loncom/interface/statistics/lonstathelpers.pm:1.30	Mon Nov  8 10:14:52 2004
+++ loncom/interface/statistics/lonstathelpers.pm	Wed Nov 10 16:50:29 2004
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstathelpers.pm,v 1.30 2004/11/08 15:14:52 matthew Exp $
+# $Id: lonstathelpers.pm,v 1.31 2004/11/10 21:50:29 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -555,6 +555,7 @@
 #####################################################
 sub GetStudentAnswers {
     my ($r,$problem,$Students,$formname,$inputname) = @_;
+    my %answers;
     my $status_type;
     if (defined($formname)) {
         $status_type = 'inline';
@@ -582,6 +583,7 @@
             ($resource,$sname,$sdom,$partid,$respid);
         &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
                                                  &mt('last student'));
+        $answers{$answer}++;
         $student->{'answer'} = $answer;
     }
     &Apache::lonstathelpers::write_analysis_cache();
@@ -589,7 +591,7 @@
     $r->rflush();
     # close progress window
     &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
-    return;
+    return \%answers;
 }
 
 #####################################################