--- loncom/homework/matchresponse.pm 2013/04/25 17:58:32 1.88 +++ loncom/homework/matchresponse.pm 2013/04/30 03:03:34 1.89 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Full matching style response # -# $Id: matchresponse.pm,v 1.88 2013/04/25 17:58:32 bisitz Exp $ +# $Id: matchresponse.pm,v 1.89 2013/04/30 03:03:34 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -652,9 +652,19 @@ sub displayfoils { $newvariation = 1; } } - unless ((($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurvey') || ($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurveycred') && (defined($env{'form.grade_symb'}))) || $newvariation) { - $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"}; + unless ($newvariation) { + if ((($env{'form.grade_username'} eq '') && ($env{'form.grade_domain'} eq '')) || + (($env{'form.grade_username'} eq $env{'user.name'}) && + ($env{'form.grade_domain'} eq $env{'user.domain'}))) { + $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"}; + } else { + unless (($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurvey') || + ($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurveycred')) { + $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"}; + } + } } + my %lastresponse=&Apache::lonnet::str2hash($lastresponse); my @alphabet=('A'..'Z'); my @used_letters=sort(keys(%letter_name_map));