--- loncom/homework/edit.pm 2001/05/15 20:48:43 1.7 +++ loncom/homework/edit.pm 2001/06/11 16:15:37 1.9 @@ -7,21 +7,19 @@ use strict; use Apache::lonnet; sub tag_start { - my ($target,$token) = @_; + my ($target,$token,$description) = @_; my $result=''; if ($target eq "edit") { my $tag=$token->[1]; # my $color = sprintf("#%06lx",(hex("ffffff")) >> scalar(split(/_/,$Apache::lonxml::curdepth))); my $color = sprintf("#%02lxffff",33* scalar(split(/_/,$Apache::lonxml::curdepth))); - $result.=" - + if (!$description) { $description="<$tag>"; } + $result.="
<$tag>Delete: -
+
$descriptionDelete:". + &deletelist($target,$token) + ." ". - &insertlist($token,$target). + &insertlist($target,$token). "
\n"; } @@ -29,15 +27,30 @@ sub tag_start { } sub tag_end { - my ($target,$token) = @_; + my ($target,$token,$description) = @_; my $result=''; if ($target eq 'edit') { my $tag=$token->[1]; - $result.="
</$tag>
\n"; + if (!defined($description)) { + $result.="</$tag>"; + } else { + if ($description ne '') { $result.="$description"; } + } + $result.="\n"; } return $result; } +sub deletelist { + my ($target,$token) = @_; + my $result = ""; + return $result; +} + sub get_insert_list { my ($token) = @_; my $result=''; @@ -63,7 +76,7 @@ sub get_insert_list { } sub insertlist { - my ($token,$target) = @_; + my ($target,$token) = @_; my $result; if ($target eq 'edit') { my $optionlist= &get_insert_list($token); @@ -116,9 +129,9 @@ sub editfield { if ($maxlength < $minwidth) { $maxlength = $minwidth; } if ( $count < $minheight) { $count = $minheight; } if ($description) { - $description="
".$description; + $description="
".$description."
"; } - return "$description
\n   \n"; + return "$description\n   \n"; # return "
\n<$tag>
\n   
\n</$tag>
\n"; }