--- loncom/homework/bridgetask.pm	2005/05/20 18:07:29	1.27
+++ loncom/homework/bridgetask.pm	2005/05/20 18:53:53	1.28
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.27 2005/05/20 18:07:29 albertel Exp $
+# $Id: bridgetask.pm,v 1.28 2005/05/20 18:53:53 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -76,6 +76,11 @@ sub proctor_check_auth {
 		    $user.'@'.$domain;
 		$Apache::lonhomework::results{"resource.$version.checkedin.slot"}=
 		    $slot_name;
+		foreach my $key (keys(%Apache::lonhomework::history)) {
+		    if ($key=~/^resource\.0\./) {
+			$Apache::lonhomework::results{$key}='';
+		    }
+		}
 		return 1;
 	    }
 	}
@@ -271,7 +276,8 @@ sub end_Task {
 	    if ($target eq 'web') {
 		if ($status eq 'CAN_ANSWER') {
 		    $result.="\n".'<table border="1">'.
-			&Apache::inputtags::file_selector('0',"bridgetask","*",
+			&Apache::inputtags::file_selector("$version.0",
+							  "bridgetask","*",
 							  'portfolioonly').
 							  "</table>";
 		    $result.=&Apache::inputtags::gradestatus('0');
@@ -283,14 +289,18 @@ sub end_Task {
 	}
 	if ($target eq 'grade' && !$env{'form.webgrade'}) {
 	    my $award='SUBMITTED';
-	    &Apache::essayresponse::file_submission('0','bridgetask',
+	    &Apache::essayresponse::file_submission("$version.0",'bridgetask',
 						    'portfiles',\$award);
 	    if ($award eq 'SUBMITTED' &&
-		$Apache::lonhomework::results{"resource.$version.bridgetask.portfiles"}) {
-		$Apache::lonhomework::results{"resource.$version.tries"}=
-		    1+$Apache::lonhomework::history{"resource.$version.tries"};
+		$Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"}) {
+		$Apache::lonhomework::results{"resource.0.tries"}=
+		    $Apache::lonhomework::results{"resource.$version.0.tries"}=
+		    1+$Apache::lonhomework::history{"resource.$version.0.tries"};
+
+		$Apache::lonhomework::results{"resource.0.award"}=
+		    $Apache::lonhomework::results{"resource.$version.0.award"}=
+		    $award;
 	    }
-	    $Apache::lonhomework::results{"resource.$version.award"}=$award;
 	    &Apache::lonhomework::showhash(%Apache::lonhomework::results);
 	    &Apache::structuretags::finalize_storage();
 	    if ($award eq 'SUBMITTED') {
@@ -348,7 +358,7 @@ sub end_Task {
 	    }
 	    $Apache::lonhomework::results{"resource.status"}=
 		$Apache::lonhomework::results{"resource.$version.status"};
-	    if (defined($Apache::lonhomework::results{"resource.$version.awarded"})) {
+	    if (defined($Apache::lonhomework::results{"resource.$version.0.awarded"})) {
 		$Apache::lonhomework::results{"resource.0.award"}=
 		    $Apache::lonhomework::results{"resource.$version.award"};
 		$Apache::lonhomework::results{"resource.0.awarded"}=