[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Tue, 10 Aug 2004 18:03:30 -0000


sakharuk		Tue Aug 10 14:03:30 2004 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  Bug 2838 (print attached discussions too) is fixed with the use of newparser. I have another variant with inner_parser too but hope to hear your opinion first.
  As I've mentioned in log for lonfeedback.pm I am open for any changes of printed info (I want to talk with people about this).
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.333 loncom/xml/lonxml.pm:1.334
--- loncom/xml/lonxml.pm:1.333	Tue Jul 27 19:35:34 2004
+++ loncom/xml/lonxml.pm	Tue Aug 10 14:03:30 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.333 2004/07/27 23:35:34 www Exp $
+# $Id: lonxml.pm,v 1.334 2004/08/10 18:03:30 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -165,13 +165,20 @@
 }
 
 sub xmlend {
+    my ($target,$tagstack,$parstack,$parser,$safeeval)=@_;
     my $mode='xml';
     my $status='OPEN';
     if ($Apache::lonhomework::parsing_a_problem) {
 	$mode='problem';
 	$status=$Apache::inputtags::status[-1]; 
     }
-    return &Apache::lonfeedback::list_discussion($mode,$status).'</html>';
+    my $discussion=&Apache::lonfeedback::list_discussion($mode,$status,'',$target,$tagstack,$parstack,$parser,$safeeval);
+    if ($target eq 'tex') {
+	&Apache::lonxml::newparser($parser,\$discussion,'');
+	return '';
+    } else {
+	return $discussion.'</html>';
+    }
 }
 
 sub tokeninputfield {