version 1.323, 2011/02/06 18:43:10
|
version 1.327, 2011/07/04 13:01:57
|
Line 147 sub get_target {
|
Line 147 sub get_target {
|
} else { |
} else { |
if ($env{'form.problemstate'} eq 'WEB_GRADE') { |
if ($env{'form.problemstate'} eq 'WEB_GRADE') { |
return ('grade','webgrade','answer'); |
return ('grade','webgrade','answer'); |
|
} elsif ($env{'form.problemmode'} eq 'view') { |
|
return ('grade','web','answer'); |
} elsif ($env{'form.problemmode'} eq 'saveview') { |
} elsif ($env{'form.problemmode'} eq 'saveview') { |
return ('modified','web','answer'); |
return ('modified','web','answer'); |
} elsif ($env{'form.problemmode'} eq 'discard') { |
} elsif ($env{'form.problemmode'} eq 'discard') { |
Line 374 sub check_access {
|
Line 376 sub check_access {
|
$date=&mt("can not be accessed from your location."); |
$date=&mt("can not be accessed from your location."); |
return($status,$date); |
return($status,$date); |
} |
} |
|
if ($env{'form.grade_imsexport'}) { |
|
if (($env{'request.course.id'}) && |
|
(&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) { |
|
return ('SHOW_ANSWER'); |
|
} |
|
} |
foreach my $temp ("opendate","duedate","answerdate") { |
foreach my $temp ("opendate","duedate","answerdate") { |
$lastdate = $date; |
$lastdate = $date; |
if ($temp eq 'duedate') { |
if ($temp eq 'duedate') { |
Line 432 sub check_access {
|
Line 439 sub check_access {
|
if ( $tries eq '' ) { $tries = '0'; } |
if ( $tries eq '' ) { $tries = '0'; } |
if ( $maxtries eq '' && |
if ( $maxtries eq '' && |
$env{'request.state'} ne 'construct') { $maxtries = '2'; } |
$env{'request.state'} ne 'construct') { $maxtries = '2'; } |
|
$Apache::lonhomework::results{'resource.'.$id.'.maxtries'}=$maxtries; |
if ($maxtries && $tries >= $maxtries) { $status = 'CANNOT_ANSWER'; } |
if ($maxtries && $tries >= $maxtries) { $status = 'CANNOT_ANSWER'; } |
# if (correct and show prob status) or excused then CANNOT_ANSWER |
# if (correct and show prob status) or excused then CANNOT_ANSWER |
if(($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/ |
if(($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/ |
&& |
&& |
&show_problem_status()) |
&show_problem_status() |
|
&& |
|
$Apache::lonhomework::history{"resource.$id.awarded"}==1) |
|| |
|| |
$Apache::lonhomework::history{"resource.$id.solved"}=~/^excused/) { |
$Apache::lonhomework::history{"resource.$id.solved"}=~/^excused/) { |
$status = 'CANNOT_ANSWER'; |
$status = 'CANNOT_ANSWER'; |