--- loncom/homework/edit.pm 2001/05/13 20:01:34 1.5
+++ loncom/homework/edit.pm 2001/05/13 21:40:32 1.6
@@ -36,6 +36,19 @@ sub tag_end {
return $result;
}
+sub get_insert_list2 {
+ my ($token) = @_;
+ my $result='';
+ if ($Apache::lonxml::insertlist{"$token->[1].which"}) {
+ my @tagnums= @{ $Apache::lonxml::insertlist{"$token->[1].which"} };
+ foreach my $tagnum (@tagnums) {
+ $result.='\n";
+ }
+ if ($result) { $result=''.$result; }
+ }
+ return $result;
+}
+
sub get_insert_list {
my ($token) = @_;
my $result='';
@@ -62,6 +75,23 @@ $optionlist
}
}
return $result;
+}
+
+sub handle_insert2 {
+ if (!$ENV{"form.insert_$Apache::lonxml::curdepth"}) { return ''; }
+ my $result;
+ my $tagnum = $ENV{"form.insert_$Apache::lonxml::curdepth"};
+ my $func=$Apache::lonxml::insertlist{"$tagnum.function"};
+ if ($func eq 'default') {
+ my $newtag=$Apache::lonxml::insertlist{"$tagnum.tag"};
+ $result.="\n<$newtag>\n$newtag>";
+ } else {
+ {
+ no strict 'refs';
+ $result.=&$func;
+ }
+ }
+ return $result;
}
sub handle_insert {