--- loncom/homework/bridgetask.pm	2006/02/20 22:57:41	1.112
+++ loncom/homework/bridgetask.pm	2006/02/21 18:36:30	1.113
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.112 2006/02/20 22:57:41 albertel Exp $
+# $Id: bridgetask.pm,v 1.113 2006/02/21 18:36:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1792,6 +1792,7 @@ sub get_instance {
 		    '<li><a href="#next_'.$link.'">Next</a></li>'."\n".
 		    '</ul>'."\n".
                     '</div>'."\n";
+		$result.=&grading_history($version,$dim,$instance,$id);
 		$last_link=$link;
 	    }
 	} elsif ($target eq 'grade' && $env{'form.webgrade'}) {
@@ -1840,6 +1841,38 @@ sub get_instance {
     }
 }
 
+sub grading_history {
+    my ($version,$dim,$instance,$criteria) = @_;
+    if (!&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) {
+	return '';
+    }
+    my ($result,$grader);
+    my $scope="resource.$version.0.$dim.$instance.$criteria";
+    foreach my $t (1..$Apache::lonhomework::history{'version'}) {
+	if (exists($Apache::lonhomework::history{$t.':resource.0.regrader'})) {
+	    my ($gname,$gdom) = 
+		split('@',$Apache::lonhomework::history{$t.':resource.0.regrader'});
+	    my $fullname = &Apache::loncommon::plainname($gname,$gdom);
+	    $grader = &Apache::loncommon::aboutmewrapper($fullname,
+							 $gname,$gdom);
+	}
+	my $entry;
+	if (exists($Apache::lonhomework::history{"$t:$scope.status"})) {
+	    $entry.="<tt>".$Apache::lonhomework::history{"$t:$scope.status"}.'</tt>';
+	}
+	if (exists($Apache::lonhomework::history{"$t:$scope.comment"})) {
+	    $entry.=' comment: "'.$Apache::lonhomework::history{"$t:$scope.comment"}.'"';
+	}
+	if ($entry) {
+	    $result.= "<li>$grader : $entry </li>";
+	}
+    }
+    if ($result) {
+	return '<ul class="pastgrading">'.$result.'</ul>';
+    }
+    return '';
+}
+
 sub start_IntroParagraph {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result;