--- loncom/homework/lonhomework.pm 2006/05/12 01:18:50 1.244 +++ 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.244 2006/05/12 01:18:50 albertel Exp $ +# $Id: lonhomework.pm,v 1.246 2006/05/12 03:46:54 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -238,7 +238,7 @@ sub check_slot_access { my ($status,$datemsg)=&check_access($id); my $useslots = &Apache::lonnet::EXT("resource.$id.useslots"); - if ($useslots ne 'resource' && $useslots ne 'sequence') { + if ($useslots ne 'resource' && $useslots ne 'map') { return ($status,$datemsg); } @@ -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)=@_;