--- loncom/interface/lonprintout.pm 2003/05/01 20:37:32 1.140
+++ loncom/interface/lonprintout.pm 2003/05/02 13:39:04 1.141
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.140 2003/05/01 20:37:32 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.141 2003/05/02 13:39:04 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1417,50 +1417,49 @@ ENDPART
}
-# } elsif ($choice eq 'Standard LaTeX output for the primary sequence' or
-# $choice eq 'Standard LaTeX output for whole primary sequence') {
-# #-- minimal sequence to which the current document belongs
-# #-- where is the primary sequence containing file?
-# my @master_seq = ();
-# for (my $i=0; $i<$ENV{'form.numberoffiles'};$i++) {
-# if ($ENV{'form.whatfile'.$i}=~/\S/) {
-# push @master_seq,$ENV{'form.whatfile'.$i};
-# }
+ } elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems') {
+ #-- produce an output string
+ my $flag_latex_header_remove = 'NO';
+ my $flag_page_in_sequence = 'NO';
+ my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'};
+
+# foreach my $key (@master_seq) {
+# $r->print(' '.$key.'
');
# }
-# #-- produce an output string
-# my $flag_latex_header_remove = 'NO';
-# my $flag_page_in_sequence = 'NO';
-# for (my $i=0;$i<=$#master_seq;$i++) {
-# my ($urlp,$symb) = split /&&/, $master_seq[$i];
-# if ($choice eq 'Standard LaTeX output for the primary sequence') {
-# $selectionmade = 2;
+# return OK;
+
+ for (my $i=0;$i<=$#master_seq;$i++) {
+ $master_seq[$i]=~/___\d+___(.*)$/;
+ my $urlp='/res/'.$1;
+ if ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems') {
+ $selectionmade = 2;
# } elsif ($choice eq 'Standard LaTeX output for whole primary sequence') {
# $selectionmade = 3;
-# }
-# my %moreenv;
-# $moreenv{'form.grade_target'}='tex';
-# $moreenv{'form.textwidth'}=$LaTeXwidth;
-# &Apache::lonnet::appenv(%moreenv);
-# #&Apache::lonnet::logthis("Trying to get $urlp with symb $symb");
-# my $texversion=&Apache::lonnet::ssi($urlp,('symb'=>$symb));
-# &Apache::lonnet::delenv('form.grade_target','form.textwidth');
-# if ($urlp =~ m/\.page/) {
-# ($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}/;
-# $flag_page_in_sequence = 'YES';
-# }
-# if ($flag_latex_header_remove ne 'NO') {
-# $texversion = &latex_header_footer_remove($texversion);
-# } else {
-# $texversion =~ s/\\end{document}//;
-# }
-# $result .= $texversion;
-# $flag_latex_header_remove = 'YES';
-# }
-# &Apache::lonnet::delenv('form.counter');
-# if ($flag_page_in_sequence eq 'YES') {$result =~ s/\\usepackage{calc}/\\usepackage{calc}\\usepackage{longtable}/;}
-# $result .= '\end{document}';
+ }
+ my %moreenv;
+ $moreenv{'form.grade_target'}='tex';
+ $moreenv{'form.textwidth'}=$LaTeXwidth;
+ &Apache::lonnet::appenv(%moreenv);
+ #&Apache::lonnet::logthis("Trying to get $urlp with symb $master_seq[$i]");
+ my $texversion=&Apache::lonnet::ssi($urlp,('symb'=>$master_seq[$i]));
+ &Apache::lonnet::delenv('form.grade_target','form.textwidth');
+ if ($urlp=~/\.page$/) {
+ ($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}/;
+ $flag_page_in_sequence = 'YES';
+ }
+ if ($flag_latex_header_remove ne 'NO') {
+ $texversion = &latex_header_footer_remove($texversion);
+ } else {
+ $texversion =~ s/\\end{document}//;
+ }
+ $result .= $texversion;
+ $flag_latex_header_remove = 'YES';
+ }
+ &Apache::lonnet::delenv('form.counter');
+ if ($flag_page_in_sequence eq 'YES') {$result =~ s/\\usepackage{calc}/\\usepackage{calc}\\usepackage{longtable}/;}
+ $result .= '\end{document}';
# } elsif ($choice eq 'Standard LaTeX output for the top level sequence') {
# # where is the main sequence of the course?
# $selectionmade = 4;
@@ -1660,12 +1659,13 @@ sub handler {
$helper = $result;
-# my $key;
+ my $key;
# foreach $key (keys %{$helper->{'VARS'}}) {
# $r->print(' '.$key.'->'.$helper->{'VARS'}->{$key}.'
');
# }
+# return OK;
+
-
&output_data_new($r,$helper);