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

sakharuk lon-capa-cvs@mail.lon-capa.org
Tue, 27 May 2003 18:58:51 -0000


sakharuk		Tue May 27 14:58:51 2003 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  Allows to split problem ove a few pages - neccessary to print really lenthy problems. This is a starting version ehich needs to be tested on a different examples (for example, it was not yet tested on the problem with parts).
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.177 loncom/homework/structuretags.pm:1.178
--- loncom/homework/structuretags.pm:1.177	Fri May 23 12:26:28 2003
+++ loncom/homework/structuretags.pm	Tue May 27 14:58:51 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.177 2003/05/23 16:26:28 albertel Exp $
+# $Id: structuretags.pm,v 1.178 2003/05/27 18:58:51 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -403,6 +403,10 @@
 		    "<title>$name</title></head>\n$body_tag_start\n";
 	    }
 	} elsif ($target eq 'tex') {
+	    my $startminipage = '';
+	    if ($ENV{'form.problem_split'} ne 'yes') {
+		$startminipage = '\begin{minipage}{\textwidth}';
+	    }
 	    my $name= &Apache::lonxml::get_param('name',$parstack,$safeeval);
 	    if ($name eq '') {
 		$name=&Apache::lonnet::EXT('resource.title');
@@ -437,9 +441,9 @@
 		print $temp_file "$duedate\n";
 		if (not $ENV{'request.symb'} =~ m/\.page_/) {
 		    if(not $duedate=~m/1969/ and $Apache::lonhomework::type ne 'exam') {
-			$result .= '\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$ENV{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent\textit{Due date: '.$duedate.'} \vskip 1 mm\noindent \begin{minipage}{\textwidth}';	
+			$result .= '\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$ENV{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent\textit{Due date: '.$duedate.'} \vskip 1 mm\noindent '.$startminipage;	
 		    } else {
-			$result .= '\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$ENV{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent \vskip 1 mm \noindent\begin{minipage}{\textwidth}';
+			$result .= '\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$ENV{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent \vskip 1 mm \noindent'.$startminipage;
 			if ($Apache::lonhomework::type eq 'exam' and $allow_print_points==1) { $result .= '\fbox{\textit{'.$weight.' pt}}';}
 		    }
 		} else {
@@ -447,7 +451,7 @@
 		}
 	    } else {
 		if (not $ENV{'request.symb'} =~ m/\.page_/) {
-		    $result .= '\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$ENV{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent \vskip 1 mm\noindent\begin{minipage}{\textwidth}';	
+		    $result .= '\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$ENV{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent \vskip 1 mm\noindent'.$startminipage;	
 		    if (($Apache::lonhomework::type eq 'exam') and ($allow_print_points==1)) { $result .= '\fbox{\textit{'.$weight.' pt}}';}
 		} else {
 		    $result .= '\vskip 1mm \\\\\\\\';
@@ -505,9 +509,13 @@
 	    if ($target eq 'web') {
 		$result.=&Apache::lonxml::xmlend();
 	    } elsif ($target eq 'tex') {
+		my $endminipage = '';
+		if ($ENV{'form.problem_split'} ne 'yes') {
+		    $endminipage = '\end{minipage}';
+		}
 		$result .= '\keephidden{ENDOFPROBLEM}\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}';
 		if (not $ENV{'request.symb'} =~ m/\.page_/) {
-		    $result .= '\end{minipage}\end{document} ';
+		    $result .= $endminipage.'\end{document} ';
 		} else {
 		    $result .= '';
 		}