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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 21 Nov 2002 22:35:33 -0000


albertel		Thu Nov 21 17:35:33 2002 EDT

  Modified files:              
    /loncom/homework	outputtags.pm 
  Log:
  - now defaults to 1 point even if no points set better
  - Also works for printouts
  - Fixes BUG#969
  
  
Index: loncom/homework/outputtags.pm
diff -u loncom/homework/outputtags.pm:1.22 loncom/homework/outputtags.pm:1.23
--- loncom/homework/outputtags.pm:1.22	Wed Oct 16 16:50:08 2002
+++ loncom/homework/outputtags.pm	Thu Nov 21 17:35:32 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # tags that create controlled output
 #
-# $Id: outputtags.pm,v 1.22 2002/10/16 20:50:08 albertel Exp $
+# $Id: outputtags.pm,v 1.23 2002/11/21 22:35:32 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -118,11 +118,11 @@
 	$Apache::outputtags::showonce{'displayweight'}=1;
     }
     my $status=$Apache::inputtags::status['-1'];
-    if (($status =~ /CAN.*_ANSWER/) && ($target eq 'web')) {
+    if (($status =~ /CAN.*_ANSWER/) && ($target eq 'web' || $target eq 'tex')) {
 	my $id = $Apache::inputtags::part;
 	my $weight = &Apache::lonnet::EXT("resource.$id.weight");
 	&Apache::lonxml::debug("duedatebox found $weight for $id");
-	if (!defined($weight)) { $weight=1; }
+	if (!defined($weight) || ($weight eq '')) { $weight=1; }
 	$result.=$weight;
     } elsif ( $target eq 'edit' ) {
 	$result=&Apache::edit::tag_start($target,$token);