version 1.74, 2003/12/18 19:59:24
|
version 1.76, 2004/01/12 19:53:54
|
Line 766 target="imagechoice">Click Coordinate Pa
|
Line 766 target="imagechoice">Click Coordinate Pa
|
ENDBUTTON |
ENDBUTTON |
return $result; |
return $result; |
} |
} |
|
|
|
# coordinate polygon (x1,y1)-(x2,y2)... |
|
sub entercoordpolygon { |
|
my ($id,$mode,$width,$height) = @_; |
|
unless ($Apache::edit::bgimgsrc) { return ''; } |
|
&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') { |
|
$element = &Apache::lonnet::escape("$id\_$Apache::lonxml::curdepth"); |
|
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag> |
|
$element = &Apache::lonnet::escape('homework_edit_'. |
|
$Apache::lonxml::curdepth); |
|
} |
|
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{"imagechoice.$id.formheight"}=$height.'_'. |
|
$Apache::edit::bgimgsrccurdepth; |
|
} |
|
if ($width) { |
|
$data{"imagechoice.$id.formwidth"}=$width.'_'. |
|
$Apache::edit::bgimgsrccurdepth; |
|
} |
|
&Apache::lonnet::appenv(%data); |
|
my $result='<a href="/adm/imagechoice?token='.$id.'" target="imagechoice">Create Polygon Data</a>'; |
|
return $result; |
|
} |
|
|
|
sub deletecoorddata { |
|
&Apache::lonnet::delenv("imagechoice\\."); |
|
} |
|
|
#----------------------------------------------------- browse |
#----------------------------------------------------- browse |
sub browse { |
sub browse { |
# insert a link to call up the filesystem browser (lonindexer) |
# insert a link to call up the filesystem browser (lonindexer) |