[LON-CAPA-cvs] cvs: loncom(bz5969) /interface lonprintout.pm

foxr foxr@source.lon-capa.org
Thu, 23 Jul 2009 10:42:42 -0000


foxr		Thu Jul 23 10:42:42 2009 EDT

  Modified files:              (Branch: bz5969)
    /loncom/interface	lonprintout.pm 
  Log:
  Fix various isues with printing .page and printing only a .page.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.557.2.3 loncom/interface/lonprintout.pm:1.557.2.4
--- loncom/interface/lonprintout.pm:1.557.2.3	Thu Jul 16 11:12:30 2009
+++ loncom/interface/lonprintout.pm	Thu Jul 23 10:42:41 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.557.2.3 2009/07/16 11:12:30 foxr Exp $
+# $Id: lonprintout.pm,v 1.557.2.4 2009/07/23 10:42:41 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -104,7 +104,7 @@
 sub annotate {
     my ($symb) = @_;
 
-    my $annotation_text = &Apache::admannotations::get_annotation($symb, 1);
+    my $annotation_text = &Apache::loncommon::get_annotation($symb, 1);
 
 
     my $result = "";
@@ -230,6 +230,10 @@
 sub ssi_with_retries {
     my ($resource, $retries, %form) = @_;
 
+    my $target = $form{'grade_target'};
+    my $aom    = $form{'answer_output_mode'};
+
+
 
     my ($content, $response) = &Apache::loncommon::ssi_with_retries($resource, $retries, %form);
     if (!$response->is_success) {
@@ -1356,7 +1360,7 @@
 	&Apache::lonnet::delenv('construct.style');
     }
 
-    # First is theo verall page description.  This is then followed by the 
+    # First is the overall page description.  This is then followed by the 
     # components of the page. Each of which must be printed independently.
 
     my $the_page = shift(@page_resources); 
@@ -1418,16 +1422,18 @@
 
 	    if(($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') ||
 	       ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'only')) {
-		$form{'problem_split'}=$parmhash{'problem_stream_switch'};
-		$form{'grade_target'}='answer';
-		$form{'answer_output_mode'}='tex';
-		$form{'rndseed'}=$rndseed;
+		my %answerform = %form;
+
+
+		$answerform{'problem_split'}=$parmhash{'problem_stream_switch'};
+		$answerform{'grade_target'}='answer';
+		$answerform{'answer_output_mode'}='tex';
+		$answerform{'rndseed'}=$rndseed;
                 if ($helper->{'VARS'}->{'probstatus'} eq 'exam') {
-		    $form{'problemtype'}='exam';
+		    $answerform{'problemtype'}='exam';
 		}
-		$resources_printed .= $currentURL.':';
-		my $answer=&ssi_with_retries($currentURL,$ssi_retry_count, %form);
-		
+		$resources_printed .= $urlp.':';
+		my $answer=&ssi_with_retries($urlp,$ssi_retry_count, %answerform);
 
 		if ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {
 		    $texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/;
@@ -1896,7 +1902,6 @@
 		 && $currentURL=~/\.(sequence|page)$/ && $helper->{'VARS'}->{'construction'} eq '1') {
             #printing content of sequence from the construction space	
 
-	    &Apache::lonnet::logthis("Printing sequence/page but construction space??");
 
 	    $currentURL=~s|\/~([^\/]+)\/|\/home\/$1\/public_html\/|;
 #	    $result .= &print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
@@ -1934,7 +1939,6 @@
 	    $result .= &include_pdf($cleanURL);
 	    $result .= '\end{document}';
 	} elsif ($cleanURL =~ /\.page$/i) { #  Print page in non construction space contexts.
-	    &Apache::lonnet::logthis("Printing .page $cleanURL  at " . __LINE__);
 
 	    # Determine the set of resources in the map of the page:
 
@@ -2012,12 +2016,10 @@
 	    my $texversion='';
 	    if ($urlp!~m|^/adm/|
 		&& $urlp=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
-		&Apache::lonnet::logthis("At line 1834 printing $urlp");
 		$resources_printed .= $urlp.':';
 		&Apache::lonxml::remember_problem_counter();
 		$texversion.=&ssi_with_retries($urlp, $ssi_retry_count, %form);
 		if ($urlp=~/\.page$/) {
-		    &Apache::lonnet::logthis("Handling a .page at ". __LINE__);
 
 		    ($texversion,my $number_of_columns_page) = &page_cleanup($texversion);
 		    if ($number_of_columns_page > $number_of_columns) {$number_of_columns=$number_of_columns_page;} 
@@ -2607,7 +2609,6 @@
 		if ($res_url!~m|^ext/|
 		    && $res_url=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
 		    $printed .= $curresline.':';
-		    &Apache::lonnet::logthis("At line 2427 printing $curresline");
 		    &Apache::lonxml::remember_problem_counter();    
 
 		    my $rendered = &get_student_view_with_retries($curresline,$ssi_retry_count,$username,$userdomain,$env{'request.course.id'},'tex',$moreenv);