[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm

foxr lon-capa-cvs@mail.lon-capa.org
Mon, 20 Nov 2006 11:52:14 -0000


foxr		Mon Nov 20 06:52:14 2006 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  Bug 4465 - add ability to print <postanswerdate> tag contents.
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.368 loncom/homework/structuretags.pm:1.369
--- loncom/homework/structuretags.pm:1.368	Thu Nov  9 16:31:11 2006
+++ loncom/homework/structuretags.pm	Mon Nov 20 06:52:10 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.368 2006/11/09 21:31:11 albertel Exp $
+# $Id: structuretags.pm,v 1.369 2006/11/20 11:52:10 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1485,15 +1485,17 @@
     return '';
 }
 
+# In all the modes where <postanswerdate> text is 
+# displayable,  all we do is eat up the text between the start/stop
+# tags if the conditions are not right to display it.
 sub start_postanswerdate {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'webgrade') {
+    if ($target eq 'web' || $target eq 'grade' || $target eq 'webgrade' ||
+	$target eq 'tex') {
 	if ($Apache::lonhomework::scantronmode ||
 	    $Apache::inputtags::status['-1'] ne 'SHOW_ANSWER') {
 	    &Apache::lonxml::get_all_text("/postanswerdate",$parser,$style);
 	}
-    } elsif ($target eq 'tex') {
-	&Apache::lonxml::get_all_text("/postanswerdate",$parser,$style);
     }
     return '';
 }