version 1.255, 2010/10/12 16:07:43
|
version 1.256, 2010/11/01 16:32:32
|
Line 37 use Apache::lonmenu;
|
Line 37 use Apache::lonmenu;
|
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonxml; |
use Apache::lonxml; |
use Apache::slotrequest(); |
use Apache::slotrequest(); |
|
use Apache::structuretags(); |
use Time::HiRes qw( gettimeofday tv_interval ); |
use Time::HiRes qw( gettimeofday tv_interval ); |
use LONCAPA; |
use LONCAPA; |
|
|
Line 380 sub show_task {
|
Line 381 sub show_task {
|
( $status eq 'BANNED') || |
( $status eq 'BANNED') || |
( $status eq 'UNAVAILABLE') || |
( $status eq 'UNAVAILABLE') || |
( $status eq 'NOT_IN_A_SLOT') || |
( $status eq 'NOT_IN_A_SLOT') || |
|
( $status eq 'NOT_YET_VIEWED') || |
( $status eq 'NEEDS_CHECKIN') || |
( $status eq 'NEEDS_CHECKIN') || |
( $status eq 'WAITING_FOR_GRADE') || |
( $status eq 'WAITING_FOR_GRADE') || |
( $status eq 'INVALID_ACCESS') || |
( $status eq 'INVALID_ACCESS') || |
Line 627 sub start_Task {
|
Line 629 sub start_Task {
|
&Apache::structuretags::page_start($target,$token,$tagstack, |
&Apache::structuretags::page_start($target,$token,$tagstack, |
$parstack,$parser,$safeeval, |
$parstack,$parser,$safeeval, |
$name,&style($target)); |
$name,&style($target)); |
|
|
|
} |
|
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || |
|
$target eq 'tex') { |
|
if ($env{'form.markaccess'}) { |
|
my @interval=&Apache::lonnet::EXT("resource.0.interval"); |
|
&Apache::lonnet::set_first_access($interval[1]); |
|
} |
} |
} |
|
|
if ($target eq 'web' && $env{'request.state'} ne 'construct') { |
if ($target eq 'web' && $env{'request.state'} ne 'construct') { |
Line 669 sub start_Task {
|
Line 679 sub start_Task {
|
my ($version,$previous)=&get_version(); |
my ($version,$previous)=&get_version(); |
($status,$accessmsg,my $slot_name,$slot) = |
($status,$accessmsg,my $slot_name,$slot) = |
&Apache::lonhomework::check_slot_access('0','Task'); |
&Apache::lonhomework::check_slot_access('0','Task'); |
if ($status eq 'CAN_ANSWER' && $version eq '') { |
if ((($status eq 'CAN_ANSWER') || ($status eq 'NOT_YET_VIEWED')) && ($version eq '')) { |
# CAN_ANSWER mode, and no current version, unproctored access |
# CAN_ANSWER or NOT_YET_VIEWED mode, and no current version, unproctored access |
# thus self-checkedin |
# thus self-checkedin |
my $check = &check_in('Task',undef,undef,$slot_name); |
my $check = &check_in('Task',undef,undef,$slot_name); |
if ($check =~ /^error: /) { |
if ($check =~ /^error: /) { |
Line 714 sub start_Task {
|
Line 724 sub start_Task {
|
$msg.='<h1>'.&mt('Your submission is in the grading queue.').'</h1>'; |
$msg.='<h1>'.&mt('Your submission is in the grading queue.').'</h1>'; |
} elsif ($env{'form.donescreen'}) { |
} elsif ($env{'form.donescreen'}) { |
$result .= &done_screen($version); |
$result .= &done_screen($version); |
} elsif ($status ne 'NOT_YET_VIEWED') { |
} elsif ($status eq 'NOT_YET_VIEWED') { |
|
my $symb=&Apache::lonnet::symbread(); |
|
$msg.=&Apache::structuretags::firstaccess_msg($accessmsg,$symb); |
|
} else { |
$msg.='<h1>'.&mt('Not open to be viewed').'</h1>'; |
$msg.='<h1>'.&mt('Not open to be viewed').'</h1>'; |
} |
} |
if ($status eq 'CLOSED' || $status eq 'INVALID_ACCESS') { |
if ($status eq 'CLOSED' || $status eq 'INVALID_ACCESS') { |
Line 1339 DONEBUTTON
|
Line 1352 DONEBUTTON
|
$Apache::lonhomework::results{"resource.$version.0.solved"}; |
$Apache::lonhomework::results{"resource.$version.0.solved"}; |
} |
} |
&minimize_storage(); |
&minimize_storage(); |
my ($canstore,$domain,$name); |
my ($canstore,$domain,$name,$symb,$courseid); |
|
($symb,$courseid,$domain,$name) = &Apache::lonnet::whichuser(); |
|
|
if ($env{'form.gradingkey'}) { |
if ($env{'form.gradingkey'}) { |
(my $symb,my $courseid,$domain,$name) = |
|
&Apache::lonnet::whichuser(); |
|
my $todo=&unescape($env{'form.gradingkey'}); |
my $todo=&unescape($env{'form.gradingkey'}); |
my ($keysymb,$uname,$udom)=&decode_queue_key($todo); |
my ($keysymb,$uname,$udom)=&decode_queue_key($todo); |
if ($symb eq $keysymb) { |
if ($symb eq $keysymb) { |
Line 1353 DONEBUTTON
|
Line 1366 DONEBUTTON
|
} |
} |
if ($canstore) { |
if ($canstore) { |
&Apache::structuretags::finalize_storage(); |
&Apache::structuretags::finalize_storage(); |
|
my @interval = &Apache::lonnet::EXT("resource.0.interval"); |
|
if ($interval[0] =~ /^\d+$/ && $interval[1] eq 'resource') { |
|
my $key=$courseid."\0".$symb; |
|
my %times=&Apache::lonnet::get('firstaccesstimes', |
|
[$key],$domain,$name); |
|
if ($times{$key}) { |
|
my $delresult.=&Apache::lonnet::del('firstaccesstimes', |
|
[$key],$domain,$name); |
|
} |
|
} |
# data stored, now handle queue |
# data stored, now handle queue |
if ($review) { |
if ($review) { |
if ($env{'form.queue'} eq 'reviewqueue') { |
if ($env{'form.queue'} eq 'reviewqueue') { |