--- loncom/homework/bridgetask.pm 2009/03/27 00:20:39 1.246
+++ loncom/homework/bridgetask.pm 2010/10/12 16:07:43 1.255
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.246 2009/03/27 00:20:39 raeburn Exp $
+# $Id: bridgetask.pm,v 1.255 2010/10/12 16:07:43 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -315,7 +315,7 @@ sub add_request_another_attempt_button {
my ($slot_name,$slot)=&Apache::slotrequest::check_for_reservation($symb);
my $action='get_reservation';
if ($slot_name) {
- $text=&mt('Change reservation.');
+ $text=&mt('Change reservation');
$action='change_reservation';
my $description=&Apache::slotrequest::get_description($slot_name,
$slot);
@@ -545,23 +545,35 @@ sub done_screen {
my $title=&Apache::lonnet::gettitle($env{'request.uri'});
my @files=split(',',$Apache::lonhomework::history{'resource.'.$version.'.0.bridgetask.portfiles'});
my (undef,undef,$domain,$user)= &Apache::lonnet::whichuser();
- my $files = '
';
- my $msg;
- foreach my $file (@files) {
- my $url="/uploaded/$domain/$user/portfolio$file";
- if (! &Apache::lonnet::stat_file($url)) {
- $file = ''
- .&mt('[_1]Nonexistent file:[_2]'
- ,' '
- ,''.$file.'');
- $msg .= "
';
my $subject = &mt('Submission message for [_1]',$title);
my ($message_status,$comment_status);
my $setting = $env{'course.'.$env{'request.course.id'}.'.task_messages'};
@@ -581,15 +593,11 @@ sub done_screen {
$comment_status = '
'.&mt('Message sent to instructor: [_1]',
$comment_status).'
'.&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'
';
} elsif ($status eq 'NOT_IN_A_SLOT') {
$msg.='
'.&mt('You are not currently signed up to work at this time and/or place.').'
';
- $msg.=&add_request_another_attempt_button("Sign up for time to work.");
+ $msg.=&add_request_another_attempt_button("Sign up for time to work");
} elsif ($status eq 'NEEDS_CHECKIN') {
$msg.='
'.&mt('You need the Proctor to validate you.').
'
'.&proctor_validation_screen($slot);
@@ -714,7 +722,7 @@ sub start_Task {
}
$result.=$msg.' ';
} elsif ($target eq 'tex') {
- $result.='\begin{document}\noindent \vskip 1 mm \begin{minipage}{\textwidth}\vskip 0 mm';
+ $result.='\noindent \vskip 1 mm \begin{minipage}{\textwidth}\vskip 0 mm';
if ($status eq 'UNAVAILABLE') {
$result.=&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'\vskip 0 mm ';
} else {
@@ -784,6 +792,11 @@ sub start_Task {
$result.=''.&mt("Stopped grading.").''.$back;
} elsif ($status_code eq 'cancel') {
$result.=''.&mt("Cancelled grading.").''.$back;
+ } elsif ($status_code eq 'terminated') {
+ $result.= ''.&mt('Terminated grading').' '.
+ ''.
+ &mt('Grading for [_1] has not been saved because of a grading key mismatch.',
+ ''.$env{'form.terminated'}.'').' '.$back;
} elsif ($status_code eq 'never_versioned') {
$result.=''.
&mt("Requested user has never accessed the task.").
@@ -1004,6 +1017,8 @@ sub get_key_todo {
return (undef,'stop');
} elsif ($env{'form.cancel'}) {
return (undef,'cancel');
+ } elsif ($env{'form.terminated'}) {
+ return (undef, 'terminated');
} elsif ($env{'form.next'}) {
return (undef,'select_user');
}
@@ -1049,13 +1064,17 @@ sub get_key_todo {
if ($env{'form.queuemode'} ne 'selected') {
# 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')
&& !$env{'form.gradingaction'}) {
&Apache::lonxml::debug("Getting anew $queue");
return (&get_from_queue($queue));
} else {
- return (undef,'stop');
+ if ($env{'form.terminated'}) {
+ return (undef,'terminated');
+ } else {
+ return (undef,'stop');
+ }
}
}
return (undef,undef)
@@ -1085,14 +1104,21 @@ sub end_Task {
}
if ($status eq 'CAN_ANSWER' && !$previous &&
!$env{'form.donescreen'}) {
- $result.="\n".'
'.
+ my ($portheader,$porttext);
+ if ($Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"}) {
+ $portheader = &mt('Submit Additional Portfolio Files for Grading');
+ $porttext = &mt('Indicate which additional files from your portfolio are to be evaluated in grading this task.');
+ } else {
+ $portheader = &mt('Submit Portfolio Files for Grading');
+ $porttext = &mt('Indicate the files from your portfolio to be evaluated in grading this task.');
+ }
+ $result.="\n".'