--- loncom/homework/response.pm 2008/04/05 15:50:22 1.190 +++ loncom/homework/response.pm 2008/05/30 16:19:49 1.191 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.190 2008/04/05 15:50:22 www Exp $ +# $Id: response.pm,v 1.191 2008/05/30 16:19:49 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -486,6 +486,10 @@ 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); $result.=&Apache::edit::text_arg('String to display for answer:', @@ -512,6 +516,21 @@ sub start_mathresponse { return $result; } +sub edit_mathresponse_button { + my ($id,$field)=@_; + my $button=&mt('Edit Answer'); + return(< +function edit_${id}_${field} (textarea) { + thenumber = textarea; + thedata = document.forms['lonhomework'].elements[textarea].value; + newwin = window.open("/adm/dragmath/applet/MaximaPopup.html","","width=565,height=400,resizable"); +} + + +ENDFORMULABUTTON +} + sub end_mathresponse { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $result;