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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 14 Nov 2006 22:55:20 -0000


albertel		Tue Nov 14 17:55:20 2006 EDT

  Modified files:              
    /loncom/homework	bridgetask.pm 
  Log:
  - only add the div to not empty <Question>s
  
  
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.205 loncom/homework/bridgetask.pm:1.206
--- loncom/homework/bridgetask.pm:1.205	Tue Nov 14 17:12:58 2006
+++ loncom/homework/bridgetask.pm	Tue Nov 14 17:55:19 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.205 2006/11/14 22:12:58 albertel Exp $
+# $Id: bridgetask.pm,v 1.206 2006/11/14 22:55:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2107,7 +2107,7 @@
     if (!&skip_dimension_parsing($dim)) {
 	&enable_dimension_parsing($dim);
     }
-    return &internal_location($dim);
+#    return &internal_location($dim);
 }
 
 sub start_QuestionText {
@@ -2195,7 +2195,6 @@
     my $instance=&get_instance($dim);
     my $version=&get_version();
     if ($target eq 'web') {
-	$result .= "\n".'<div class="LC_question">'."\n";
 	$result .= &nested_parse(\$dimension{$dim}{'intro'},[@_]);
 	my @instances = $instance;
 	if (&Apache::response::showallfoils()) {
@@ -2272,7 +2271,10 @@
 		# $result=~s/\Q$internal_location\E/$dim_info/;
 	    }
 	}
-	$result .= "\n</div>\n";
+	if ($result !~ /^\s*$/s) {
+	    $result = "\n".'<div class="LC_question">'.
+		"\n".$result."\n</div>\n";
+	}
     } elsif ($target eq 'webgrade') {
 	# in case of any side effects that we need
 	&nested_parse(\$dimension{$dim}{'intro'},[@_]);
@@ -2609,7 +2611,7 @@
 		$dimension{$dim}{'result'} .= &internal_location($id);
 	    } else {
 		&Apache::lonxml::debug(" not stashing $dim $id");
-		$result .= &internal_location($id);
+		#$result .= &internal_location($id);
 	    }
 	}
 	&Apache::lonxml::debug("Criteria $id with $dim");