--- loncom/homework/lonhomework.pm 2004/09/29 06:50:31 1.178.2.2 +++ loncom/homework/lonhomework.pm 2004/09/18 17:29:29 1.179 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.178.2.2 2004/09/29 06:50:31 albertel Exp $ +# $Id: lonhomework.pm,v 1.179 2004/09/18 17:29:29 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' || $status eq 'CANNOT_ANSWER') { + if ($status eq 'CAN_ANSWER') { my $interval=&Apache::lonnet::EXT("resource.$id.interval"); &Apache::lonxml::debug("looking for interval $interval"); if ($interval) { @@ -453,7 +453,8 @@ sub analyze_header { '.&mt("Analyzing a problem").' '.&Apache::lonxml::message_location().'
+ &HTML::Entities::encode($ENV{'request.uri'},'<>&"').'">'. + &Apache::structuretags::remember_problem_state().'
@@ -573,7 +574,8 @@ sub editxmlmode { $result.=''. &Apache::lonxml::message_location().' + &HTML::Entities::encode($ENV{'request.uri'},'<>&"').'">'. + &Apache::structuretags::remember_problem_state().' @@ -753,7 +755,9 @@ sub handler { if (&setupheader($request)) { return OK; } $ENV{'request.uri'}=$request->uri; - &setuppermissions(); + #setup permissions + $Apache::lonhomework::browse= &Apache::lonnet::allowed('bre',$ENV{'request.filename'}); + $Apache::lonhomework::viewgrades=&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'}); &Apache::lonxml::debug("Permissions:$Apache::lonhomework::browse:$Apache::lonhomework::viewgrades:"); # some times multiple problemmodes are submitted, need to select # the last one