--- loncom/homework/lonhomework.pm 2006/05/12 01:20:44 1.245 +++ loncom/homework/lonhomework.pm 2006/05/12 03:46:54 1.246 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.245 2006/05/12 01:20:44 albertel Exp $ +# $Id: lonhomework.pm,v 1.246 2006/05/12 03:46:54 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -479,6 +479,20 @@ sub check_access { return ($status,$datemsg); } +sub due_date { + my ($part_id,$symb)=@_; + my $date; + my $interval= &Apache::lonnet::EXT("resource.$part_id.interval",$symb); + if ($interval) { + my $first_access=&Apache::lonnet::get_first_access('map',$symb); + if ($first_access) { $date = $first_access+$interval; } + } + if (!defined($date)) { + $date = &Apache::lonnet::EXT("resource.$part_id.duedate",$symb); + } + return $date +} + sub seconds_to_human_length { my ($length)=@_;