--- loncom/homework/edit.pm 2006/04/18 22:36:23 1.101 +++ loncom/homework/edit.pm 2006/05/30 12:45:36 1.102 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # edit mode helpers # -# $Id: edit.pm,v 1.101 2006/04/18 22:36:23 albertel Exp $ +# $Id: edit.pm,v 1.102 2006/05/30 12:45:36 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,6 +32,9 @@ use strict; use Apache::lonnet; use HTML::Entities(); use Apache::lonlocal; +use lib '/home/httpd/lib/perl/'; +use LONCAPA; + # Global Vars # default list of colors to use in editing @@ -799,13 +802,13 @@ sub entercoords { unless ($Apache::edit::bgimgsrc) { return ''; } if ($idx) { $idx.='_'; } if ($idy) { $idy.='_'; } - my $bgfile=&Apache::lonnet::escape(&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$Apache::edit::bgimgsrc)); + my $bgfile=&escape(&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$Apache::edit::bgimgsrc)); my $form = 'lonhomework'; my $element; if (! defined($mode) || $mode eq 'attribute') { - $element = &Apache::lonnet::escape("$Apache::lonxml::curdepth"); + $element = &escape("$Apache::lonxml::curdepth"); } elsif ($mode eq 'textnode') { # for data between ... - $element = &Apache::lonnet::escape('homework_edit_'. + $element = &escape('homework_edit_'. $Apache::lonxml::curdepth); } my $id=$Apache::lonxml::curdepth; @@ -834,13 +837,13 @@ sub entercoords { sub entercoord { my ($idx,$mode,$width,$height,$type) = @_; unless ($Apache::edit::bgimgsrc) { return ''; } - my $bgfile=&Apache::lonnet::escape(&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$Apache::edit::bgimgsrc)); + my $bgfile=&escape(&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$Apache::edit::bgimgsrc)); my $form = 'lonhomework'; my $element; if (! defined($mode) || $mode eq 'attribute') { - $element = &Apache::lonnet::escape("$idx\_$Apache::lonxml::curdepth"); + $element = &escape("$idx\_$Apache::lonxml::curdepth"); } elsif ($mode eq 'textnode') { # for data between ... - $element = &Apache::lonnet::escape('homework_edit_'. + $element = &escape('homework_edit_'. $Apache::lonxml::curdepth); } my $id=$Apache::lonxml::curdepth; @@ -874,14 +877,14 @@ sub browse { my $form = 'lonhomework'; my $element; if (! defined($mode) || $mode eq 'attribute') { - $element = &Apache::lonnet::escape("$id\_$Apache::lonxml::curdepth"); + $element = &escape("$id\_$Apache::lonxml::curdepth"); } elsif ($mode eq 'textnode') { # for data between ... - $element = &Apache::lonnet::escape('homework_edit_'. + $element = &escape('homework_edit_'. $Apache::lonxml::curdepth); } my $titleelement; if ($titleid) { - $titleelement=",'','','".&Apache::lonnet::escape("$titleid\_$Apache::lonxml::curdepth")."'"; + $titleelement=",'','','".&escape("$titleid\_$Apache::lonxml::curdepth")."'"; } my $result = <<"ENDBUTTON"; Select @@ -896,14 +899,14 @@ sub search { my $form = 'lonhomework'; my $element; if (! defined($mode) || $mode eq 'attribute') { - $element = &Apache::lonnet::escape("$id\_$Apache::lonxml::curdepth"); + $element = &escape("$id\_$Apache::lonxml::curdepth"); } elsif ($mode eq 'textnode') { # for data between ... - $element = &Apache::lonnet::escape('homework_edit_'. + $element = &escape('homework_edit_'. $Apache::lonxml::curdepth); } my $titleelement; if ($titleid) { - $titleelement=",'".&Apache::lonnet::escape("$titleid\_$Apache::lonxml::curdepth")."'"; + $titleelement=",'".&escape("$titleid\_$Apache::lonxml::curdepth")."'"; } my $result = <<"ENDBUTTON"; Search