version 1.253, 2010/09/27 18:45:14
|
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 545 sub done_screen {
|
Line 547 sub done_screen {
|
my $title=&Apache::lonnet::gettitle($env{'request.uri'}); |
my $title=&Apache::lonnet::gettitle($env{'request.uri'}); |
my @files=split(',',$Apache::lonhomework::history{'resource.'.$version.'.0.bridgetask.portfiles'}); |
my @files=split(',',$Apache::lonhomework::history{'resource.'.$version.'.0.bridgetask.portfiles'}); |
my (undef,undef,$domain,$user)= &Apache::lonnet::whichuser(); |
my (undef,undef,$domain,$user)= &Apache::lonnet::whichuser(); |
my $files = '<ul>'; |
my ($msg,$files,$shown); |
my $msg; |
if (@files > 0) { |
foreach my $file (@files) { |
$files = '<ul>'; |
my $url="/uploaded/$domain/$user/portfolio$file"; |
foreach my $file (@files) { |
if (! &Apache::lonnet::stat_file($url)) { |
my $url="/uploaded/$domain/$user/portfolio$file"; |
$file = '<span class="LC_error">' |
if (! &Apache::lonnet::stat_file($url)) { |
.&mt('[_1]Nonexistent file:[_2]' |
$file = '<span class="LC_error">' |
,'<span class="LC_error"> ' |
.&mt('[_1]Nonexistent file:[_2]' |
,'</span> <span class="LC_filename">'.$file.'</span>'); |
,'<span class="LC_error"> ' |
$msg .= "<p>".&mt('Submitted non-existent file [_1]',$file)."</p>\n"; |
,'</span> <span class="LC_filename">'.$file.'</span>'); |
} else { |
$msg .= "<p>".&mt('Submitted non-existent file [_1]',$file)."</p>\n"; |
$file = '<span class="LC_filename">'.$file.'</span>'; |
} else { |
$msg .= "<p>".&mt('Submitted file [_1]',$file)."</p>\n"; |
$file = '<span class="LC_filename">'.$file.'</span>'; |
} |
$msg .= "<p>".&mt('Submitted file [_1]',$file)."</p>\n"; |
$files .= '<li>'.$file.'</li>'; |
} |
|
$files .= '<li>'.$file.'</li>'; |
|
} |
|
$files.='</ul>'; |
|
$shown = '<p>'.&mt('Files submitted: [_1]',$files).'</p>' |
|
.'<p>'.&mt('You are now done with this Bridge Task').'</p>' |
|
.'<hr />' |
|
.'<p><a href="/adm/logout">'.&mt('Logout').'</a></p>' |
|
.'<p><a href="/adm/roles">'.&mt('Change to a different course').'</a></p>'; |
|
} else { |
|
$msg = &mt("Submission status: no files currently submitted, when 'Done' was indicated."); |
|
$shown = '<p class="LC_error">'. |
|
&mt('You did not submit any files. Please try again.').'</span>'. |
|
'</p><p><a href="javascript:history.go(-1);">'.&mt('Back to Bridge Task').'</a></p><hr />'; |
} |
} |
$files.='</ul>'; |
|
my $subject = &mt('Submission message for [_1]',$title); |
my $subject = &mt('Submission message for [_1]',$title); |
my ($message_status,$comment_status); |
my ($message_status,$comment_status); |
my $setting = $env{'course.'.$env{'request.course.id'}.'.task_messages'}; |
my $setting = $env{'course.'.$env{'request.course.id'}.'.task_messages'}; |
Line 581 sub done_screen {
|
Line 595 sub done_screen {
|
$comment_status = '<p>'.&mt('Message sent to instructor: [_1]', |
$comment_status = '<p>'.&mt('Message sent to instructor: [_1]', |
$comment_status).' </p>'; |
$comment_status).' </p>'; |
} |
} |
|
|
return "<h2>$title</h2>" |
return "<h2>$title</h2>" |
.'<p>'.&mt('Files submitted: [_1]',$files).'</p>' |
.$shown |
.'<p>'.&mt('You are now done with this Bridge Task').'</p>' |
.$message_status |
.'<hr />' |
.$comment_status; |
.'<p><a href="/adm/logout">'.&mt('Logout').'</a></p>' |
|
.'<p><a href="/adm/roles">'.&mt('Change to a different course').'</a></p>' |
|
.$message_status |
|
.$comment_status; |
|
|
|
} |
} |
|
|
sub start_Task { |
sub start_Task { |
Line 619 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 661 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 706 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 784 sub start_Task {
|
Line 805 sub start_Task {
|
$result.='<b>'.&mt("Stopped grading.").'</b>'.$back; |
$result.='<b>'.&mt("Stopped grading.").'</b>'.$back; |
} elsif ($status_code eq 'cancel') { |
} elsif ($status_code eq 'cancel') { |
$result.='<b>'.&mt("Cancelled grading.").'</b>'.$back; |
$result.='<b>'.&mt("Cancelled grading.").'</b>'.$back; |
|
} elsif ($status_code eq 'terminated') { |
|
$result.= '<b>'.&mt('Terminated grading').'</b><br />'. |
|
'<span class="LC_error">'. |
|
&mt('Grading for [_1] has not been saved because of a grading key mismatch.', |
|
'<tt>'.$env{'form.terminated'}.'</tt>').'</span><br />'.$back; |
} elsif ($status_code eq 'never_versioned') { |
} elsif ($status_code eq 'never_versioned') { |
$result.='<b>'. |
$result.='<b>'. |
&mt("Requested user has never accessed the task."). |
&mt("Requested user has never accessed the task."). |
Line 1004 sub get_key_todo {
|
Line 1030 sub get_key_todo {
|
return (undef,'stop'); |
return (undef,'stop'); |
} elsif ($env{'form.cancel'}) { |
} elsif ($env{'form.cancel'}) { |
return (undef,'cancel'); |
return (undef,'cancel'); |
|
} elsif ($env{'form.terminated'}) { |
|
return (undef, 'terminated'); |
} elsif ($env{'form.next'}) { |
} elsif ($env{'form.next'}) { |
return (undef,'select_user'); |
return (undef,'select_user'); |
} |
} |
Line 1049 sub get_key_todo {
|
Line 1077 sub get_key_todo {
|
|
|
if ($env{'form.queuemode'} ne 'selected') { |
if ($env{'form.queuemode'} ne 'selected') { |
# don't get something new from the queue if they hit the stop button |
# don't get something new from the queue if they hit the stop button |
if (!(($env{'form.cancel'} || $env{'form.stop'}) |
if (!(($env{'form.cancel'} || $env{'form.stop'} || $env{'form.terminated'}) |
&& $target eq 'webgrade') |
&& $target eq 'webgrade') |
&& !$env{'form.gradingaction'}) { |
&& !$env{'form.gradingaction'}) { |
&Apache::lonxml::debug("Getting anew $queue"); |
&Apache::lonxml::debug("Getting anew $queue"); |
return (&get_from_queue($queue)); |
return (&get_from_queue($queue)); |
} else { |
} else { |
return (undef,'stop'); |
if ($env{'form.terminated'}) { |
|
return (undef,'terminated'); |
|
} else { |
|
return (undef,'stop'); |
|
} |
} |
} |
} |
} |
return (undef,undef) |
return (undef,undef) |
Line 1320 DONEBUTTON
|
Line 1352 DONEBUTTON
|
$Apache::lonhomework::results{"resource.$version.0.solved"}; |
$Apache::lonhomework::results{"resource.$version.0.solved"}; |
} |
} |
&minimize_storage(); |
&minimize_storage(); |
my $canstore; |
my ($canstore,$domain,$name,$symb,$courseid); |
|
($symb,$courseid,$domain,$name) = &Apache::lonnet::whichuser(); |
|
|
if ($env{'form.gradingkey'}) { |
if ($env{'form.gradingkey'}) { |
my ($symb,$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 1334 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') { |
Line 1363 DONEBUTTON
|
Line 1405 DONEBUTTON
|
} |
} |
} else { |
} else { |
&check_queue_unlock($env{'form.queue'}); |
&check_queue_unlock($env{'form.queue'}); |
$result .= '<br /><div class="LC_error">'. |
$env{'form.terminated'} = $name.':'.$domain; |
&mt('Information extracted from the current gradingkey was for a different BT or user from those for which grading data are to be stored.').' '.&mt('No grading changes stored.').'</div><br />'; |
|
} |
} |
} |
} |
if (exists($Apache::lonhomework::results{'INTERNAL_store'})) { |
if (exists($Apache::lonhomework::results{'INTERNAL_store'})) { |