--- loncom/homework/caparesponse/caparesponse.pm 2008/05/30 16:04:33 1.225 +++ loncom/homework/caparesponse/caparesponse.pm 2008/09/12 10:09:18 1.227.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.225 2008/05/30 16:04:33 www Exp $ +# $Id: caparesponse.pm,v 1.227.2.1 2008/09/12 10:09:18 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -311,8 +311,7 @@ sub start_numericalresponse { if ($unit =~ /\S/) { $result.=" (in $unit) "; } } if (($token->[1] eq 'formularesponse') && - ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') && - (!&Apache::lonxml::get_param_var('samples',$parstack,$safeeval))) { + ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER')) { $result.=&edit_formula_button($id,"HWVAL_$id"); } if ( &Apache::response::show_answer() ) { @@ -326,6 +325,7 @@ sub start_numericalresponse { sub edit_formula_button { my ($id,$field)=@_; my $button=&mt('Edit Answer'); + my $helplink=&Apache::loncommon::help_open_topic('Formula_Editor'); return(< function edit_${id}_${field} (textarea) { @@ -334,7 +334,7 @@ function edit_${id}_${field} (textarea) newwin = window.open("/adm/dragmath/applet/MaximaPopup.html","","width=565,height=400,resizable"); } - +$helplink ENDFORMULABUTTON } @@ -464,7 +464,7 @@ sub check_submission { use Time::HiRes; my $t0 = [Time::HiRes::gettimeofday()]; my ($result,@msgs) = - &Apache::run::run("&caparesponse_check_list()",$safeeval); + &Apache::run::run("&caparesponse_check_list($tag)",$safeeval); &Apache::lonxml::debug("checking $name $result with $response took ".&Time::HiRes::tv_interval($t0)); &Apache::lonxml::debug('msgs are '.join(':',@msgs)); my ($awards)=split(/:/,$result); @@ -1177,7 +1177,7 @@ sub end_stringresponse { foreach my $name (keys(%answer)) { &Apache::lonxml::debug(" doing $name with ".join(':',@{ $answer{$name}{'answers'} })); ${$safeeval->varglob('LONCAPA::CAPAresponse_answer')}=dclone($answer{$name}); - my ($result, @msgs)=&Apache::run::run("&caparesponse_check_list()",$safeeval); + my ($result, @msgs)=&Apache::run::run("&caparesponse_check_list($$tagstack[-1])",$safeeval); &Apache::lonxml::debug('msgs are'.join(':',@msgs)); my ($awards)=split(/:/,$result); my (@awards) = split(/,/,$awards);