--- loncom/homework/edit.pm 2004/01/09 23:22:18 1.75 +++ loncom/homework/edit.pm 2004/01/12 19:53:54 1.76 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # edit mode helpers # -# $Id: edit.pm,v 1.75 2004/01/09 23:22:18 albertel Exp $ +# $Id: edit.pm,v 1.76 2004/01/12 19:53:54 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -771,7 +771,9 @@ ENDBUTTON sub entercoordpolygon { my ($id,$mode,$width,$height) = @_; unless ($Apache::edit::bgimgsrc) { return ''; } - my $bgfile=&Apache::lonnet::escape($Apache::edit::bgimgsrc); + &Apache::lonnet::logthis($Apache::edit::bgimgsrc); + my $bgfile=&Apache::lonnet::escape(&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$Apache::edit::bgimgsrc)); + &Apache::lonnet::logthis($Apache::edit::bgfile); my $form = 'lonhomework'; my $element; if (! defined($mode) || $mode eq 'attribute') { @@ -780,21 +782,28 @@ sub entercoordpolygon { $element = &Apache::lonnet::escape('homework_edit_'. $Apache::lonxml::curdepth); } - my $id=&Apache::loncommon::get_cgi_id(); - my %data=("cgi.$id.mode" =>'polygon', - "cgi.$id.formname" =>$form, - "cgi.$id.file" =>$bgfile, - "cgi.$id.formcoord" =>$element); + my $id=$Apache::lonxml::curdepth; + my %data=("imagechoice.$id.mode" =>'polygon', + "imagechoice.$id.formname" =>$form, + "imagechoice.$id.file" =>$bgfile, + "imagechoice.$id.formcoord" =>$element); if ($height) { - $data{"cgi.$id.formheight"}=$height.'_'.$Apache::edit::bgimgsrccurdepth; + $data{"imagechoice.$id.formheight"}=$height.'_'. + $Apache::edit::bgimgsrccurdepth; } if ($width) { - $data{"cgi.$id.formwidth"}=$width.'_'.$Apache::edit::bgimgsrccurdepth; + $data{"imagechoice.$id.formwidth"}=$width.'_'. + $Apache::edit::bgimgsrccurdepth; } &Apache::lonnet::appenv(%data); my $result='Create Polygon Data'; return $result; } + +sub deletecoorddata { + &Apache::lonnet::delenv("imagechoice\\."); +} + #----------------------------------------------------- browse sub browse { # insert a link to call up the filesystem browser (lonindexer)