+ENDMENUOUT1
+ my $inc=0;
+ for (my $i=0;$i<=$#master_seq_view;$i++) {
+ if ($key_to==1 && $master_seq_view[$i]=~/\.(problem|exam|quiz|assess|survey|form|library)$/) {
+ $r->print('
'.
+ $master_seq_view[$i]);
+ $inc++;
+ } elsif ($key_to==0 && $master_seq_view[$i]=~/\.(problem|exam|quiz|assess|survey|form|library|xml|htm|html|page)$/) {
+ $r->print('
'.
+ $master_seq_view[$i]);
+ $inc++;
+ }
+ }
+ $r->print(<
@@ -394,56 +461,42 @@ ENDPART
$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 $symbolic = &Apache::lonnet::symbread($ENV{'form.url'});
- my @sequence = split('___',$symbolic);
- my $primary_sequence = '/res/'.$sequence[0];
- my @master_seq = &coming_from_hash($primary_sequence,$sequence[0]);
+ 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};
+ }
+ }
#-- 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];
+ my ($urlp,$symb) = split /&&/, $master_seq[$i];
if ($choice eq 'Standard LaTeX output for the primary sequence') {
- #prints only problems
- $selectionmade = 2;
- if ($urlp =~ m/\.(problem|exam|quiz|assess|survey|form|library)/) {
- 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 ($flag_latex_header_remove ne 'NO') {
- $texversion = &latex_header_footer_remove($texversion);
- } else {
- $texversion =~ s/\\end{document}//;
- }
- $result .= $texversion;
- $flag_latex_header_remove = 'YES';
- }
- } elsif ($urlp =~ /\S+/) {
- #prints problems, pages and any html/xml files
- $selectionmade = 3;
- my %moreenv;
- $moreenv{'form.grade_target'}='tex';
- &Apache::lonnet::appenv(%moreenv);
- my $texversion=&Apache::lonnet::ssi($urlp,('symb'=>$symb));
- &Apache::lonnet::delenv('form.grade_target');
- 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';
+ $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}/;}
@@ -1218,7 +1271,11 @@ sub handler {
}
#-- additional menu for class printing
if ($ENV{'form.phase'} eq 'two') {
- if($ENV{'form.choice'} eq 'All class print') {
+ if($ENV{'form.choice'} eq 'Standard LaTeX output for whole primary sequence') {
+ &sequence_content_menu(0,$r);
+ } elsif($ENV{'form.choice'} eq 'Standard LaTeX output for the primary sequence') {
+ &sequence_content_menu(1,$r);
+ } elsif($ENV{'form.choice'} eq 'All class print') {
&additional_class_menu($r);
} elsif($ENV{'form.choice'} eq 'Subdirectory print') {
&problem_choice_menu($r);