--- loncom/homework/edit.pm 2001/05/31 22:37:56 1.8
+++ loncom/homework/edit.pm 2001/06/11 16:15:37 1.9
@@ -7,13 +7,14 @@ 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.="
<$tag> |
+ if (!$description) { $description="<$tag>"; }
+ $result.="$description |
Delete:".
&deletelist($target,$token)
." |
@@ -26,11 +27,16 @@ 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;
}
@@ -123,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";
}