--- loncom/homework/rankresponse.pm 2004/09/03 18:35:52 1.37 +++ loncom/homework/rankresponse.pm 2004/10/07 20:28:30 1.39 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # rank style response # -# $Id: rankresponse.pm,v 1.37 2004/09/03 18:35:52 albertel Exp $ +# $Id: rankresponse.pm,v 1.39 2004/10/07 20:28:30 albertel Exp $ # Copyright Michigan State University Board of Trustees # # This file is part of the LearningOnline Network with CAPA (LON-CAPA). @@ -198,8 +198,7 @@ sub grade_response { my ($temp,$right,$wrong,$ignored)=(1,0,0,0); my @correctorder=&get_correct_order($tol,@whichfoils); foreach my $name (@whichfoils) { - # get response returns a=>0, when we want a=>1 - my $response = &Apache::response::getresponse($temp)+1; + my $response = &Apache::response::getresponse($temp,'A is 1'); my $value=shift(@correctorder); if ( $response =~ /[^\s]/) { $responsehash{$name}=$response; @@ -377,6 +376,9 @@ sub start_foil { my $result=''; if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') { &Apache::lonxml::startredirection; + if ($target eq 'analyze') { + &Apache::response::check_if_computed($token,$parstack,$safeeval,'value'); + } } elsif ($target eq 'edit') { $result=&Apache::edit::tag_start($target,$token,"Foil"); my $level='-2';