--- loncom/homework/lonhomework.pm 2004/05/27 22:25:16 1.177 +++ loncom/homework/lonhomework.pm 2004/12/03 21:47:38 1.186 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.177 2004/05/27 22:25:16 albertel Exp $ +# $Id: lonhomework.pm,v 1.186 2004/12/03 21:47:38 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -52,7 +52,7 @@ use Apache::Constants qw(:common); use HTML::Entities(); use Apache::loncommon(); use Apache::lonlocal; -#use Time::HiRes qw( gettimeofday tv_interval ); +use Time::HiRes qw( gettimeofday tv_interval ); BEGIN { &Apache::lonxml::register_insert(); @@ -292,7 +292,7 @@ sub check_access { $status = 'CANNOT_ANSWER'; } } - if ($status eq 'CAN_ANSWER') { + if ($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER') { my $interval=&Apache::lonnet::EXT("resource.$id.interval"); &Apache::lonxml::debug("looking for interval $interval"); if ($interval) { @@ -385,6 +385,12 @@ sub setuppermissions { '/'.$ENV{'request.course.sec'}); } $Apache::lonhomework::viewgrades = $viewgrades; + if ($Apache::lonhomework::browse eq 'F' && + $ENV{'form.devalidatecourseresdata'} eq 'on') { + my (undef,$courseid) = &Apache::lonxml::whichuser(); + &Apache::lonnet::devalidatecourseresdata($ENV{"course.$courseid.num"}, + $ENV{"course.$courseid.domain"}); + } return '' } @@ -449,11 +455,16 @@ sub handle_save_or_undo { sub analyze_header { my ($request) = @_; + my $bodytag='
'; + if ($ENV{'environment.remote'} eq 'off') { + $bodytag=&Apache::loncommon::bodytag(); + } my $result.='