--- loncom/homework/response.pm 2004/06/29 22:32:14 1.100 +++ loncom/homework/response.pm 2004/09/09 18:34:29 1.103 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.100 2004/06/29 22:32:14 albertel Exp $ +# $Id: response.pm,v 1.103 2004/09/09 18:34:29 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -46,7 +46,8 @@ sub start_response { push (@Apache::inputtags::response,$id); push (@Apache::inputtags::responselist,$id); @Apache::inputtags::inputlist=(); - if ($Apache::inputtags::part eq '') { + if ($Apache::inputtags::part eq '' && + !$Apache::lonhomework::ignore_response_errors) { &Apache::lonxml::error(&HTML::Entities::encode(&mt("Found a <*response> outside of a in a ed problem"),'<>&"')); } if ($Apache::inputtags::response_with_no_part && @@ -499,12 +500,14 @@ sub answer_footer { } sub showallfoils { - my $return=0; - if (defined($ENV{'form.showallfoils'}) && - $ENV{'request.state'} eq 'construct') { - $return=1; + if (defined($ENV{'form.showallfoils'})) { + my ($symb)=&Apache::lonxml::whichuser(); + if ($ENV{'request.state'} eq 'construct' || + ($ENV{'user.adv'} && $symb eq '')) { + return 1; + } } - return $return; + return 0; } sub getresponse { @@ -530,6 +533,8 @@ sub getresponse { $response; if ($resulttype ne 'letter') { $response = $let_to_num{$response}; + } elsif ($resulttype ne 'A is 1') { + $response = $let_to_num{$response}+1; } } else { $response = $ENV{$formparm};