Diff for /loncom/interface/lonprintout.pm between versions 1.705 and 1.706

version 1.705, 2024/12/10 04:52:30 version 1.706, 2025/01/15 23:10:25
Line 3886  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 3901  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 4404  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 4458  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 4549  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 4605  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 4654  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 4676  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 4798  CHOOSE_ANON2 Line 4797  CHOOSE_ANON2
  && $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">
   

Removed from v.1.705  
changed lines
  Added in v.1.706


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