version 1.16, 2000/12/12 20:38:22
|
version 1.17, 2000/12/12 22:35:52
|
Line 249 sub gradestatus {
|
Line 249 sub gradestatus {
|
my ($id) = @_; |
my ($id) = @_; |
my $showbutton = 1; |
my $showbutton = 1; |
my $message = ''; |
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=''; |
my $trystr=''; |
if ( $showbutton ) { |
my $button=''; |
$trystr = "<br></br>Tries $tries/$maxtries"; |
|
} |
my ($date,$passed) = &Apache::lonhomework::check_date("OPEN_DATE",$id); |
if ( $tries >= $maxtries ) { $showbutton = 0; } |
|
if ( $showbutton ) { |
if ( $passed ) { |
$button = '<input type="submit" name="submit" value="Submit All Answers"><br></br>'; |
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 = "<br></br>Tries $tries/$maxtries"; |
|
} |
|
if ( $tries >= $maxtries ) { $showbutton = 0; } |
|
if ( $showbutton ) { |
|
$button = '<input type="submit" name="submit" value="Submit All Answers"><br></br>'; |
|
} |
} |
} |
return $button.$message.$trystr; |
return $button.$message.$trystr; |
} |
} |