Diff for /loncom/interface/lonprintout.pm between versions 1.102 and 1.105

version 1.102, 2003/01/08 15:05:52 version 1.105, 2003/01/23 20:19:38
Line 159  sub sequence_content_menu { Line 159  sub sequence_content_menu {
     if ($sequence[0]=~/^uploaded/) {$primary_sequence = '/'.$sequence[0];}       if ($sequence[0]=~/^uploaded/) {$primary_sequence = '/'.$sequence[0];} 
       else {$primary_sequence = '/res/'.$sequence[0];}         else {$primary_sequence = '/res/'.$sequence[0];} 
     my @master_seq = &coming_from_hash($primary_sequence,$sequence[0]);      my @master_seq = &coming_from_hash($primary_sequence,$sequence[0]);
     my @master_seq_view = sort @master_seq;      my @master_seq_view = @master_seq;
       @master_seq = @master_seq;
     for (my $i=0;$i<=$#master_seq_view;$i++) {      for (my $i=0;$i<=$#master_seq_view;$i++) {
  $master_seq_view[$i]=~/\/([^\/]+)$/;   $master_seq_view[$i]=~/\/([^\/]+)$/;
  $master_seq_view[$i]=$1;   $master_seq_view[$i]=$1;
Line 444  ENDPART Line 445  ENDPART
     my $number_of_columns = 1; #used only for pages to determine the width of the cell      my $number_of_columns = 1; #used only for pages to determine the width of the cell
     my $selectionmade = '';      my $selectionmade = '';
     my ($textwidth,$textheight,$oddoffset,$evenoffset) = &page_format($papersize,$layout,$numberofcolumns);      my ($textwidth,$textheight,$oddoffset,$evenoffset) = &page_format($papersize,$layout,$numberofcolumns);
     my $LaTeXwidth;      if ($numberofcolumns == 1) {
     $textwidth=$ENV{'form.width'};
    $textheight=$ENV{'form.height'};
       }
       my $LaTeXwidth; 
     if ($textwidth=~/(\d+\s*cm)/) {      if ($textwidth=~/(\d+\s*cm)/) {
  $LaTeXwidth = $1*10;   $LaTeXwidth = $1*10;
     } elsif ($textwidth=~/(\d+\s*mm)/) {      } elsif ($textwidth=~/(\d+\s*mm)/) {
Line 492  ENDPART Line 496  ENDPART
  my $flag_latex_header_remove = 'NO';   my $flag_latex_header_remove = 'NO';
  my $flag_page_in_sequence = 'NO';   my $flag_page_in_sequence = 'NO';
  for (my $i=0;$i<=$#master_seq;$i++) {   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') {      if ($choice eq 'Standard LaTeX output for the primary sequence') {
               $selectionmade = 2;                $selectionmade = 2;
     } elsif ($choice eq 'Standard LaTeX output for whole primary sequence') {      } elsif ($choice eq 'Standard LaTeX output for whole primary sequence') {
Line 525  ENDPART Line 529  ENDPART
     }  elsif ($choice eq 'Standard LaTeX output for the top level sequence') {      }  elsif ($choice eq 'Standard LaTeX output for the top level sequence') {
         # where is the main sequence of the course?          # where is the main sequence of the course?
  $selectionmade = 4;   $selectionmade = 4;
  my $main_seq = '/res/'.$ENV{'request.course.uri'};   my $main_seq;
    if ($ENV{'request.course.uri'}=~/\/?uploaded\//) {
       $main_seq = $ENV{'request.course.uri'};
    } else {
       $main_seq = '/res/'.$ENV{'request.course.uri'};
    }
  my @file_seq = &coming_from_hash_whole($main_seq);   my @file_seq = &coming_from_hash_whole($main_seq);
  my $flag_latex_header_remove = 'NO';   my $flag_latex_header_remove = 'NO';
         #-- produce an output string          #-- produce an output string
  for (my $i=0;$i<=$#file_seq;$i++) {   for (my $i=0;$i<=$#file_seq;$i++) {
             my ($urlp,$symb) = split /&&/, $file_seq[$i];     if (not $file_seq[$i]=~/^&&/) {
     $urlp=~s/\/home\/httpd\/html//;           my ($urlp,$symb) = split /&&/, $file_seq[$i];
             if ($urlp=~m/\.(problem|exam|quiz|assess|survey|form|library)/) {       $urlp=~s/\/home\/httpd\/html//;    
        if ($urlp=~m/\.(problem|exam|quiz|assess|survey|form|library)/) {
  my %moreenv;   my %moreenv;
  $moreenv{'form.grade_target'}='tex';   $moreenv{'form.grade_target'}='tex';
  $moreenv{'form.textwidth'}=$LaTeXwidth;   $moreenv{'form.textwidth'}=$LaTeXwidth;
Line 546  ENDPART Line 556  ENDPART
  }   }
  $result .= $texversion;     $result .= $texversion;  
  $flag_latex_header_remove = 'YES';   $flag_latex_header_remove = 'YES';
     }       }
      }
  }       }    
  $result .= '\end{document}';   $result .= '\end{document}';
     } elsif ($choice eq 'All class print') {       } elsif ($choice eq 'All class print') { 
Line 697  sub coming_from_hash_whole { Line 708  sub coming_from_hash_whole {
  if ($hash{'src_'.$current_resource}=~/\.sequence$/) {   if ($hash{'src_'.$current_resource}=~/\.sequence$/) {
     push @resourcelist,&coming_from_hash_whole($hash{'src_'.$current_resource});      push @resourcelist,&coming_from_hash_whole($hash{'src_'.$current_resource});
  } else {   } else {
             $mainsequence =~ /\/res\/(.*)$/;      my $presymb; 
     my $presymb = $1;      if ($mainsequence =~ /\/res\/(.*)$/) {$presymb = $1;} 
                 elsif ($mainsequence =~ /\/?(uploaded\/(.*))$/) {$presymb = $1;} 
     my $rid = $hash{'ids_'.$hash{'src_'.$current_resource}};      my $rid = $hash{'ids_'.$hash{'src_'.$current_resource}};
             if ($rid=~/,/) {      if ($rid=~/,/) {
  my @rid = split /,/, $rid;   my @rid = split /,/, $rid;
  foreach my $rid_element (@rid) {   foreach my $rid_element (@rid) {
     if ($rid_element =~ m/^$mapid\.(\d*)/) {      if ($rid_element =~ m/^$mapid\.(\d*)/) {
Line 709  sub coming_from_hash_whole { Line 721  sub coming_from_hash_whole {
     }      }
  }   }
     } else {      } else {
  $rid =~ m/^$mapid\.(\d*)/;          $rid =~ m/^$mapid\.(\d*)/;
                 $rid = $1;                    $rid = $1;  
     }      }
     $hash{'src_'.$current_resource} =~ m/\/res\/(.*)$/;      $hash{'src_'.$current_resource} =~ m/\/res\/(.*)$/;
Line 1188  sub character_chart { Line 1200  sub character_chart {
   
   
 sub page_format_transformation {  sub page_format_transformation {
  my ($papersize,$layout,$numberofcolumns,$choice,$text,$assignment) = @_;       my ($papersize,$layout,$numberofcolumns,$choice,$text,$assignment) = @_; 
       my ($textwidth,$textheight,$oddoffset,$evenoffset);
  $assignment=~s/_/ /g;   $assignment=~s/_/ /g;
  my ($textwidth,$textheight,$oddoffset,$evenoffset) = &page_format($papersize,$layout,$numberofcolumns);          if ($numberofcolumns != 1) {
             ($textwidth,$textheight,$oddoffset,$evenoffset) = &page_format($papersize,$layout,$numberofcolumns);
    } else {
     ($textwidth,$textheight,$oddoffset,$evenoffset) = ($ENV{'form.width'},$ENV{'form.height'},$ENV{'form.leftmargin'},$ENV{'form.leftmargin'});
    }
  my $courseidinfo = $ENV{'course.'.$ENV{'request.course.id'}.'.description'};   my $courseidinfo = $ENV{'course.'.$ENV{'request.course.id'}.'.description'};
  if ($layout eq 'CBI') {   if ($layout eq 'CBI') {
     $text =~ s/\\begin{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}\\setlength{\\topmargin}{200pt}\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\parindent}{20pt}\\setlength{\\marginparwidth}{90pt}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm} \\begin{document}\\setcounter{page}{1}\\noindent\\parbox{\\minipagewidth}{\\noindent\\fbox{\\textbf{$ENV{'environment.firstname'} $ENV{'environment.lastname'}}} \\hfill  $courseidinfo} \\vskip 5 mm /;      $text =~ s/\\begin{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}\\setlength{\\topmargin}{200pt}\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\parindent}{20pt}\\setlength{\\marginparwidth}{90pt}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm} \\begin{document}\\setcounter{page}{1}\\noindent\\parbox{\\minipagewidth}{\\noindent\\fbox{\\textbf{$ENV{'environment.firstname'} $ENV{'environment.lastname'}}} \\hfill  $courseidinfo} \\vskip 5 mm /;

Removed from v.1.102  
changed lines
  Added in v.1.105


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