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

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 06 Jul 2004 15:50:04 -0000


matthew		Tue Jul  6 11:50:04 2004 EDT

  Modified files:              
    /loncom/interface	loncoursedata.pm 
  Log:
  Added error checks in &get_response_data.
  
  
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.136 loncom/interface/loncoursedata.pm:1.137
--- loncom/interface/loncoursedata.pm:1.136	Tue Jun 29 00:30:00 2004
+++ loncom/interface/loncoursedata.pm	Tue Jul  6 11:50:03 2004
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursedata.pm,v 1.136 2004/06/29 04:30:00 raeburn Exp $
+# $Id: loncoursedata.pm,v 1.137 2004/07/06 15:50:03 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2530,7 +2530,15 @@
     #
     &setup_table_names($courseid);
     my $symb_id = &get_symb_id($symb);
+    if (! defined($symb_id)) {
+        &Apache::lonnet::logthis('Unable to find symb for '.$symb.' in '.$courseid);
+        return undef;
+    }
     my $response_id = &get_part_id($response);
+    if (! defined($response_id)) {
+        &Apache::lonnet::logthis('Unable to find id for '.$response.' in '.$courseid);
+        return undef;
+    }
     #
     my $dbh = &Apache::lonmysql::get_dbh();
     return undef if (! defined($dbh));