--- loncom/homework/radiobuttonresponse.pm 2013/04/25 17:58:32 1.156 +++ loncom/homework/radiobuttonresponse.pm 2015/04/07 15:26:24 1.157.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # mutliple choice style responses # -# $Id: radiobuttonresponse.pm,v 1.156 2013/04/25 17:58:32 bisitz Exp $ +# $Id: radiobuttonresponse.pm,v 1.157.2.1 2015/04/07 15:26:24 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -376,24 +376,19 @@ sub get_last_survey_response { } } $showanswer = &Apache::response::show_answer(); - unless ( - ( - ( - $Apache::lonhomework::history{"resource.$part.type"} eq - 'anonsurvey' - ) - || ( $Apache::lonhomework::history{"resource.$part.type"} eq - 'anonsurveycred' ) - ) - && ( defined( $env{'form.grade_symb'} ) ) - || ( $newvariation && !$showanswer ) - ) - { - $lastresponse = - $Apache::lonhomework::history{"resource.$part.$id.submission"}; + unless ($newvariation && !$showanswer) { + 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); - return \%lastresponse; @@ -829,10 +824,10 @@ sub html_radiobutton { my $result='