--- loncom/homework/rankresponse.pm 2008/12/12 09:19:34 1.61 +++ loncom/homework/rankresponse.pm 2010/02/28 23:43:21 1.62 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # rank style response # -# $Id: rankresponse.pm,v 1.61 2008/12/12 09:19:34 bisitz Exp $ +# $Id: rankresponse.pm,v 1.62 2010/02/28 23:43:21 raeburn Exp $ # Copyright Michigan State University Board of Trustees # # This file is part of the LearningOnline Network with CAPA (LON-CAPA). @@ -265,9 +265,18 @@ sub grade_response { $ad='MISSING_ANSWER'; } } - if ($Apache::lonhomework::type eq 'survey' && - ($ad eq 'INCORRECT' || $ad eq 'EXACT_ANS') ) { - $ad='SUBMITTED'; + if (($ad eq 'INCORRECT' || $ad eq 'EXACT_ANS')) { + if ($Apache::lonhomework::type eq 'survey') { + $ad='SUBMITTED'; + } elsif ($Apache::lonhomework::type eq 'surveycred') { + $ad='SUBMITTED_CREDIT'; + } elsif ($Apache::lonhomework::type eq 'anonsurvey') { + $ad='ANONYMOUS'; + } elsif ($Apache::lonhomework::type eq 'anonsurveycred') { + $ad='ANONYMOUS_CREDIT'; + } else { + $Apache::lonhomework::results{"resource.$part.$id.submissiongrading"}=$gradestr; + } } else { $Apache::lonhomework::results{"resource.$part.$id.submissiongrading"}=$gradestr; } @@ -317,7 +326,10 @@ sub displayfoils { my $temp=1; my $id=$Apache::inputtags::response[-1]; my $part=$Apache::inputtags::part; - my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"}; + my $lastresponse; + unless ((($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurvey') || ($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurveycred')) && (defined($env{'form.grade_symb'}))) { + $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"}; + } my %lastresponse=&Apache::lonnet::str2hash($lastresponse); my @alp = splice @alphabet, 0, $#whichopt + 1; my $internal_counter=$Apache::lonxml::counter;