--- loncom/homework/inputtags.pm 2000/12/12 22:35:52 1.17
+++ loncom/homework/inputtags.pm 2000/12/15 20:31:30 1.18
@@ -16,6 +16,7 @@ sub initialize_inputtags {
@Apache::inputtags::responselist=();
@Apache::inputtags::answergroup=();
$Apache::inputtags::part='';
+ @Apache::inputtags::status=();
%Apache::inputtags::params=();
}
@@ -250,11 +251,11 @@ sub gradestatus {
my $showbutton = 1;
my $message = '';
my $trystr='';
- my $button='';
+ my $button='';
- my ($date,$passed) = &Apache::lonhomework::check_date("OPEN_DATE",$id);
+ my $status = $Apache::lonhomework::part['-1'];
- if ( $passed ) {
+ if ( $status eq 'CAN_ANSWER' || $status eq 'SHOW_ANSWER' ) {
my $award = $Apache::lonhomework::history{"resource.$id.award"};
&Apache::lonxml::debug("Found Award |$award|");
if ( $award ne '' ) {
@@ -263,13 +264,14 @@ sub gradestatus {
}
my $tries = $Apache::lonhomework::history{"resource.$id.tries"};
my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries");
- &Apache::lonxml::debug("goit maxtries of :$maxtries:");
+ &Apache::lonxml::debug("got 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 ( $status eq 'SHOW_ANSWER' ) { $showbutton = 0; }
if ( $showbutton ) {
$button = '
';
}