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

sakharuk lon-capa-cvs@mail.lon-capa.org
Fri, 11 Jul 2003 15:10:54 -0000


sakharuk		Fri Jul 11 11:10:54 2003 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
   Added test for permission to split problems between pages into part tag. It works now.
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.194 loncom/homework/structuretags.pm:1.195
--- loncom/homework/structuretags.pm:1.194	Thu Jul 10 02:17:41 2003
+++ loncom/homework/structuretags.pm	Fri Jul 11 11:10:54 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.194 2003/07/10 06:17:41 www Exp $
+# $Id: structuretags.pm,v 1.195 2003/07/11 15:10:54 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -902,11 +902,17 @@
 		if ( $target eq "web" ) {
 		    $result="<br />Part is not open to be viewed. It $accessmsg<br />";
 		} elsif ( $target eq 'tex' ) {
-		    $result="\\end{minipage}\\vskip 0 mm Part is not open to be viewed. It $accessmsg \\\\\\begin{minipage}{\\textwidth}";
+		    if (not $ENV{'form.problem_split'}=~/yes/) {
+			$result="\\end{minipage}\\vskip 0 mm Part is not open to be viewed. It $accessmsg \\\\\\begin{minipage}{\\textwidth}";
+		    } else {
+			$result="\\vskip 0 mm Part is not open to be viewed. It $accessmsg \\\\";
+		    }
 		}
 	    } else {
 		if ($target eq 'tex') {
-		    $result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
+		    if (not $ENV{'form.problem_split'}=~/yes/) {
+			$result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
+		    }
 		    my $weight = &Apache::lonnet::EXT("resource.$id.weight");
 		    if ($Apache::lonhomework::type eq 'exam') { $result .= '\fbox{\textit{'.$weight.' pt}}';}
 		}