--- loncom/homework/edit.pm	2005/08/30 15:36:07	1.94
+++ loncom/homework/edit.pm	2005/12/01 18:46:31	1.97
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # edit mode helpers
 #
-# $Id: edit.pm,v 1.94 2005/08/30 15:36:07 albertel Exp $
+# $Id: edit.pm,v 1.97 2005/12/01 18:46:31 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -92,10 +92,12 @@ sub start_table {
     foreach my $namespace (reverse @Apache::lonxml::namespace) {
 	my $testtag=$namespace.'::'.$tag;
 	$tagnum=$Apache::lonxml::insertlist{"$testtag.num"};
+	&Apache::lonxml::debug(" $testtag ");
 	if (defined($tagnum)) { last; }
     }
     if (!defined ($tagnum)) {$tagnum=$Apache::lonxml::insertlist{"$tag.num"};}
     my $color = $Apache::lonxml::insertlist{"$tagnum.color"};
+    &Apache::lonxml::debug(" $tagnum -- $color");
     if (!defined($color)) {
 	$color = $Apache::edit::colorlist[$Apache::edit::colordepth];
     }
@@ -161,7 +163,7 @@ sub handle_delete {
     }
     if (!$result) {
 	my $endtag='/'.$token->[1];
-	my $bodytext=&Apache::lonxml::get_all_text($endtag,$parser);
+	my $bodytext=&Apache::lonxml::get_all_text($endtag,$parser,$style);
 	$$parser['-1']->get_token();
 	&Apache::lonxml::debug("Deleting :$bodytext: for $token->[1]");
 	&Apache::lonxml::end_tag($tagstack,$parstack,$token);
@@ -309,6 +311,25 @@ sub insert_numericalresponse {
 </numericalresponse>';
 }
 
+sub insert_customresponse {
+    return '
+<customresponse>
+    <answer type="loncapa/perl">
+    </answer>
+    <textline />
+    <hintgroup>
+    <startouttext /><endouttext />
+    </hintgroup>
+</customresponse>';
+}
+
+sub insert_customresponse_answer {
+    return '
+    <answer type="loncapa/perl">
+    </answer>
+';
+}
+
 sub insert_stringresponse {
     return '
 <stringresponse answer="" type="">