[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 20 Jul 2006 03:57:39 -0000


albertel		Wed Jul 19 23:57:39 2006 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm 
  Log:
  - being more resilent against badly set interval info
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.256 loncom/homework/lonhomework.pm:1.257
--- loncom/homework/lonhomework.pm:1.256	Fri Jun 30 13:42:38 2006
+++ loncom/homework/lonhomework.pm	Wed Jul 19 23:57:38 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.256 2006/06/30 17:42:38 albertel Exp $
+# $Id: lonhomework.pm,v 1.257 2006/07/20 03:57:38 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -514,8 +514,9 @@
     my $due_date= &Apache::lonnet::EXT("resource.$part_id.duedate",$symb,
 				       $udom,$uname);
     &Apache::lonxml::debug("looking for due_date $part_id $symb $due_date");
-    if (defined($interval)) {
+    if ($interval =~ /\d+/) {
 	my $first_access=&Apache::lonnet::get_first_access('map',$symb);
+	&Apache::lonxml::debug("looking for first_access $first_access");
 	if (defined($first_access)) {
 	    $interval = $first_access+$interval;
 	    $date = ($interval < $due_date)? $interval : $due_date;