--- loncom/homework/structuretags.pm 2002/11/13 23:37:56 1.137 +++ loncom/homework/structuretags.pm 2002/11/25 21:19:45 1.139 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.137 2002/11/13 23:37:56 albertel Exp $ +# $Id: structuretags.pm,v 1.139 2002/11/25 21:19:45 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -118,10 +118,12 @@ sub page_start { return ($result,$head_tag_start,$body_tag_start,$form_tag_start); } +use Time::HiRes(); sub get_resource_name { my ($parstack,$safeeval)=@_; - my $name=&Apache::lonxml::get_param('name',$parstack,$safeeval); - if ($name eq '') { + my $name=&Apache::lonnet::gettitle(); + &Apache::lonnet::logthis("Got $name"); + if ($name eq '') { $name=&Apache::lonnet::EXT('resource.title'); if ($name eq 'con_lost') { $name = ''; } } @@ -693,17 +695,19 @@ sub end_part { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; &Apache::lonxml::debug("in end_part $target "); my $status=$Apache::inputtags::status['-1']; - pop @Apache::inputtags::status; - if ( $target eq 'meta' ) { return ''; } - if ( $target eq 'grade' && $status eq 'CAN_ANSWER') { - return &Apache::inputtags::grade; - } - if ($target eq 'web' || $target eq 'tex' ) { - my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part,$target); + my $result=''; + if ( $target eq 'meta' ) { + $result=''; + } elsif ( $target eq 'grade' && $status eq 'CAN_ANSWER') { + $result=&Apache::inputtags::grade; + } elsif ($target eq 'web' || $target eq 'tex' ) { + my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part, + $target); if ($Apache::lonhomework::type eq 'exam') {$gradestatus='';} - return $gradestatus; + $result=$gradestatus; } - return ''; + pop @Apache::inputtags::status; + return $result; } sub start_preduedate {