--- loncom/homework/rankresponse.pm 2008/10/24 16:22:54 1.59 +++ 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.59 2008/10/24 16:22:54 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). @@ -52,10 +52,10 @@ sub start_rankresponse { } elsif ($target eq 'edit' ) { $result.=&Apache::edit::start_table($token) .''.&Apache::lonxml::description($token).'' - .'span class="LC_nobreak">'.&mt('Delete?').' ' + .''.&mt('Delete?').' ' .&Apache::edit::deletelist($target,$token) .'' - .' '.&Apache::edit::end_row() + .' '.&Apache::edit::end_row() .&Apache::edit::start_spanning_row(); $result.= @@ -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;