Diff for /loncom/interface/lonprintout.pm between versions 1.627.2.32 and 1.627.2.32.2.2

version 1.627.2.32, 2022/02/10 07:42:45 version 1.627.2.32.2.2, 2023/01/17 16:12:24
Line 1344  sub latex_header_footer_remove { Line 1344  sub latex_header_footer_remove {
 #  necessity is determined by the problem_split param.  #  necessity is determined by the problem_split param.
 #  #
 sub encapsulate_minipage {  sub encapsulate_minipage {
     my ($text) = @_;      my ($text,$problem_split) = @_;
     if (!($env{'form.problem.split'} =~ /yes/i)) {      if (!($problem.split =~ /yes/i)) {
  $text = '\begin{minipage}{\textwidth}'.$text.'\end{minipage}';   $text = '\begin{minipage}{\textwidth}'.$text.'\end{minipage}';
     }      }
     return $text;      return $text;
Line 2553  sub print_construction_sequence { Line 2553  sub print_construction_sequence {
     my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm ';      my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm ';
     $body.=&path_to_problem($urlp,$LaTeXwidth);      $body.=&path_to_problem($urlp,$LaTeXwidth);
     $body.='\vskip 1 mm '.$answer.'\end{document}';      $body.='\vskip 1 mm '.$answer.'\end{document}';
     $body = &encapsulate_minipage($body);      $body = &encapsulate_minipage($body,$answerform{'problem_split'});
     $texversion.=$body;      $texversion.=$body;
  }   }
     }      }
Line 3017  ENDPART Line 3017  ENDPART
     my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm ';      my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm ';
     $body   .= &path_to_problem ($urlp,$LaTeXwidth);      $body   .= &path_to_problem ($urlp,$LaTeXwidth);
     $body   .='\vskip 1 mm '.$answer;      $body   .='\vskip 1 mm '.$answer;
     $body    = &encapsulate_minipage($body);      $body    = &encapsulate_minipage($body,$answerform{'problem_split'});
     $texversion .= $body;      $texversion .= $body;
  } else {   } else {
     $texversion='';      $texversion='';
Line 3243  ENDPART Line 3243  ENDPART
          my @lines = &Apache::lonnet::get_scantronformat_file();           my @lines = &Apache::lonnet::get_scantronformat_file();
  my ($code_type,$code_length,$bubbles_per_row)=('letter',6,10);   my ($code_type,$code_length,$bubbles_per_row)=('letter',6,10);
  foreach my $line (@lines) {   foreach my $line (@lines) {
              chomp($line);               next if (($line =~ /^\#/) || ($line eq ''));
      my ($name,$type,$length,$bubbles_per_item) =        my ($name,$type,$length,$bubbles_per_item) = 
                  (split(/:/,$line))[0,2,4,17];                   (split(/:/,$line))[0,2,4,17];
      if ($name eq $code_option) {       if ($name eq $code_option) {
Line 3732  sub print_resources { Line 3732  sub print_resources {
     my $body   ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm ';      my $body   ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm ';
     $body     .=&path_to_problem($res_url,$LaTeXwidth);      $body     .=&path_to_problem($res_url,$LaTeXwidth);
     $body     .='\vskip 1 mm '.$ansrendered;      $body     .='\vskip 1 mm '.$ansrendered;
     $body     = &encapsulate_minipage($body);      $body     = &encapsulate_minipage($body,$answerenv{'problem_split'});
     $rendered = $header.$body;      $rendered = $header.$body;
  }   }
     }      }
Line 3822  sub print_resources { Line 3822  sub print_resources {
             $message = &mt('No incomplete resources');              $message = &mt('No incomplete resources');
         }          }
         if ($message) {          if ($message) {
             $current_output  = &encapsulate_minipage("\\vskip -10mm \n$message\n \\vskip 100 mm { }\n");              $current_output  = &encapsulate_minipage("\\vskip -10mm \n$message\n \\vskip 100 mm { }\n",$moreenv->{'problem_split'});
         }          }
  if ($remove_latex_header eq "NO") {   if ($remove_latex_header eq "NO") {
     $current_output = &print_latex_header() . $current_output;      $current_output = &print_latex_header() . $current_output;
Line 4072  sub printHelper { Line 4072  sub printHelper {
             $helper->{VARS}->{'symb'} = $env{'form.symb'};              $helper->{VARS}->{'symb'} = $env{'form.symb'};
         }          }
         if ($env{'form.url'}) {          if ($env{'form.url'}) {
             $helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($helper->{VARS}->{'postdata'});              unless ($env{'form.url'} eq '/adm/navmaps') {
                   $helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($helper->{VARS}->{'postdata'});
               }
         }          }
   
     }  
   
     if ($env{'form.symb'}) {  
         $helper->{VARS}->{'symb'} = $env{'form.symb'};  
     }      }
     if ($env{'form.url'}) {  
         $helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($helper->{VARS}->{'postdata'});  
   
     }  
     if ($helper->{VARS}->{'symb'} ne '') {      if ($helper->{VARS}->{'symb'} ne '') {
         $helper->{VARS}->{'symb'}=          $helper->{VARS}->{'symb'}=
     &Apache::lonenc::check_encrypt($helper->{VARS}->{'symb'});      &Apache::lonenc::check_encrypt($helper->{VARS}->{'symb'});
Line 4358  sub printHelper { Line 4352  sub printHelper {
  # BZ 5209 - incomplete problems from entire course:   # BZ 5209 - incomplete problems from entire course:
   
  push(@{$printChoices},   push(@{$printChoices},
      [&mtn('Selected <b>Incomplete Problems</b> from <b>entire course</b> for selected people'),       [&mt('Selected [_1]Incomplete Problems[_2] from [_3]entire course[_4] for [_5]selected people[_6]',
                 '<b>','</b>','<b>','</b>','<b>','</b>'),
       'incomplete_problems_selpeople_course', 'INCOMPLETE_PROBLEMS_COURSE_RESOURCES']);        'incomplete_problems_selpeople_course', 'INCOMPLETE_PROBLEMS_COURSE_RESOURCES']);
  my $helperFragment = &create_incomplete_course_helper($helper); # Create needed states.   my $helperFragment = &create_incomplete_course_helper($helper); # Create needed states.
   
Line 4366  sub printHelper { Line 4361  sub printHelper {
   
  #  Selected problems/resources from entire course:   #  Selected problems/resources from entire course:
   
         push @{$printChoices}, [&mtn('Selected <b>Problems</b> from <b>entire course</b>'), 'all_problems', 'ALL_PROBLEMS'];          push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from [_3]entire course[_4]','<b>','</b>','<b>','</b>'), 'all_problems', 'ALL_PROBLEMS'];
  push @{$printChoices}, [&mtn('Selected <b>Resources</b> from <b>entire course</b>'), 'all_resources', 'ALL_RESOURCES'];   push @{$printChoices}, [&mt('Selected [_1]Resources[_2] from [_3]entire course[_4]','<b>','</b>','<b>','</b>'), 'all_resources', 'ALL_RESOURCES'];
  push @{$printChoices}, [&mtn('Selected <b>Problems</b> from <b>entire course</b> for <b>selected people</b>'), 'all_problems_students', 'ALL_PROBLEMS_STUDENTS'];   push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from [_3]entire course[_4] for [_5]selected people[_6]','<b>','</b>','<b>','</b>','<b>','</b>'), 'all_problems_students', 'ALL_PROBLEMS_STUDENTS'];
 my $suffixXml = <<ALL_PROBLEMS;  my $suffixXml = <<ALL_PROBLEMS;
   <state name="STUDENTS1" title="Select People">    <state name="STUDENTS1" title="Select People">
       <message><b>Select sorting order of printout</b> </message>        <message><b>Select sorting order of printout</b> </message>
Line 4525  ALL_PROBLEMS Line 4520  ALL_PROBLEMS
         my @lines = &Apache::lonnet::get_scantronformat_file();          my @lines = &Apache::lonnet::get_scantronformat_file();
  my $codechoice='';   my $codechoice='';
  foreach my $line (@lines) {   foreach my $line (@lines) {
               next if (($line =~ /^\#/) || ($line eq ''));
     my ($name,$description,$code_type,$code_length)=      my ($name,$description,$code_type,$code_length)=
  (split(/:/,$line))[0,1,2,4];   (split(/:/,$line))[0,1,2,4];
     if ($code_length > 0 &&       if ($code_length > 0 && 
Line 4702  CHOOSE_FROM_SUBDIR Line 4698  CHOOSE_FROM_SUBDIR
     # Allow the user to select any sequence in the course, feed it to      # Allow the user to select any sequence in the course, feed it to
     # another resource selector for that sequence      # another resource selector for that sequence
     if (!$helper->{VARS}->{'construction'} && !$is_published) {      if (!$helper->{VARS}->{'construction'} && !$is_published) {
  push @$printChoices, [&mtn("Selected <b>Resources</b> from <b>selected folder</b> in course"),   push(@$printChoices, [&mt('Selected [_1]Resources[_2] from [_3]selected folder[_4] in course',
       'select_sequences', 'CHOOSE_SEQUENCE'];                                    '<b>','</b>','<b>','</b>'),
         'select_sequences', 'CHOOSE_SEQUENCE']);
  my $escapedSequenceName = $helper->{VARS}->{'SEQUENCE'};   my $escapedSequenceName = $helper->{VARS}->{'SEQUENCE'};
  #Escape apostrophes and backslashes for Perl   #Escape apostrophes and backslashes for Perl
  $escapedSequenceName =~ s/\\/\\\\/g;   $escapedSequenceName =~ s/\\/\\\\/g;
Line 4722  CHOOSE_FROM_SUBDIR Line 4719  CHOOSE_FROM_SUBDIR
   <state name="CHOOSE_FROM_ANY_SEQUENCE" title="Select Resources To Print">    <state name="CHOOSE_FROM_ANY_SEQUENCE" title="Select Resources To Print">
     <message>(mark desired resources then click "next" button) <br /></message>      <message>(mark desired resources then click "next" button) <br /></message>
     <resource variable="RESOURCES" multichoice="1" toponly='1' addstatus="1"      <resource variable="RESOURCES" multichoice="1" toponly='1' addstatus="1"
               closeallpages="1" modallink="1">                closeallpages="1" modallink="1" suppressNavmap="1">
       <nextstate>PAGESIZE</nextstate>        <nextstate>PAGESIZE</nextstate>
       <filterfunc>return $isNotMap</filterfunc>        <filterfunc>return $isNotMap</filterfunc>
       <mapurl evaluate='1'>return '$escapedSequenceName';</mapurl>        <mapurl evaluate='1'>return '$escapedSequenceName';</mapurl>

Removed from v.1.627.2.32  
changed lines
  Added in v.1.627.2.32.2.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>