--- loncom/homework/structuretags.pm 2005/04/25 21:40:33 1.290 +++ loncom/homework/structuretags.pm 2005/06/04 02:56:44 1.293 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.290 2005/04/25 21:40:33 albertel Exp $ +# $Id: structuretags.pm,v 1.293 2005/06/04 02:56:44 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -96,6 +96,7 @@ sub body_tag_start { } return $body_tag_start; } + sub page_start { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my %found; @@ -126,7 +127,8 @@ sub page_start { my $bgcolor=&Apache::lonxml::get_param('bgcolor',$parstack, $safeeval); $body_tag_start=&body_tag_start($background,$bgcolor); - if ($target eq 'web' && $env{'request.state'} ne 'construct') { + if ( ($target eq 'web' || $target eq 'webgrade') + && $env{'request.state'} ne 'construct') { my ($symb,undef,undef,undef,$publicuser)= &Apache::lonxml::whichuser(); if ($symb eq '' && !$publicuser) { @@ -370,13 +372,19 @@ sub store_aggregates { } if ($Apache::lonhomework::results{'resource.'.$part.'.tries'} == 1) { $aggregate{$symb."\0".$part."\0users"} = 1; + } else { + my (undef,$last_reset) = &Apache::grades::get_last_resets($symb,$env{'request.course.id'},[$part]); + if ($last_reset) { + if (&Apache::grades::get_num_tries(\%Apache::lonhomework::history,$last_reset,$part) == 0) { + $aggregate{$symb."\0".$part."\0users"} = 1; + } + } } $aggregate{$symb."\0".$part."\0attempts"} = 1; } - if (%aggregate) { + if (keys (%aggregate) > 0) { &Apache::lonnet::cinc('nohist_resourcetracker',\%aggregate, - $cdomain,$cname); - + $cdomain,$cname); } }