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

foxr lon-capa-cvs-allow@mail.lon-capa.org
Fri, 10 Aug 2007 11:35:59 -0000


foxr		Fri Aug 10 07:35:59 2007 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  BZ 5321 - Remove attempts at new lines for <part> when in table.
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.387 loncom/homework/structuretags.pm:1.388
--- loncom/homework/structuretags.pm:1.387	Wed Aug  8 15:13:19 2007
+++ loncom/homework/structuretags.pm	Fri Aug 10 07:35:57 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.387 2007/08/08 19:13:19 albertel Exp $
+# $Id: structuretags.pm,v 1.388 2007/08/10 11:35:57 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -202,20 +202,27 @@
 #use Time::HiRes();
 sub get_resource_name {
     my ($parstack,$safeeval)=@_;
+    my $name;
     if (defined($Apache::lonhomework::name)) {
-	return $Apache::lonhomework::name;
-    }
-    my ($symb)=&Apache::lonnet::whichuser();
-    my $name=&Apache::lonnet::gettitle($symb);
-    if ($name eq '') {
-	$name=&Apache::lonnet::EXT('resource.title');
-	if ($name eq 'con_lost') { $name = ''; }
-    }
-    if ($name!~/\S+/) {
-	$name=$env{'request.uri'};
-	$name=~s-.*/([^/]+)$-$1-;
+	$name = $Apache::lonhomework::name;
+    } else {
+	my ($symb)=&Apache::lonnet::whichuser();
+	my $name=&Apache::lonnet::gettitle($symb);
+	if ($name eq '') {
+	    $name=&Apache::lonnet::EXT('resource.title');
+	    if ($name eq 'con_lost') { $name = ''; }
+	}
+	if ($name!~/\S+/) {
+	    $name=$env{'request.uri'};
+	    $name=~s-.*/([^/]+)$-$1-;
+	}
+	# The name has had html tags escaped:
+       
+	$name=~s/&lt;/</gs;
+	$name=~s/&gt;/>/gs;
+
+	$Apache::lonhomework::name=$name;
     }
-    $Apache::lonhomework::name=$name;
     return $name;
 }
 
@@ -1427,7 +1434,7 @@
 		if ($target eq 'tex') {
 		    if (not $env{'form.problem_split'}=~/yes/) {
 			if ($$tagstack[-2] eq 'td') {
-			    $result.='\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
+			    $result.='\noindent \begin{minipage}{\textwidth}\noindent';
 			} else {
 			    $result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
 			}