--- loncom/homework/response.pm 2008/09/04 20:31:55 1.197 +++ loncom/homework/response.pm 2008/09/09 13:56:48 1.203 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.197 2008/09/04 20:31:55 riegler Exp $ +# $Id: response.pm,v 1.203 2008/09/09 13:56:48 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); @@ -523,7 +520,7 @@ 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 $helplink=&Apache::loncommon::help_open_topic('Formula_Editor'); my $iconpath=$Apache::lonnet::perlvar{'lonIconsURL'}; return(< @@ -533,8 +530,7 @@ function edit_${id}_${field} (textarea) newwin = window.open("/adm/dragmath/applet/MaximaPopup.html","","width=565,height=400,resizable"); } - -$helplink +$button ENDFORMULABUTTON } @@ -576,6 +572,12 @@ sub end_mathresponse { } if ($target eq 'web') { &setup_prior_tries_hash(\&format_prior_response_math); + my $partid = $Apache::inputtags::part; + my $id = $Apache::inputtags::response[-1]; + if (($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') + && (&Apache::lonnet::EXT('resource.'.$partid.'_'.$id.'.turnoneditor') ne 'no')) { + $result.=&edit_mathresponse_button($id,"HWVAL_$id"); + } } pop(@Apache::lonxml::namespace);