--- loncom/homework/hint.pm 2008/11/20 15:19:15 1.74 +++ loncom/homework/hint.pm 2009/04/17 01:00:15 1.75 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # implements the tags that control the hints # -# $Id: hint.pm,v 1.74 2008/11/20 15:19:15 jms Exp $ +# $Id: hint.pm,v 1.75 2009/04/17 01:00:15 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,6 +35,7 @@ use Apache::lonnet(); use capa; use Apache::caparesponse(); use Apache::lonmaxima(); +use Apache::lonr(); use Apache::response(); use Apache::lonlocal; use Storable qw(dclone); @@ -244,7 +245,7 @@ sub start_mathhint { $result.=&Apache::edit::text_arg('Name:','name',$token); $result.=&Apache::edit::select_arg('Algebra System:', 'cas', - ['maxima'], + ['maxima','R'], $token); $result.=&Apache::edit::text_arg('Argument Array:', 'args',$token); @@ -282,6 +283,10 @@ sub end_mathhint { my $args = [&Apache::lonxml::get_param_var('args',$parstack,$safeeval)]; $award=&Apache::lonmaxima::maxima_run($Apache::response::custom_answer[-1],$response,$args); } + if ($cas eq 'R') { + my $args = [&Apache::lonxml::get_param_var('args',$parstack,$safeeval)]; + $award=&Apache::lonr::r_run($Apache::response::custom_answer[-1],$response,$args); + } if ($award eq 'EXACT_ANS' || $award eq 'APPROX_ANS') { push (@Apache::hint::which,$name); } @@ -706,4 +711,4 @@ described at http://www.lon-capa.org. =back -=cut \ No newline at end of file +=cut