--- loncom/homework/response.pm 2008/05/30 16:19:49 1.191 +++ loncom/homework/response.pm 2008/09/08 16:08:36 1.202 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.191 2008/05/30 16:19:49 www Exp $ +# $Id: response.pm,v 1.202 2008/09/08 16:08:36 riegler Exp $ # # Copyright Michigan State University Board of Trustees # @@ -486,9 +486,6 @@ sub start_mathresponse { $safeeval); $Apache::inputtags::answertxt{$id}=[$answer]; } - if ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') { - $result.=&edit_mathresponse_button($id,"HWVAL_$id"); - } } elsif ($target eq 'edit') { $result.=&Apache::edit::tag_start($target,$token); @@ -499,12 +496,16 @@ sub start_mathresponse { ['maxima'], $token); $result.=&Apache::edit::text_arg('Argument Array:', - 'args',$token); + 'args',$token). + &Apache::loncommon::help_open_topic('Maxima_Argument_Array'); + $result.=&Apache::edit::text_arg('Libraries:', + 'libraries',$token). + &Apache::loncommon::help_open_topic('Maxima_Libraries'); $result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); } elsif ($target eq 'modified') { my $constructtag; $constructtag=&Apache::edit::get_new_args($token,$parstack, - $safeeval,'answerdisplay','cas','args'); + $safeeval,'answerdisplay','cas','args','libraries'); if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); } @@ -519,6 +520,8 @@ sub start_mathresponse { sub edit_mathresponse_button { my ($id,$field)=@_; my $button=&mt('Edit Answer'); +# my $helplink=&Apache::loncommon::help_open_topic('Formula_Editor'); + my $iconpath=$Apache::lonnet::perlvar{'lonIconsURL'}; return(< function edit_${id}_${field} (textarea) { @@ -527,7 +530,7 @@ function edit_${id}_${field} (textarea) newwin = window.open("/adm/dragmath/applet/MaximaPopup.html","","width=565,height=400,resizable"); } - +$button ENDFORMULABUTTON } @@ -551,7 +554,8 @@ sub end_mathresponse { my $cas = &Apache::lonxml::get_param('cas',$parstack,$safeeval); if ($cas eq 'maxima') { my $args = [&Apache::lonxml::get_param_var('args',$parstack,$safeeval)]; - $award=&Apache::lonmaxima::maxima_run($Apache::response::custom_answer[-1],$response,$args); + $award=&Apache::lonmaxima::maxima_run($Apache::response::custom_answer[-1],$response,$args, + &Apache::lonxml::get_param('libraries',$parstack,$safeeval)); } if (!&Apache::inputtags::valid_award($award)) { $error = $award; @@ -568,6 +572,9 @@ sub end_mathresponse { } if ($target eq 'web') { &setup_prior_tries_hash(\&format_prior_response_math); + if (($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') && (&Apache::lonxml::get_param('turnoneditor',$parstack,$safeeval) ne 'no')) { + $result.=&edit_mathresponse_button($id,"HWVAL_$id"); + } } pop(@Apache::lonxml::namespace);