version 1.119, 2003/04/03 21:46:27
|
version 1.122, 2003/05/09 17:01:08
|
Line 50 use Apache::essayresponse();
|
Line 50 use Apache::essayresponse();
|
use Apache::externalresponse(); |
use Apache::externalresponse(); |
use Apache::rankresponse(); |
use Apache::rankresponse(); |
use Apache::matchresponse(); |
use Apache::matchresponse(); |
|
#use Apache::chemresponse(); |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use HTML::Entities(); |
use HTML::Entities(); |
use Apache::loncommon(); |
use Apache::loncommon(); |
Line 207 sub check_access {
|
Line 208 sub check_access {
|
$datemsg = "was due on $lastdate, and answers will be available on $date"; |
$datemsg = "was due on $lastdate, and answers will be available on $date"; |
} |
} |
if ($status eq 'CAN_ANSWER') { |
if ($status eq 'CAN_ANSWER') { |
#check #tries |
#check #tries, and if correct. |
my $tries = $Apache::lonhomework::history{"resource.$id.tries"}; |
my $tries = $Apache::lonhomework::history{"resource.$id.tries"}; |
my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries"); |
my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries"); |
if ( $tries eq '' ) { $tries = '0'; } |
if ( $tries eq '' ) { $tries = '0'; } |
if ( $maxtries eq '' ) { $maxtries = '2'; } |
if ( $maxtries eq '' ) { $maxtries = '2'; } |
if ($tries >= $maxtries) { $status = 'CANNOT_ANSWER'; } |
if ($tries >= $maxtries) { $status = 'CANNOT_ANSWER'; } |
|
if($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/) { |
|
$status = 'CANNOT_ANSWER'; |
|
} |
} |
} |
|
|
if (($status ne 'CLOSED') && ($Apache::lonhomework::type eq 'exam') && |
if (($status ne 'CLOSED') && ($Apache::lonhomework::type eq 'exam') && |
Line 285 sub setuppermissions {
|
Line 289 sub setuppermissions {
|
} |
} |
|
|
sub setupheader { |
sub setupheader { |
my $request=$_[0]; |
my $request=$_[0]; |
if ($ENV{'browser.mathml'}) { |
if ($ENV{'browser.mathml'}) { |
$request->content_type('text/xml'); |
$request->content_type('text/xml'); |
} else { |
} else { |
$request->content_type('text/html'); |
$request->content_type('text/html'); |
} |
} |
if (!$Apache::lonxml::debug && ($ENV{'REQUEST_METHOD'} eq 'GET')) { |
$request->content_encoding('UTF-8'); |
&Apache::loncommon::no_cache($request); |
if (!$Apache::lonxml::debug && ($ENV{'REQUEST_METHOD'} eq 'GET')) { |
} |
&Apache::loncommon::no_cache($request); |
$request->send_http_header; |
} |
return OK if $request->header_only; |
$request->send_http_header; |
return '' |
return OK if $request->header_only; |
|
return '' |
} |
} |
|
|
sub handle_save_or_undo { |
sub handle_save_or_undo { |