Diff for /loncom/interface/lonprintout.pm between versions 1.702 and 1.707

version 1.702, 2024/11/10 20:41:18 version 1.707, 2025/01/15 23:19:30
Line 812  sub map_print_dates { Line 812  sub map_print_dates {
 # Parameters:  # Parameters:
 #   $username - Name of user for whom we are checking.  #   $username - Name of user for whom we are checking.
 #   $domain   - Domain of user we are checking.  #   $domain   - Domain of user we are checking.
   #   $section  - Section for user for whom we are checking.
 #   $map - map name.  #   $map - map name.
 # Returns:  # Returns:
 #     0 - map is not incomplete.  #     0 - map is not incomplete.
 #     1 - map is incomplete.  #     1 - map is incomplete.
 #  #
 sub incomplete {  sub incomplete {
     my ($username, $domain, $map) = @_;      my ($username, $domain, $section, $map) = @_;
   
   
     my $navmap = Apache::lonnavmaps::navmap->new($username, $domain);      my $navmap = Apache::lonnavmaps::navmap->new($username, $domain, $section);
   
   
     if (defined($navmap)) {      if (defined($navmap)) {
Line 878  sub master_seq_to_person_seq { Line 879  sub master_seq_to_person_seq {
     }      }
   
     my $navmap           = Apache::lonnavmaps::navmap->new($username, $userdomain,      my $navmap           = Apache::lonnavmaps::navmap->new($username, $userdomain,
                                                            $code, $unhidden);                                                             $usersection, $code, $unhidden);
     my ($start,$finish);      my ($start,$finish);
   
     if ($map) {      if ($map) {
Line 1861  sub old_character_chart { Line 1862  sub old_character_chart {
 my %page_formats=  my %page_formats=
     ('letter' => {      ('letter' => {
  'book' => {   'book' => {
      '1' => [ '7.1 in','9.7 in', '-0.57 in','-0.57 in','0.1 in'],       '1' => [ '7.1 in','9.7 in', '-0.57 in','-0.57 in','-0.5 in'],
      '2' => ['3.66 in','9.8 in', '-0.57 in','-0.57 in','0.1 in']       '2' => ['3.66 in','9.8 in', '-0.57 in','-0.57 in','-0.5 in']
  },   },
  'album' => {   'album' => {
      '1' => [ '8.8 in', '6.8 in','-0.55 in',  '-0.55 in','-0.5 in'],       '1' => [ '8.8 in', '6.8 in','-0.55 in',  '-0.55 in','-0.5 in'],
Line 1985  sub get_course { Line 1986  sub get_course {
 }  }
   
 sub page_format_transformation {  sub page_format_transformation {
     my ($papersize,$layout,$numberofcolumns,$choice,$text,$assignment,$tableofcontents,$indexlist,$selectionmade) = @_;      my ($papersize,$layout,$numberofcolumns,$choice,$text,$assignment,$tableofcontents,
           $indexlist,$selectionmade,$mostrecent) = @_;
     my ($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin);      my ($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin);
   
     if ($selectionmade eq '4') {      if ($selectionmade eq '4') {
Line 1999  sub page_format_transformation { Line 2001  sub page_format_transformation {
     }      }
     ($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin) = &page_format($papersize,$layout,$numberofcolumns,$topmargin);      ($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin) = &page_format($papersize,$layout,$numberofcolumns,$topmargin);
   
       my $name;
     my $name = &get_name();      if ($mostrecent ne '') {
           $name = $mostrecent;
       } else {
           $name = &get_name();
       }
     my $courseidinfo = &get_course();      my $courseidinfo = &get_course();
     my $header_text  = $parmhash{'print_header_format'};      my $header_text  = $parmhash{'print_header_format'};
     $header_text     = &format_page_header($textwidth, $header_text, $assignment,      $header_text     = &format_page_header($textwidth, $header_text, $assignment,
Line 2022  sub page_format_transformation { Line 2028  sub page_format_transformation {
     $text =~ s/\\begin\{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}$topmargintoinsert\n\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\n\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\usepackage{fancyhdr}\\addtolength{\\headheight}{\\baselineskip}\n\\pagestyle{fancy}$fancypagestatement\\usepackage{booktabs}\\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1}\n /;      $text =~ s/\\begin\{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}$topmargintoinsert\n\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\n\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\usepackage{fancyhdr}\\addtolength{\\headheight}{\\baselineskip}\n\\pagestyle{fancy}$fancypagestatement\\usepackage{booktabs}\\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1}\n /;
         if ($papersize eq 'a4') {          if ($papersize eq 'a4') {
             $paperwidth = '29.7cm';              $paperwidth = '29.7cm';
             $paperheight = '21cm';              $paperheight = '21.0cm';
         } elsif ($numberofcolumns eq '1') {          } elsif ($numberofcolumns eq '1') {
             if ($papersize eq 'letter') {              if ($papersize eq 'letter') {
                 $paperwidth = '11in';                  $paperwidth = '11.0in';
                 $paperheight = '8.5in';                  $paperheight = '8.5in';
             } elsif ($papersize eq 'legal') {              } elsif ($papersize eq 'legal') {
                 $paperwidth = '14in';                  $paperwidth = '14.0in';
                 $paperheight = '8.5in';                  $paperheight = '8.5in';
             }              }
         }          }
Line 2039  sub page_format_transformation { Line 2045  sub page_format_transformation {
     $text =~ s/\\pagestyle\{fancy}\\rhead\{}\\chead\{}\s*\\begin\{document}/\\textheight = $textheight\\oddsidemargin = $evenoffset\n\\evensidemargin = $evenoffset $topmargintoinsert\\textwidth= $textwidth\\newlength{\\minipagewidth}\n\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\pagestyle{fancy}\\rhead{}\\chead{}\\usepackage{booktabs}\\begin{document}\\voffset=-0\.8cm\n\\setcounter{page}{1}  \\vskip 5 mm\n /;      $text =~ s/\\pagestyle\{fancy}\\rhead\{}\\chead\{}\s*\\begin\{document}/\\textheight = $textheight\\oddsidemargin = $evenoffset\n\\evensidemargin = $evenoffset $topmargintoinsert\\textwidth= $textwidth\\newlength{\\minipagewidth}\n\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\pagestyle{fancy}\\rhead{}\\chead{}\\usepackage{booktabs}\\begin{document}\\voffset=-0\.8cm\n\\setcounter{page}{1}  \\vskip 5 mm\n /;
  }   }
         if ($papersize eq 'a4') {          if ($papersize eq 'a4') {
             $paperwidth = '21cm';              $paperwidth = '21.0cm';
             $paperheight = '29.7cm';              $paperheight = '29.7cm';
         } elsif ($papersize eq 'letter') {          } elsif ($papersize eq 'letter') {
             $paperwidth = '8.5in';              $paperwidth = '8.5in';
             $paperheight = '11.5in';              $paperheight = '11.0in';
          } elsif ($papersize eq 'legal') {           } elsif ($papersize eq 'legal') {
             $paperwidth = '8.5in';              $paperwidth = '8.5in';
             $paperheight = '14.0in';              $paperheight = '14.0in';
Line 2768  sub print_construction_sequence { Line 2774  sub print_construction_sequence {
 #   6        Print selected problems from a folder.  #   6        Print selected problems from a folder.
 #   7        Print print selected resources from some scope.  #   7        Print print selected resources from some scope.
 #   8        Print resources for selected students.  #   8        Print resources for selected students.
   #   9        Print for anonymous CODEs
 #  #
 #BZ 5209  #BZ 5209
 #   2        map_incomplete_problems_seq Print incomplete problems from the current  #   2        map_incomplete_problems_seq Print incomplete problems from the current
Line 2860  ENDPART Line 2867  ENDPART
     my $LaTeXwidth=&recalcto_mm($textwidth);      my $LaTeXwidth=&recalcto_mm($textwidth);
     my @print_array=();      my @print_array=();
     my @student_names=();      my @student_names=();
       my $lastprinted;
   
     #  Common settings for the %form hash:      #  Common settings for the %form hash:
     # In some cases these settings get overridden by specific cases, but the      # In some cases these settings get overridden by specific cases, but the
Line 3388  ENDPART Line 3395  ENDPART
 #     &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,&mt('last student').' '.$fullname);  #     &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,&mt('last student').' '.$fullname);
      &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,'last student');       &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,'last student');
      $flag_latex_header_remove = 'YES';       $flag_latex_header_remove = 'YES';
                if ($printed) {
                    $lastprinted = $fullname;
                }
      if (&Apache::loncommon::connection_aborted($r)) { last; }       if (&Apache::loncommon::connection_aborted($r)) { last; }
  }   }
  &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);   &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
Line 3397  ENDPART Line 3407  ENDPART
       ($print_type eq 'resources_for_anon')     ||        ($print_type eq 'resources_for_anon')     ||
               ($print_type eq 'select_sequences_problems_for_anon') ||                ($print_type eq 'select_sequences_problems_for_anon') ||
               ($print_type eq 'select_sequences_resources_for_anon')) {                ($print_type eq 'select_sequences_resources_for_anon')) {
            $selectionmade = 9;
  my $cdom =$env{'course.'.$env{'request.course.id'}.'.domain'};   my $cdom =$env{'course.'.$env{'request.course.id'}.'.domain'};
  my $cnum =$env{'course.'.$env{'request.course.id'}.'.num'};   my $cnum =$env{'course.'.$env{'request.course.id'}.'.num'};
  my $num_todo=$helper->{'VARS'}->{'NUMBER_TO_PRINT_TOTAL'};   my $num_todo=$helper->{'VARS'}->{'NUMBER_TO_PRINT_TOTAL'};
Line 3510  ENDPART Line 3521  ENDPART
        &mt('last assignment').' '.$fullname);         &mt('last assignment').' '.$fullname);
      $flag_latex_header_remove = 'YES';       $flag_latex_header_remove = 'YES';
      $count++;       $count++;
                if ($printed) {
                    $lastprinted = $fullname;
                }
      if (&Apache::loncommon::connection_aborted($r)) { last; }       if (&Apache::loncommon::connection_aborted($r)) { last; }
  }   }
  &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);   &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
Line 3589  ENDPART Line 3603  ENDPART
     # Only post process if that has not been turned off e.g. by a raw latex resource.      # Only post process if that has not been turned off e.g. by a raw latex resource.
   
     if ($do_postprocessing) {      if ($do_postprocessing) {
           my $mostrecent;
           if ((($selectionmade == 5) || ($selectionmade == 8) || ($selectionmade == 9)) &&
               (($numberofcolumns == 1) || ($laystyle eq 'album' && $papersize eq 'a4'))) {
               $mostrecent = $lastprinted;
           }
  $result = &page_format_transformation($papersize,   $result = &page_format_transformation($papersize,
       $laystyle,$numberofcolumns,        $laystyle,$numberofcolumns,
       $print_type,$result,        $print_type,$result,
       $helper->{VARS}->{'assignment'},        $helper->{VARS}->{'assignment'},
       $helper->{'VARS'}->{'TABLE_CONTENTS'},        $helper->{'VARS'}->{'TABLE_CONTENTS'},
       $helper->{'VARS'}->{'TABLE_INDEX'},        $helper->{'VARS'}->{'TABLE_INDEX'},
       $selectionmade);        $selectionmade,$mostrecent);
  $result = &latex_corrections($number_of_columns,$result,$selectionmade,   $result = &latex_corrections($number_of_columns,$result,$selectionmade,
      $helper->{'VARS'}->{'ANSWER_TYPE'});       $helper->{'VARS'}->{'ANSWER_TYPE'});
  #if ($numberofcolumns == 1) {   #if ($numberofcolumns == 1) {
Line 3849  sub print_resources { Line 3868  sub print_resources {
   
  if ( !($type eq 'problems' &&   if ( !($type eq 'problems' &&
        ($curresline!~ m/$LONCAPA::assess_page_re/)) ) {         ($curresline!~ m/$LONCAPA::assess_page_re/)) ) {
     if ($print_incomplete && !&incomplete($username, $userdomain, $res_url)) {      if ($print_incomplete && !&incomplete($username, $userdomain, $usersection, $res_url)) {
  next;   next;
     }      }
     $actually_printed++; # we're going to print one.      $actually_printed++; # we're going to print one.
Line 3867  sub print_resources { Line 3886  sub print_resources {
                                 $rendered = &print_latex_header().$rendered;                                  $rendered = &print_latex_header().$rendered;
                             }                              }
                         }                          }
 ;  
                         if ($remove_latex_header eq 'YES') {                          if ($remove_latex_header eq 'YES') {
                             $rendered = &latex_header_footer_remove($rendered);                              $rendered = &latex_header_footer_remove($rendered);
                         } else {                          } else {
Line 3882  sub print_resources { Line 3900  sub print_resources {
   
   
  $answerenv{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'};   $answerenv{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'};
   
  &Apache::lonxml::restore_problem_counter();   &Apache::lonxml::restore_problem_counter();
   
  my $ansrendered = &Apache::loncommon::get_student_answers($curresline,$username,$userdomain,$env{'request.course.id'},%answerenv);   my $ansrendered = &Apache::loncommon::get_student_answers($curresline,$username,$userdomain,$env{'request.course.id'},%answerenv);
Line 4218  sub printHelper { Line 4236  sub printHelper {
   
     }      }
  }   }
   
     }      }
   
     # Detect whether we're coming from construction space      # Detect whether we're coming from construction space
Line 4386  sub printHelper { Line 4403  sub printHelper {
     # Give that as a choice.      # Give that as a choice.
   
     if ($resourceTitle && $res_printable) {      if ($resourceTitle && $res_printable) {
         push @{$printChoices}, ["<b><i>$resourceTitle</i></b> (".&mt('the resource you just saw on the screen').")", 'current_document', 'PAGESIZE'];          push(@{$printChoices}, ["<b><i>$resourceTitle</i></b> (".&mt('the resource you just saw on the screen').")", 'current_document', 'PAGESIZE']);
     }      }
   
     # Useful filter strings      # Useful filter strings
Line 4440  sub printHelper { Line 4457  sub printHelper {
  my $resourcesymb   = $page_resources[0]->symb();   my $resourcesymb   = $page_resources[0]->symb();
  my ($pagemap, $pageid, $pageurl) = &Apache::lonnet::decode_symb($symb);   my ($pagemap, $pageid, $pageurl) = &Apache::lonnet::decode_symb($symb);
  if ($page_ispage) {   if ($page_ispage) {
     push @{$printChoices},      push(@{$printChoices},
     [&mt('Selected [_1]Problems[_2] from page [_3]', '<b>', '</b>', '<b><i>'.$page_title.'</i></b>'),      [&mt('Selected [_1]Problems[_2] from page [_3]', '<b>', '</b>', '<b><i>'.$page_title.'</i></b>'),
      'map_problems_in_page',       'map_problems_in_page',
      'CHOOSE_PROBLEMS_PAGE'];       'CHOOSE_PROBLEMS_PAGE']);
     push @{$printChoices},      push(@{$printChoices},
     [&mt('Selected [_1]Resources[_2] from page [_3]', '<b>', '</b>', '<b><i>'.$page_title.'</i></b>'),      [&mt('Selected [_1]Resources[_2] from page [_3]', '<b>', '</b>', '<b><i>'.$page_title.'</i></b>'),
      'map_resources_in_page',       'map_resources_in_page',
      'CHOOSE_RESOURCES_PAGE'];       'CHOOSE_RESOURCES_PAGE']);
  }   }
         my $helperFragment = &generate_resource_chooser('CHOOSE_PROBLEMS_PAGE',          my $helperFragment = &generate_resource_chooser('CHOOSE_PROBLEMS_PAGE',
  'Select Problem(s) to print',   'Select Problem(s) to print',
Line 4531  sub printHelper { Line 4548  sub printHelper {
             } else {              } else {
                 $optionText = &mt('Selected [_1]Problems[_2] from folder [_3]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>');                  $optionText = &mt('Selected [_1]Problems[_2] from folder [_3]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>');
             }              }
     push @{$printChoices},      push(@{$printChoices},
     [$optionText,      [$optionText,
      'map_problems',       'map_problems',
      'CHOOSE_PROBLEMS'];       'CHOOSE_PROBLEMS']);
     # Allow all resources from sequence      # Allow all resources from sequence
             if ($helper->{VARS}->{'postdata'} eq '/adm/navmaps') {              if ($helper->{VARS}->{'postdata'} eq '/adm/navmaps') {
                 $optionText = &mt('Selected [_1]Resources[_2] [_3]not in a folder[_4]','<b>','</b>','<i>','</i>');                  $optionText = &mt('Selected [_1]Resources[_2] [_3]not in a folder[_4]','<b>','</b>','<i>','</i>');
             } else {              } else {
                 $optionText = &mt('Selected [_1]Resources[_2] from folder [_3]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>');                  $optionText = &mt('Selected [_1]Resources[_2] from folder [_3]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>');
             }              }
     push @{$printChoices}, [$optionText,      push(@{$printChoices}, [$optionText,
     'map_problems_pages',      'map_problems_pages',
     'CHOOSE_PROBLEMS_HTML'];      'CHOOSE_PROBLEMS_HTML']);
     my $helperFragment = &generate_resource_chooser('CHOOSE_PROBLEMS',      my $helperFragment = &generate_resource_chooser('CHOOSE_PROBLEMS',
     'Select Problem(s) to print',      'Select Problem(s) to print',
     'multichoice="1" toponly="1" addstatus="1" closeallpages="1" modallink="1" nocurrloc="'.$nocurrloc.'"',      'multichoice="1" toponly="1" addstatus="1" closeallpages="1" modallink="1" nocurrloc="'.$nocurrloc.'"',
Line 4587  sub printHelper { Line 4604  sub printHelper {
   
  #  Selected problems/resources from entire course:   #  Selected problems/resources from entire course:
   
         push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from [_3]entire course[_4]','<b>','</b>','<b>','</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}, [&mt('Selected [_1]Resources[_2] from [_3]entire course[_4]','<b>','</b>','<b>','</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}, [&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'];   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 4636  ALL_PROBLEMS Line 4653  ALL_PROBLEMS
     # either for selected students or for coded assignments.      # either for selected students or for coded assignments.
   
     if ($page_ispage) {      if ($page_ispage) {
  push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3] for [_4]selected people[_5]',   push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3] for [_4]selected people[_5]',
     '<b>', '</b>', '<b><i>'.$page_title.'</i></b>', '<b>', '</b>'),      '<b>', '</b>', '<b><i>'.$page_title.'</i></b>', '<b>', '</b>'),
  'problems_for_students_from_page', 'CHOOSE_TGT_STUDENTS_PAGE'];   'problems_for_students_from_page', 'CHOOSE_TGT_STUDENTS_PAGE']);
  push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3] for [_4]CODEd assignments[_5]',   push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3] for [_4]CODEd assignments[_5]',
     '<b>', '</b>', '<b><i>'.$page_title.'</i></b>', '<b>', '</b>'),      '<b>', '</b>', '<b><i>'.$page_title.'</i></b>', '<b>', '</b>'),
  'problems_for_anon_page', 'CHOOSE_ANON1_PAGE'];   'problems_for_anon_page', 'CHOOSE_ANON1_PAGE']);
     }      }
     push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]selected people[_5]',      push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]selected people[_5]',
  '<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'),   '<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'),
     'problems_for_students', 'CHOOSE_STUDENTS'];      'problems_for_students', 'CHOOSE_STUDENTS']);
     push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]CODEd assignments[_5]',      push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]CODEd assignments[_5]',
  '<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'),   '<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'),
     'problems_for_anon', 'CHOOSE_ANON1'];      'problems_for_anon', 'CHOOSE_ANON1']);
  }   }
   
         my ($randomly_ordered_warning,$codechoice,$code_selection,$namechoice) =          my ($randomly_ordered_warning,$codechoice,$code_selection,$namechoice) =
Line 4658  ALL_PROBLEMS Line 4675  ALL_PROBLEMS
   
     # Assignment printing:      # Assignment printing:
   
     push @{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3] for [_4]selected people[_5]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'), 'resources_for_students', 'CHOOSE_STUDENTS1'];      push(@{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3] for [_4]selected people[_5]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'), 'resources_for_students', 'CHOOSE_STUDENTS1']);
     push @{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3] for [_4]CODEd assignments[_5]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'), 'resources_for_anon', 'CHOOSE_ANON2'];      push(@{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3] for [_4]CODEd assignments[_5]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'), 'resources_for_anon', 'CHOOSE_ANON2']);
  }   }
   
         # resource_selector will hold a few states that:          # resource_selector will hold a few states that:
Line 4768  CHOOSE_ANON2 Line 4785  CHOOSE_ANON2
     }      }
   
     # FIXME: That RE should come from a library somewhere.      # FIXME: That RE should come from a library somewhere.
     if (($perm{'pav'}       if (($perm{'pav'}
         && ($subdir ne '')           && ($subdir ne '')
  && $subdir ne $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/'   && $subdir ne $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/'
  && (defined($helper->{'VARS'}->{'construction'})   && (defined($helper->{'VARS'}->{'construction'})
     ||      ||
     (&Apache::lonnet::allowed('bre',$subdir) eq 'F'      (&Apache::lonnet::allowed('bre',$subdir) eq 'F'
      &&        &&
      $helper->{VARS}->{'postdata'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)/)       $helper->{VARS}->{'postdata'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)/)
     ))       ))
  && $helper->{VARS}->{'assignment'} eq ""   && $helper->{VARS}->{'assignment'} eq ""
  ) {   ) {
  my $pretty_dir = &Apache::lonnet::hreflocation($subdir);   my $pretty_dir = &Apache::lonnet::hreflocation($subdir);
         push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from current subdirectory [_3]','<b>','</b>','<b><i>'.$pretty_dir.'</i></b>','<b>','</b>'), 'problems_from_directory', 'CHOOSE_FROM_SUBDIR'];          push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from current subdirectory [_3]','<b>','</b>','<b><i>'.$pretty_dir.'</i></b>','<b>','</b>'), 'problems_from_directory', 'CHOOSE_FROM_SUBDIR']);
         my $xmlfrag = <<CHOOSE_FROM_SUBDIR;          my $xmlfrag = <<CHOOSE_FROM_SUBDIR;
   <state name="CHOOSE_FROM_SUBDIR" title="Select File(s) from <b><small>$pretty_dir</small></b> to print">    <state name="CHOOSE_FROM_SUBDIR" title="Select File(s) from <b><small>$pretty_dir</small></b> to print">
   
Line 5031  CHOOSE_FROM_ANY_SEQUENCE Line 5048  CHOOSE_FROM_ANY_SEQUENCE
     my $startedTable = 0; # have we started an HTML table yet? (need      my $startedTable = 0; # have we started an HTML table yet? (need
                           # to close it later)                            # to close it later)
   
     if (($perm{'pav'} and $perm{'vgr'}) or       if (($perm{'pav'} and $perm{'vgr'}) or
  ($helper->{VARS}->{'construction'} eq '1')) {   ($helper->{VARS}->{'construction'} eq '1')) {
  &addMessage('<br />'   &addMessage('<br />'
                    .'<h3>'.&mt('Print Options').'</h3>'                     .'<h3>'.&mt('Print Options').'</h3>'

Removed from v.1.702  
changed lines
  Added in v.1.707


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