--- loncom/homework/edit.pm 2002/03/22 14:45:11 1.31 +++ loncom/homework/edit.pm 2002/04/26 13:30:08 1.34 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # edit mode helpers # -# $Id: edit.pm,v 1.31 2002/03/22 14:45:11 matthew Exp $ +# $Id: edit.pm,v 1.34 2002/04/26 13:30:08 harris41 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,7 +31,8 @@ package Apache::edit; use strict; -use Apache::lonnet; +use Apache::lonnet(); +use HTML::Entities(); # Global Vars # default list of colors to use in editing @@ -164,9 +165,12 @@ sub get_insert_list { } } if (@tagnums) { + my %options; foreach my $tagnum (@tagnums) { - $result.='\n"; + my $descrip=$Apache::lonxml::insertlist{"$tagnum.description"}; + $options{$descrip} ="\n"; } + foreach my $option (sort(keys(%options))) { $result.=$options{$option}; } if ($result) { $result=''.$result; } } return $result; @@ -301,8 +305,9 @@ sub textarea_sizes { return ($rows,$cols); } -sub textfield { +sub editline { my ($tag,$data,$description,$size)=@_; + $data=&HTML::Entities::encode($data); if ($description) { $description="
".$description."
"; } my $result = <<"END"; $description @@ -320,7 +325,9 @@ sub editfield { if ($cols < $minwidth ) { $cols = $minwidth; } if ($rows < $minheight) { $rows = $minheight; } if ($description) { $description="
".$description."
"; } - return "$description\n   \n"; + return $description."\n".'   '."\n"; } sub modifiedfield { @@ -563,8 +570,8 @@ search($elementname) : provide a link wh searcher (lonsearchcat) and, once a file is selected, place the result in the form element $elementname. -= item * -textfield(tag,data,description,size): Provide a for +=item * +editline(tag,data,description,size): Provide a for single-line text entry. This is to be used for text enclosed by tags, not arguements/parameters associated with a tag.