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

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 09 Apr 2003 14:51:29 -0000


matthew		Wed Apr  9 10:51:29 2003 EDT

  Modified files:              
    /loncom/interface	loncoursedata.pm 
  Log:
  Fix get_current_state and get_student_performance_data to work when requesting
  a specific symb.
  
  
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.66 loncom/interface/loncoursedata.pm:1.67
--- loncom/interface/loncoursedata.pm:1.66	Tue Apr  1 11:53:50 2003
+++ loncom/interface/loncoursedata.pm	Wed Apr  9 10:51:29 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursedata.pm,v 1.66 2003/04/01 16:53:50 matthew Exp $
+# $Id: loncoursedata.pm,v 1.67 2003/04/09 14:51:29 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1039,7 +1039,7 @@
             "LEFT JOIN $symb_table AS d ON d.symb_id = a.symb_id ".
                 "WHERE student='$student'";
         if (defined($symb) && $symb ne '') {
-            $request .= " AND d.symb='".$dbh->quote($symb)."'";
+            $request .= " AND d.symb=".$dbh->quote($symb);
         }
     } elsif (defined($symb) && $symb ne '') {
         $request .= "FROM $symb_table as d ".
@@ -1069,6 +1069,9 @@
         $studentdata->{$symb}->{$base.'.award'}   = $award;
         $studentdata->{$symb}->{$base.'.awarddetail'} = $awarddetail;
         $studentdata->{$symb}->{'timestamp'} = $time if (defined($time) && $time ne '');
+    }
+    if (defined($symb) && $symb ne '') {
+        $studentdata = $studentdata->{$symb};
     }
     return $studentdata;
 }