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

foxr lon-capa-cvs@mail.lon-capa.org
Wed, 09 Nov 2005 12:05:59 -0000


foxr		Wed Nov  9 07:05:59 2005 EDT

  Modified files:              
    /loncom/homework	outputtags.pm 
  Log:
  Support using <displayduedate> in target eq 'tex'.. with formatting
  and styles and all that...note that using a <displayduedate> in target 'tex'
  will cause the duedate printed out in the problem header to be supressed.
  
  
Index: loncom/homework/outputtags.pm
diff -u loncom/homework/outputtags.pm:1.43 loncom/homework/outputtags.pm:1.44
--- loncom/homework/outputtags.pm:1.43	Tue Nov  8 07:00:22 2005
+++ loncom/homework/outputtags.pm	Wed Nov  9 07:05:56 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # tags that create controlled output
 #
-# $Id: outputtags.pm,v 1.43 2005/11/08 12:00:22 foxr Exp $
+# $Id: outputtags.pm,v 1.44 2005/11/09 12:05:56 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -91,15 +91,26 @@
 	}
 
 	if ($showduedate) {
+	    my $duetext = &Apache::lonnavmaps::timeToHumanString($date, '', $format);
 	    if ($target eq 'web') {
 		if (lc($style) !~ 'plain') { 
-		    $result ='<table border="on"><tr><td>Due '.
-			&Apache::lonnavmaps::timeToHumanString($date,'', $format).
-			'</td></tr></table>';
+		    $result ='<table border="on"><tr><td>Due '.$duetext.'</td></tr></table>';
 		} else {
-		    $result=&mt('Due').' '.&Apache::lonnavmaps::timeToHumanString($date);
+		    $result=&mt('Due').' '.$duetext;
 		}
 	    } elsif ($target eq 'tex') {
+		# For TeX we'll make the duedate tag work exactly like the 
+		# duedate tag for web.
+
+		my $duetext = &Apache::lonnavmaps::timeToHumanString($date, '', $format);
+		if (lc($style) !~ 'plain') {
+		    # The due date will be put in a box.
+		    
+		    $result = '\framebox{'
+    			       .&mt('Due').' '.$duetext.'}';
+		} else {
+		    $result = &mt('Due') . ' '.$duetext;
+		}
 	    }
 	}