--- loncom/homework/response.pm 2006/01/21 08:17:51 1.135 +++ loncom/homework/response.pm 2006/06/19 16:15:53 1.139 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.135 2006/01/21 08:17:51 albertel Exp $ +# $Id: response.pm,v 1.139 2006/06/19 16:15:53 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,13 +32,12 @@ use Apache::lonlocal; use Apache::lonnet; BEGIN { - &Apache::lonxml::register('Apache::response',('responseparam','parameter','dataresponse','customresponse')); + &Apache::lonxml::register('Apache::response',('responseparam','parameter','dataresponse','customresponse','mathresponse')); } sub start_response { my ($parstack,$safeeval)=@_; - my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); - if ($id eq '') { $id = $Apache::lonxml::curdepth; } + my $id = &Apache::lonxml::get_id($parstack,$safeeval); if ($#Apache::inputtags::import > -1) { &Apache::lonxml::debug("Turning :$id: into"); $id = join('_',@Apache::inputtags::import).'_'.$id; @@ -69,8 +68,7 @@ sub end_response { sub start_hintresponse { my ($parstack,$safeeval)=@_; - my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); - if ($id eq '') { $id = $Apache::lonxml::curdepth; } + my $id = &Apache::lonxml::get_id($parstack,$safeeval); push (@Apache::inputtags::hint,$id); push (@Apache::inputtags::hintlist,$id); push (@Apache::inputtags::paramstack,[%Apache::inputtags::params]); @@ -436,6 +434,23 @@ sub end_customresponse { return $result; } +sub start_mathresponse { + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; + my $result; + if ($target eq 'meta') { + &Apache::response::start_response($parstack,$safeeval); + $result=&Apache::response::meta_package_write('mathresponse'); + &Apache::response::end_response(); + } else { +# $result.=&start_numericalresponse(@_); + } + return $result; +} + +sub end_mathresponse { +# return end_numericalresponse(@_); +} + sub start_answer { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $result; @@ -611,7 +626,7 @@ sub answer_header { } else { $result = ''; if ($Apache::lonhomework::type eq 'exam') { - $result .= ''; + $result .= ''; } else { $result .= ''; }
'.$Apache::lonxml::counter. ')'.($Apache::lonxml::counter+$increment). ')Answer for Part:'.$Apache::inputtags::part.'