Diff for /loncom/interface/lonprintout.pm between versions 1.609 and 1.612

version 1.609, 2011/11/07 20:05:56 version 1.612, 2011/12/27 20:14:33
Line 1 Line 1
   
 # The LearningOnline Network  # The LearningOnline Network
 # Printout  # Printout
 #  #
Line 41  use Apache::admannotations; Line 40  use Apache::admannotations;
 use Apache::lonenc;  use Apache::lonenc;
 use Apache::entities;  use Apache::entities;
 use Apache::londefdef;  use Apache::londefdef;
   # use Apache::structurelags; # for language management.
   
 use File::Basename;  use File::Basename;
   
Line 302  CHOOSE_RESOURCES Line 302  CHOOSE_RESOURCES
       </resource>        </resource>
     </state>      </state>
 CHOOSE_RESOURCES  CHOOSE_RESOURCES
   
     return $result;      return $result;
 }  }
 #  #
Line 519  sub master_seq_to_person_seq { Line 518  sub master_seq_to_person_seq {
  #  Only process resources..that are not removed by randomout...   #  Only process resources..that are not removed by randomout...
  #  and are selected for printint as well.   #  and are selected for printint as well.
  #   #
        
  if (! exists $nonResourceItems{$curres} && ! $curres->randomout()) {   if (! exists $nonResourceItems{$curres} && ! $curres->randomout()) {
     my $symb = $curres->symb();      my $symb = $curres->symb();
     if (exists $seq_hash{$symb}) {      if (exists $seq_hash{$symb}) {
Line 660  sub include_pdf { Line 660  sub include_pdf {
   
   
 }  }
   ##
   #  Collect the various \select_language{language_name}
   #  latex tags to build a \usepackage[lang-list]{babel} which will
   #  appear just prior to the \begin{document} at the front of the concatenated
   #  set of resources:
   # @param doc - The string of latex to search/replace.
   # @return string
   # @retval - the modified document stringt.
   #
   sub collect_languages {
       my $doc = shift;
       my %languages;
       while ($doc =~ /\\selectlanguage{(\w+)}/mg) {
    $languages{$1} = 1; # allows us to request each language exactly once.
       }
       my @lang_list = (keys(%languages)); # List of unique languages
       if (scalar @lang_list) {
    my $babel_header = '\usepackage[' . join(',', @lang_list) .']{babel}'. "\n";
    $doc =~ s/\\begin{document}/$babel_header\\begin{document}/;
       }
       return $doc;
   }
   #-------------------------------------------------------------------
   
 #  #
 #   ssi_with_retries- Does the server side include of a resource.  #   ssi_with_retries- Does the server side include of a resource.
Line 2052  sub recently_generated { Line 2074  sub recently_generated {
 #    A reference to a page break hash.  #    A reference to a page break hash.
 #  #
 #  #
 use Data::Dumper;  # use Data::Dumper;
 # sub dump_helper_vars {  # sub dump_helper_vars {
 #    my ($helper) = @_;  #    my ($helper) = @_;
 #    my $helpervars = Dumper($helper->{'VARS'});  #    my $helpervars = Dumper($helper->{'VARS'});
Line 2878  ENDPART Line 2900  ENDPART
      ($helper->{'VARS'}->{'PRINT_ANNOTATIONS'} eq 'yes')) {       ($helper->{'VARS'}->{'PRINT_ANNOTATIONS'} eq 'yes')) {
      $moreenv{'problem_split'}='yes';       $moreenv{'problem_split'}='yes';
  }   }
  my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Print Status','Class Print Status',$#students+1,'inline','75');   my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,$#students+1);
  my $student_counter=-1;   my $student_counter=-1;
  my $i = 0;   my $i = 0;
  my $last_section = (split(/:/,$students[0]))[2];   my $last_section = (split(/:/,$students[0]))[2];
Line 2993  ENDPART Line 3015  ENDPART
      $number_per_page=$num_todo > 0 ? $num_todo : 1;       $number_per_page=$num_todo > 0 ? $num_todo : 1;
  }   }
  my $flag_latex_header_remove = 'NO';    my $flag_latex_header_remove = 'NO'; 
  my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Print Status','Class Print Status',$num_todo,'inline','75');   my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,$num_todo);
  my $count=0;   my $count=0;
  foreach my $code (sort(@allcodes)) {   foreach my $code (sort(@allcodes)) {
      my $file_num=int($count/$number_per_page);       my $file_num=int($count/$number_per_page);
Line 3122  ENDPART Line 3144  ENDPART
   
     $result = set_font_size($result);      $result = set_font_size($result);
   
       # Insert any babel headers required.
   
       $result       = &collect_languages($result);
   
   
 #-- writing .tex file in prtspool   #-- writing .tex file in prtspool 
     my $temp_file;      my $temp_file;
     my $identifier = &Apache::loncommon::get_cgi_id();      my $identifier = &Apache::loncommon::get_cgi_id();
Line 3522  sub get_randomly_ordered_warning { Line 3549  sub get_randomly_ordered_warning {
     my $func =       my $func = 
         sub { return ($_[0]->is_map() && $_[0]->randomorder); };          sub { return ($_[0]->is_map() && $_[0]->randomorder); };
     my @matches = $navmap->retrieveResources($res, $func,1,1,1);      my @matches = $navmap->retrieveResources($res, $func,1,1,1);
     if (@matches) {  
         $message = "Some of the items below are in folders set to be randomly ordered. However, when printing the contents of these folders, they will be printed in the original order for all students, not the randomized order.";  
     }  
         }  
         if ($message) {  
     return '<message type="warning">'.$message.'</message>';  
         }          }
     } else {      } else {
         $message = "Retrieval of information about ordering of resources failed.";           $message = "Retrieval of information about ordering of resources failed."; 

Removed from v.1.609  
changed lines
  Added in v.1.612


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