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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 08 Sep 2003 18:36:39 -0000


albertel		Mon Sep  8 14:36:39 2003 EDT

  Modified files:              
    /loncom/homework	outputtags.pm 
  Log:
  - added new argument style, if set to plain turns off html/TeX generation
  
  
Index: loncom/homework/outputtags.pm
diff -u loncom/homework/outputtags.pm:1.31 loncom/homework/outputtags.pm:1.32
--- loncom/homework/outputtags.pm:1.31	Wed Aug 13 14:50:43 2003
+++ loncom/homework/outputtags.pm	Mon Sep  8 14:36:39 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # tags that create controlled output
 #
-# $Id: outputtags.pm,v 1.31 2003/08/13 18:50:43 albertel Exp $
+# $Id: outputtags.pm,v 1.32 2003/09/08 18:36:39 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -50,6 +50,7 @@
     }
     my $status=$Apache::inputtags::status['-1'];
     &Apache::lonxml::debug("got a $status in duedatebox");
+    my $style = &Apache::lonxml::get_param('style',$parstack,$safeeval);
     if (($status =~ /CAN.*_ANSWER/) && ($target eq 'web')) {
 #	my $format = &Apache::lonxml::get_param('format',$parstack,$safeeval);
 #	if ($format eq '') {
@@ -59,9 +60,13 @@
 	my $id = $Apache::inputtags::part;
 	my $date = &Apache::lonnet::EXT("resource.$id.duedate");
 	&Apache::lonxml::debug("duedatebox found $date for $id");
-	$result ='<table border="on"><tr><td>Due '.
-	    &Apache::lonnavmaps::timeToHumanString($date).
+	if (lc($style) !~ 'plain') { 
+	    $result ='<table border="on"><tr><td>Due '.
+		&Apache::lonnavmaps::timeToHumanString($date).
 		'</td></tr></table>';
+	} else {
+	    $result='Due '.&Apache::lonnavmaps::timeToHumanString($date);
+	}
 #        } else {
 #	    $result ='<table border="on"><tr><td>No due date set.</td></tr></table>';
 #	}
@@ -89,15 +94,21 @@
 	$Apache::outputtags::showonce{'displayduetitle'}=1;
     }
     my $name=&Apache::structuretags::get_resource_name();
+    my $style = &Apache::lonxml::get_param('style',$parstack,$safeeval);
     if ($target eq 'web') {
-	$result="<h1>$name</h1>";
+	$result=$name;
+	if (lc($style) !~ 'plain') { $result="<h1>$name</h1>"; }
     } elsif ($target eq 'edit') {
 	$result=&Apache::edit::tag_start($target,$token);
 	$result.='</td></tr>';
 	$result.=&Apache::edit::end_table();
     } elsif ($target eq 'tex' and $Apache::lonhomework::type ne 'exam') {
 	$name=&Apache::lonxml::latex_special_symbols($name);
-	$result='\vskip 0 mm\noindent\textbf{'.$name.'}\vskip 0 mm';
+	if (lc($style) !~ 'plain') { 
+	    $result='\vskip 0 mm\noindent\textbf{'.$name.'}\vskip 0 mm';
+	} else {
+	    $result=$name;
+	}
     }
     return $result;
 }