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

version 1.101, 2003/01/06 15:19:21 version 1.105, 2003/01/23 20:19:38
Line 160  sub sequence_content_menu { Line 160  sub sequence_content_menu {
       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 = @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 272  sub problem_choice_menu { Line 273  sub problem_choice_menu {
 <p>  <p>
 ENDMENUOUT1  ENDMENUOUT1
     my $i=0;      my $i=0;
     foreach my $file (@list_of_files) {      foreach my $file (sort @list_of_files) {
  $r->print('<br /><input type=checkbox name="whattoprint'.$i.'" value="'.$file.'"> '.   $r->print('<br /><input type=checkbox name="whattoprint'.$i.'" value="'.$file.'"> '.
                   $file);                    $file);
  $i++;   $i++;
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 /;
Line 1198  sub page_format_transformation { Line 1215  sub page_format_transformation {
      if ($choice ne 'All class print') {        if ($choice ne 'All class print') { 
  $text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\setlength{\\topmargin}{1cm}\\setlength{\\headheight}{1cm}\\setlength{\\headsep}{0.5cm}\\markboth{}{\\textbf{$ENV{'environment.firstname'} $ENV{'environment.lastname'}} $courseidinfo - $assignment}\\pagestyle{myheadings}\\begin{document}\\voffset=-1\.8cm\\setcounter{page}{1}/;   $text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\setlength{\\topmargin}{1cm}\\setlength{\\headheight}{1cm}\\setlength{\\headsep}{0.5cm}\\markboth{}{\\textbf{$ENV{'environment.firstname'} $ENV{'environment.lastname'}} $courseidinfo - $assignment}\\pagestyle{myheadings}\\begin{document}\\voffset=-1\.8cm\\setcounter{page}{1}/;
     } else {      } else {
  $text =~ s/\\begin{document}/\\setlength{\\textheight}{$textheight}\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}\\setlength{\\textwidth}{$textwidth}\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\begin{document}\\voffset=-1\.8cm\\setcounter{page}{1}  \\vskip 5 mm /;   $text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\begin{document}\\voffset=-1\.8cm\\setcounter{page}{1}  \\vskip 5 mm /;
     }      }
  }   }
  return $text;   return $text;
Line 1224  sub details_for_menu { Line 1241  sub details_for_menu {
     my $name_of_resourse = $hash{'title_'.$hash{'ids_'.$ENV{'form.postdata'}}};      my $name_of_resourse = $hash{'title_'.$hash{'ids_'.$ENV{'form.postdata'}}};
     my $symbolic = &Apache::lonnet::symbread($ENV{'form.postdata'});      my $symbolic = &Apache::lonnet::symbread($ENV{'form.postdata'});
     my ($map,$id,$resource)=split(/___/,$symbolic);      my ($map,$id,$resource)=split(/___/,$symbolic);
     my $name_of_sequence = $hash{'title_'.$hash{'ids_/res/'.$map}};      my $name_of_sequence;
       if ($map=~/^uploaded/) {
    $name_of_sequence = $hash{'title_'.$hash{'ids_/'.$map}};
       } else {
    $name_of_sequence = $hash{'title_'.$hash{'ids_/res/'.$map}};
       }
     if ($name_of_sequence =~ /^\s*$/) {      if ($name_of_sequence =~ /^\s*$/) {
       $map =~ m|([^/]+)$|;       $map =~ m|([^/]+)$|;
       $name_of_sequence = $1;        $name_of_sequence = $1;
     }      }
     my $name_of_map = $hash{'title_'.$hash{'ids_/res/'.$ENV{'request.course.uri'}}};      my $name_of_map = $hash{'title_'.$hash{'ids_/res/'.$ENV{'request.course.uri'}}};

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


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