--- loncom/homework/bridgetask.pm	2005/10/01 04:06:29	1.62
+++ loncom/homework/bridgetask.pm	2005/10/01 04:52:21	1.64
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.62 2005/10/01 04:06:29 albertel Exp $
+# $Id: bridgetask.pm,v 1.64 2005/10/01 04:52:21 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -294,6 +294,7 @@ sub show_task {
 		       ( $status eq 'INVALID_ACCESS') )) {
 	return 0;
     }
+    if ($env{'form.donescreen'}) { return 0; }
     return 1;
 }
 
@@ -392,6 +393,18 @@ sub start_Task {
 			'</h1>'.&proctor_validation_screen($slot);
 		} elsif ($status eq 'WAITING_FOR_GRADE') {
 		    $msg.='<h1>'.&mt('Your submission is in the grading queue.').'</h1>';
+		} elsif ($env{'form.donescreen'}) {
+		    my $title=&Apache::lonnet::gettitle();
+		    my $files=$Apache::lonhomework::history{'resource.'.$version.'.0.bridgetask.portfiles'};
+		    $result.= $head_tag_start.'</head>'.$body_tag_start;
+		    $result.=<<DONESCREEN;
+<h2>$title</h2>
+<p> Files submitted: $files </p>
+<p> You are now done with the Bridge Task </p>
+<hr />
+<p> <a href="/adm/logout">Logout</a> </p>
+<p> <a href="/adm/roles">Change to a different course</a> </p>
+DONESCREEN
 		} elsif ($status ne 'NOT_YET_VIEWED') {
 		    $msg.='<h1>'.&mt('Not open to be viewed').'</h1>';
 		}
@@ -613,7 +626,8 @@ sub end_Task {
 		if (&show_task($status,$previous)) {
 		    $result.=&Apache::lonxml::endredirection();
 		}
-		if ($status eq 'CAN_ANSWER' && !$previous) {
+		if ($status eq 'CAN_ANSWER' && !$previous && 
+		    !$env{'form.donescreen'}) {
 		    $result.="\n".'<table border="1">'.
 			&Apache::inputtags::file_selector("$version.0",
 							  "bridgetask","*",
@@ -623,6 +637,13 @@ sub end_Task {
 <p>'.&mt('Indicate the files from your portfolio to be evaluated in grading this task.').'</p>').
 							  "</table>";
 		    $result.=&Apache::inputtags::gradestatus('0');
+		    $result.='</form>';
+		    $result.=<<DONEBUTTON;
+<form method="POST">
+   <input type="hidden" name="donescreen" value="1" />
+   <input type="submit" value="Done" />
+</form>
+DONEBUTTON
 		}
 		if (&show_task($status,$previous) &&
 		    $Apache::lonhomework::history{"resource.$version.status"} =~ /^(pass|fail)$/) {
@@ -688,6 +709,8 @@ sub end_Task {
 		    $award;
 		$Apache::lonhomework::results{"resource.0.submission"}=
 		    $Apache::lonhomework::results{"resource.$version.0.submission"}='';
+	    } else {
+		delete($Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"});
 	    }
 	    &Apache::lonhomework::showhash(%Apache::lonhomework::results);
 	    &Apache::structuretags::finalize_storage();
@@ -928,6 +951,10 @@ sub show_queue {
     &Apache::grades::init_perm();
     my ($classlist,$section,$fullname)=&Apache::grades::getclasslist(\@chosen_sections,);
     &Apache::grades::reset_perm();
+    if (!(grep(/^all$/,@chosen_sections))) {
+	$result.='<p> Showing only sections <tt>'.join(', ',@chosen_sections).
+	    '</tt>.</p> '."\n";
+    }
 
     my $regexp="^$symb\0";
     my %queue=&Apache::lonnet::dump($queue,$cdom,$cnum,$regexp);
@@ -1187,13 +1214,19 @@ sub get_from_queue {
 
 sub select_user {
     my ($symb,$cid)=&Apache::lonxml::whichuser();
-    my $result.='<table border="1">';
 
     my @chosen_sections=
 	&Apache::loncommon::get_env_multiple('form.chosensections');
     &Apache::grades::init_perm();
     my ($classlist,$section,$fullname)=&Apache::grades::getclasslist(\@chosen_sections,);
     &Apache::grades::reset_perm();
+    
+    my $result;
+    if (!(grep(/^all$/,@chosen_sections))) {
+	$result.='<p> Showing only sections <tt>'.join(', ',@chosen_sections).
+	    '</tt>.</p> '."\n";
+    }
+    $result.='<table border="1">';
 
     foreach my $student (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) {
 	my ($uname,$udom) = split(/:/,$student);