--- loncom/homework/caparesponse/caparesponse.pm 2002/11/07 19:45:16 1.70 +++ loncom/homework/caparesponse/caparesponse.pm 2002/11/13 23:37:56 1.72 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.70 2002/11/07 19:45:16 albertel Exp $ +# $Id: caparesponse.pm,v 1.72 2002/11/13 23:37:56 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -128,6 +128,9 @@ sub end_numericalresponse { my $id = $Apache::inputtags::response['-1']; my $response = $ENV{'form.HWVAL'.$id}; if ( $response =~ /[^\s]/) { + if (!$Apache::lonxml::default_homework_loaded) { + &Apache::lonxml::default_homework_load($safeeval); + } my %previous = &Apache::response::check_for_previous($response,$partid,$id); $Apache::lonhomework::results{"resource.$partid.$id.submission"}=$response; &Apache::lonxml::debug("submitted a $response
\n"); @@ -223,6 +226,7 @@ sub end_numericalresponse { my @alphabet = ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P', 'Q','R','S','T','U','V','W','X','Y','Z'); if ($target eq 'web') { + my $id=$Apache::inputtags::response[-1]; $result.= ''; for ($ind=0;$ind<$number_of_bubbles;$ind++) { my $ans; @@ -241,7 +245,7 @@ sub end_numericalresponse { } $ans = sprintf('%.'.$format,$bubbles_values[$ind]); } - $result.=''; + $result.=''; } $result.='
'.$alphabet[$ind].': '.$ans.''.$alphabet[$ind].': '.$ans.'
'; } elsif ($target eq 'tex') {