--- loncom/interface/lonprintout.pm 2009/09/08 10:53:15 1.560.2.3
+++ loncom/interface/lonprintout.pm 2009/10/06 11:02:12 1.560.2.4
@@ -11,7 +11,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.560.2.3 2009/09/08 10:53:15 foxr Exp $
+# $Id: lonprintout.pm,v 1.560.2.4 2009/10/06 11:02:12 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -163,7 +163,7 @@ sub generate_resource_chooser {
$next_state
return $filter;
CHOOSE_RESOURCES
- if ($value_func ne '') {
+ if ($choice_func ne '') {
$result .= "return $choice_func;";
}
if ($top_url ne '') {
@@ -2153,7 +2153,7 @@ ENDPART
$texversion.=&ssi_with_retries($urlp, $ssi_retry_count, %form);
&Apache::lonnet::logthis("texversion so far: $texversion");
if ($urlp=~/\.page$/) {
- &Apache::lonnet::("Special page actions");
+ &Apache::lonnet::logthis("Special page actions");
($texversion,my $number_of_columns_page) = &page_cleanup($texversion);
if ($number_of_columns_page > $number_of_columns) {$number_of_columns=$number_of_columns_page;}
$texversion =~ s/\\end{document}\d*/\\end{document}/;
@@ -2197,7 +2197,9 @@ ENDPART
}
if ($flag_latex_header_remove ne 'NO') {
+ &Apache::lonnet::logthis("Removing header/footer 1");
$texversion = &latex_header_footer_remove($texversion);
+ &Apache::lonnet::logthis("With h/f removed we have: $texversion");
} else {
$texversion =~ s/\\end{document}//;
}
@@ -2234,6 +2236,7 @@ ENDPART
}
if ($flag_latex_header_remove ne 'NO') {
+ &Apache::lonnet::logthis("Removing header & footer 2");
$texversion = &latex_header_footer_remove($texversion);
} else {
$texversion =~ s/\\end{document}/\\vskip 0\.5mm\\noindent\\makebox\[\\textwidth\/\$number_of_columns\]\[b\]\{\\hrulefill\}/;
@@ -2261,6 +2264,7 @@ ENDPART
$texversion=&unsupported($urlp,$helper->{'VARS'}->{'LATEX_TYPE'},
$master_seq[$i]);
if ($flag_latex_header_remove ne 'NO') {
+ &Apache::lonnet::logthis("Removing header/footer 3");
$texversion = &latex_header_footer_remove($texversion);
} else {
$texversion =~ s/\\end{document}//;
@@ -2322,9 +2326,11 @@ ENDPART
$helper->{'VARS'}->{'NUMBER_TO_PRINT'} = $#students+1;
}
my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'};
+ &Apache::lonnet::logthis("RESOURCES: ". $helper->{'VARS'}->{'RESOURCES'});
#loop over students
- my $flag_latex_header_remove = 'NO';
+
+ my $flag_latex_header_remove = 'NO';
my %moreenv;
$moreenv{'instructor_comments'}='hide';
$moreenv{'textwidth'}=&get_textwidth($helper,$LaTeXwidth);
@@ -2523,6 +2529,7 @@ ENDPART
$newurlp=&path_to_problem($newurlp,$LaTeXwidth);
$texversion =~ s/(\\begin{minipage}{\\textwidth})/$1 $newurlp/;
if ($flag_latex_header_remove ne 'NO') {
+ &Apache::lonnet::logthis("Removing header/footer: 4");
$texversion = &latex_header_footer_remove($texversion);
} else {
$texversion =~ s/\\end{document}//;
@@ -2727,9 +2734,10 @@ sub print_resources {
# so we will just rely on prntout.pl to strip ENDOFSTUDENTSTAMP from the
# postscript. Each ENDOFSTUDENTSTAMP will go on a line by itself.
#
-
+ &Apache::lonnet::logthis("In print_resources");
foreach my $curresline (@{$master_seq}) {
+ &Apache::lonnet::logthis("Res: $curresline");
if (defined $page_breaks{$curresline}) {
if($i != 0) {
$current_output.= "\\newpage\n";
@@ -2747,7 +2755,7 @@ sub print_resources {
&Apache::lonxml::remember_problem_counter();
my $rendered = &get_student_view_with_retries($curresline,$ssi_retry_count,$username,$userdomain,$env{'request.course.id'},'tex',$moreenv);
-
+ &Apache::lonnet::logthis("student view: $rendered");
if(($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') ||
($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'only')) {
# Use a copy of the hash so we don't pervert it on future loop passes.
@@ -2775,13 +2783,14 @@ sub print_resources {
$rendered = $header.$body;
}
}
-
+ &Apache::lonnet::logthis("After preprending header: $rendered");
if ($helper->{'VARS'}->{'PRINT_ANNOTATIONS'} eq 'yes') {
my $url = &Apache::lonnet::clutter($res_url);
my $annotation = &annotate($url);
$rendered =~ s/(\\keephidden{ENDOFPROBLEM})/$annotation$1/;
}
if ($remove_latex_header eq 'YES') {
+ &Apache::lonnet::logthis("Removing header/footer: 5");
$rendered = &latex_header_footer_remove($rendered);
} else {
$rendered =~ s/\\end{document}//;
@@ -2796,6 +2805,7 @@ sub print_resources {
$annotation =~ s/(\\end{document})/$annotation$1/;
}
if ($remove_latex_header eq 'YES') {
+ &Apache::lonnet::logthis("Removing header/footer: 6");
$rendered = &latex_header_footer_remove($rendered);
} else {
$rendered =~ s/\\end{document}//;
@@ -2805,12 +2815,14 @@ sub print_resources {
my $url = &Apache::lonnet::clutter($res_url);
my $rendered = &include_pdf($url);
if ($remove_latex_header ne 'NO') {
+ &Apache::lonnet::logthis("Removing header/footer: 7");
$rendered = &latex_header_footer_remove($rendered);
}
$current_output .= $rendered;
} else {
my $rendered = &unsupported($res_url,$helper->{'VARS'}->{'LATEX_TYPE'},$curresline);
if ($remove_latex_header ne 'NO') {
+ &Apache::lonnet::logthis("Removing header/footer: 8");
$rendered = &latex_header_footer_remove($rendered);
} else {
$rendered =~ s/\\end{document}//;
@@ -3151,7 +3163,7 @@ sub printHelper {
}
my $helperFragment = &generate_resource_chooser('CHOOSE_PROBLEMS_PAGE',
'Select Problem(s) to print',
- "multichoice='1' toponly='1', addstatus='1' closeallpages='1'",
+ "multichoice='1' toponly='1' addstatus='1' closeallpages='1'",
'RESOURCES',
'PAGESIZE',
$url,
@@ -3248,7 +3260,7 @@ ALL_PROBLEMS
'RESOURCES',
'PAGESIZE',
'',
- $isNotMap,,$symbFilter,
+ $isNotMap,'',$symbFilter,
$start_new_option) .
&generate_resource_chooser('ALL_PROBLEMS_STUDENTS',
'Select Problem(s) to print',
@@ -3256,7 +3268,7 @@ ALL_PROBLEMS
'RESOURCES',
'STUDENTS1',
'',
- $isProblemOrMap, , $symbFilter,
+ $isProblemOrMap,'' , $symbFilter,
$start_new_option) .
$suffixXml
);