--- loncom/homework/response.pm 2009/03/16 18:20:22 1.213
+++ loncom/homework/response.pm 2009/05/04 16:45:44 1.215
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# various response type definitons response definition
#
-# $Id: response.pm,v 1.213 2009/03/16 18:20:22 bisitz Exp $
+# $Id: response.pm,v 1.215 2009/05/04 16:45:44 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -54,6 +54,7 @@ use strict;
use Apache::lonlocal;
use Apache::lonnet;
use Apache::lonmaxima();
+use Apache::lonr();
BEGIN {
&Apache::lonxml::register('Apache::response',('responseparam','parameter','dataresponse','customresponse','mathresponse'));
@@ -508,7 +509,7 @@ sub start_mathresponse {
'answerdisplay',$token);
$result.=&Apache::edit::select_arg('Algebra System:',
'cas',
- ['maxima'],
+ ['maxima','R'],
$token);
$result.=&Apache::edit::text_arg('Argument Array:',
'args',$token).
@@ -545,7 +546,7 @@ function edit_${id}_${field} (textarea)
newwin = window.open("/adm/dragmath/applet/MaximaPopup.html","","width=565,height=400,resizable");
}
-
+
ENDFORMULABUTTON
}
@@ -572,6 +573,12 @@ sub end_mathresponse {
$award=&Apache::lonmaxima::maxima_run($Apache::response::custom_answer[-1],$response,$args,
&Apache::lonxml::get_param('libraries',$parstack,$safeeval));
}
+ 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,
+ &Apache::lonxml::get_param('libraries',$parstack,$safeeval));
+ }
+
if (!&Apache::inputtags::valid_award($award)) {
$error = $award;
$award = 'ERROR';