--- loncom/homework/lonhomework.pm 2002/08/07 18:20:29 1.85 +++ loncom/homework/lonhomework.pm 2002/09/07 18:21:44 1.87 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.85 2002/08/07 18:20:29 albertel Exp $ +# $Id: lonhomework.pm,v 1.87 2002/09/07 18:21:44 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -148,6 +148,15 @@ sub check_access { foreach $temp ("opendate","duedate","answerdate") { $lastdate = $date; $date = &Apache::lonnet::EXT("resource.$id.$temp"); + my $thistype = &Apache::lonnet::EXT("resource.$id.$temp.type"); + if ($thistype eq 'date_interval') { + if ($temp eq 'opendate') { + $date=&Apache::lonnet::EXT("resource.$id.duedate")-$date; + } + if ($temp eq 'answerdate') { + $date=&Apache::lonnet::EXT("resource.$id.duedate")+$date; + } + } &Apache::lonxml::debug("found :$date: for :$temp:"); if ($date eq '') { $date = "an unknown date"; $passed = 0; @@ -422,7 +431,7 @@ sub get_template_list { push (@allnames, $name); } } - if (@allnames) { + if (@allnames && !$result) { $result="\n'; }