--- loncom/homework/inputtags.pm 2000/12/12 20:38:22 1.16 +++ loncom/homework/inputtags.pm 2000/12/12 22:35:52 1.17 @@ -249,25 +249,30 @@ sub gradestatus { my ($id) = @_; my $showbutton = 1; my $message = ''; - my $award = $Apache::lonhomework::history{"resource.$id.award"}; - &Apache::lonxml::debug("Found Award |$award|"); - if ( $award ne '' ) { - &Apache::lonxml::debug('Getting message'); - ($showbutton,$message) = &decideoutput($award); - } - my $button=''; - my $tries = $Apache::lonhomework::history{"resource.$id.tries"}; - my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries"); - &Apache::lonxml::debug("goit maxtries of :$maxtries:"); - if ( $tries eq '' ) { $tries = '0'; } - if ( $maxtries eq '' ) { $maxtries = '2'; } my $trystr=''; - if ( $showbutton ) { - $trystr = "

Tries $tries/$maxtries"; - } - if ( $tries >= $maxtries ) { $showbutton = 0; } - if ( $showbutton ) { - $button = '

'; + my $button=''; + + my ($date,$passed) = &Apache::lonhomework::check_date("OPEN_DATE",$id); + + if ( $passed ) { + my $award = $Apache::lonhomework::history{"resource.$id.award"}; + &Apache::lonxml::debug("Found Award |$award|"); + if ( $award ne '' ) { + &Apache::lonxml::debug('Getting message'); + ($showbutton,$message) = &decideoutput($award); + } + my $tries = $Apache::lonhomework::history{"resource.$id.tries"}; + my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries"); + &Apache::lonxml::debug("goit maxtries of :$maxtries:"); + if ( $tries eq '' ) { $tries = '0'; } + if ( $maxtries eq '' ) { $maxtries = '2'; } + if ( $showbutton ) { + $trystr = "

Tries $tries/$maxtries"; + } + if ( $tries >= $maxtries ) { $showbutton = 0; } + if ( $showbutton ) { + $button = '

'; + } } return $button.$message.$trystr; }