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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 13 Aug 2004 18:51:33 -0000


albertel		Fri Aug 13 14:51:33 2004 EDT

  Modified files:              (Branch: version_1_2_X)
    /loncom/homework	structuretags.pm 
  Log:
  - backport 1.264
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.260 loncom/homework/structuretags.pm:1.260.2.1
--- loncom/homework/structuretags.pm:1.260	Sat Jul  3 16:52:19 2004
+++ loncom/homework/structuretags.pm	Fri Aug 13 14:51:33 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.260 2004/07/03 20:52:19 albertel Exp $
+# $Id: structuretags.pm,v 1.260.2.1 2004/08/13 18:51:33 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -58,10 +58,11 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     my $result='';
     my $bodytext=&Apache::lonxml::get_all_text("/tex",$parser);
+    &Apache::lonnet::logthis("Hrrm? $bodytext --");
     if ($target eq 'tex') {
 	return $bodytext.' ';
     }
-    return $result;;
+    return $result;
 }
 
 sub end_tex {
@@ -1083,7 +1084,11 @@
 	    } else {
 		if ($target eq 'tex') {
 		    if (not $ENV{'form.problem_split'}=~/yes/) {
-			$result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
+			if ($$tagstack[-2] eq 'td') {
+			    $result.='\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
+			} else {
+			    $result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
+			}
 		    }
 		    my $weight = &Apache::lonnet::EXT("resource.$id.weight");
 		    my $allkeys=&Apache::lonnet::metadata($ENV{'request.uri'},'packages');
@@ -1143,6 +1148,7 @@
 	    $gradestatus='';
 	}
 	$result=$gradestatus;
+	if ($$tagstack[-2] eq 'td') {$result.='\end{minipage}';} 
     } elsif ($target eq 'edit') {
 	$result=&Apache::edit::end_table();
     }