--- loncom/homework/bridgetask.pm 2009/03/09 01:58:47 1.244
+++ loncom/homework/bridgetask.pm 2010/08/23 03:24:01 1.252
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.244 2009/03/09 01:58:47 weissno Exp $
+# $Id: bridgetask.pm,v 1.252 2010/08/23 03:24:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -82,7 +82,10 @@ sub proctor_check_auth {
}
}
if ($authenticated) {
- &check_in($type,$user,$domain,$slot_name);
+ my $check = &check_in($type,$user,$domain,$slot_name);
+ if ($check =~ /^error:/) {
+ return 0;
+ }
return 1;
}
}
@@ -94,7 +97,10 @@ sub check_in {
my ($type,$user,$domain,$slot_name) = @_;
my $useslots = &Apache::lonnet::EXT("resource.0.useslots");
if ( $useslots eq 'map_map') {
- &check_in_sequence($user,$domain,$slot_name);
+ my $result = &check_in_sequence($user,$domain,$slot_name);
+ if ($result =~ /^error: /) {
+ return $result;
+ }
} else {
&create_new_version($type,$user,$domain,$slot_name);
&Apache::structuretags::finalize_storage();
@@ -105,6 +111,9 @@ sub check_in {
sub check_in_sequence {
my ($user,$domain,$slot_name) = @_;
my $navmap = Apache::lonnavmaps::navmap->new();
+ if (!defined($navmap)) {
+ return 'error: ';
+ }
my ($symb) = &Apache::lonnet::whichuser();
my ($map) = &Apache::lonnet::decode_symb($symb);
my @resources =
@@ -306,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);
@@ -493,13 +502,13 @@ sub webgrade_standard_info {
my $file_list = &file_list($Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"});
- my %lt=('done' => 'Next Item',
- 'stop' => 'Quit Grading',
- 'fail' => 'Fail Rest',
- 'cancel' => 'Cancel',
- 'submit' => 'Submit Grades',
- );
- %lt=&Apache::lonlocal::texthash(%lt);
+ my %lt = &Apache::lonlocal::texthash(
+ 'done' => 'Next Item',
+ 'stop' => 'Quit Grading',
+ 'fail' => 'Fail Rest',
+ 'cancel' => 'Cancel',
+ 'submit' => 'Submit Grades',
+ );
my $result=< '.&Apache::lonhtmlcommon::start_pick_box().
&Apache::inputtags::file_selector("$version.0",
"bridgetask","*",
'portfolioonly',
- '
- '.&mt('Indicate the files from your portfolio to be evaluated in grading this task.').''.&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);
@@ -701,7 +714,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 {
@@ -1072,14 +1085,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".'
";
+ ''.&mt('Submit Portfolio Files for Grading').'
-'.$portheader.'
'.
+ $porttext.'
').
+ &Apache::lonhtmlcommon::end_pick_box().'