Diff for /loncom/interface/lonprintout.pm between versions 1.164 and 1.166

version 1.164, 2003/05/13 15:28:32 version 1.166, 2003/05/14 13:10:11
Line 481  ENDPART Line 481  ENDPART
       $selectionmade = 1;        $selectionmade = 1;
       if ($ENV{'form.url'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {        if ($ENV{'form.url'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
         my %moreenv;          my %moreenv;
         $moreenv{'form.grade_target'}='tex';  
         if (&Apache::lonnet::allowed('bre',$ENV{'form.url'})) {          if (&Apache::lonnet::allowed('bre',$ENV{'form.url'})) {
   $ENV{'form.url'}=~s/http:\/\/[^\/]+//;    $ENV{'form.url'}=~s/http:\/\/[^\/]+//;
         }          }
         $moreenv{'request.filename'}=$ENV{'form.url'};          $moreenv{'request.filename'}=$ENV{'form.url'};
         $moreenv{'form.textwidth'}=$LaTeXwidth;   my %form;
           $from{'textwidth'}=$LaTeXwidth;
           $form{'grade_target'}='tex';
         &Apache::lonnet::appenv(%moreenv);          &Apache::lonnet::appenv(%moreenv);
         my $texversion=&Apache::lonnet::ssi($ENV{'form.url'});          my $texversion=&Apache::lonnet::ssi($ENV{'form.url'},%form);
         &Apache::lonnet::delenv('form.grade_target','form.textwidth','form.counter');          &Apache::lonnet::delenv('form.counter');
         $result .= $texversion;          $result .= $texversion;
         if ($ENV{'form.url'}=~m/\.page\s*$/) {          if ($ENV{'form.url'}=~m/\.page\s*$/) {
   ($result,$number_of_columns) = &page_cleanup($result);    ($result,$number_of_columns) = &page_cleanup($result);
Line 523  ENDPART Line 524  ENDPART
     } elsif ($choice eq 'Standard LaTeX output for whole primary sequence') {      } elsif ($choice eq 'Standard LaTeX output for whole primary sequence') {
               $selectionmade = 3;                $selectionmade = 3;
     }      }
    my %moreenv;     my %form;
    $moreenv{'form.grade_target'}='tex';     $form{'textwidth'}=$LaTeXwidth;
    $moreenv{'form.textwidth'}=$LaTeXwidth;     $form{'grade_target'}='tex';
    &Apache::lonnet::appenv(%moreenv);     $form{'symb'}=$symb;
    #&Apache::lonnet::logthis("Trying to get $urlp with symb $symb");     #&Apache::lonnet::logthis("Trying to get $urlp with symb $symb");
    my $texversion=&Apache::lonnet::ssi($urlp,('symb'=>$symb));     my $texversion=&Apache::lonnet::ssi($urlp,%form);
    &Apache::lonnet::delenv('form.grade_target','form.textwidth');  
    if ($urlp =~ m/\.page/) {     if ($urlp =~ m/\.page/) {
      ($texversion,my $number_of_columns_page) = &page_cleanup($texversion);       ($texversion,my $number_of_columns_page) = &page_cleanup($texversion);
      if ($number_of_columns_page > $number_of_columns) {$number_of_columns=$number_of_columns_page;}        if ($number_of_columns_page > $number_of_columns) {$number_of_columns=$number_of_columns_page;} 
Line 563  ENDPART Line 563  ENDPART
      my ($urlp,$symb) = split /&&/, $file_seq[$i];       my ($urlp,$symb) = split /&&/, $file_seq[$i];
      $urlp=~s/\/home\/httpd\/html//;           $urlp=~s/\/home\/httpd\/html//;    
      if ($urlp=~m/\.(problem|exam|quiz|assess|survey|form|library)/) {       if ($urlp=~m/\.(problem|exam|quiz|assess|survey|form|library)/) {
  my %moreenv;   my %form;
  $moreenv{'form.grade_target'}='tex';   $form{'grade_target'}='tex';
  $moreenv{'form.textwidth'}=$LaTeXwidth;   $form{'textwidth'}=$LaTeXwidth;
  &Apache::lonnet::appenv(%moreenv);   $form{'symb'}=$symb;
  my $texversion=&Apache::lonnet::ssi($urlp,('symb'=>$symb));   my $texversion=&Apache::lonnet::ssi($urlp,%form);
  &Apache::lonnet::delenv('form.grade_target','form.textwidth');      
  if ($flag_latex_header_remove ne 'NO') {   if ($flag_latex_header_remove ne 'NO') {
     $texversion = &latex_header_footer_remove($texversion);      $texversion = &latex_header_footer_remove($texversion);
  } else {   } else {
Line 658  ENDPART Line 657  ENDPART
  for (my $i=0;$i<=$#list_of_files;$i++) {   for (my $i=0;$i<=$#list_of_files;$i++) {
     my $urlp = $list_of_files[$i];      my $urlp = $list_of_files[$i];
     if ($urlp=~/\//) {      if ($urlp=~/\//) {
  my %moreenv;   my %form;
  $moreenv{'form.grade_target'}='tex';   $form{'grade_target'}='tex';
  $moreenv{'form.textwidth'}=$LaTeXwidth;   $form{'textwidth'}=$LaTeXwidth;
  &Apache::lonnet::appenv(%moreenv);  
  if ($urlp =~ m|/home/([^/]+)/public_html|) {   if ($urlp =~ m|/home/([^/]+)/public_html|) {
     $urlp =~ s|/home/([^/]*)/public_html|/~$1|;      $urlp =~ s|/home/([^/]*)/public_html|/~$1|;
  } else {   } else {
     $urlp =~ s|^/home/httpd/html||;      $urlp =~ s|^/home/httpd/html||;
  }   }
  my $texversion=&Apache::lonnet::ssi($urlp);   my $texversion=&Apache::lonnet::ssi($urlp,%form);
  &Apache::lonnet::delenv('form.grade_target','form.textwidth');  
                 #this chunck is responsible for printing the path to problem                  #this chunck is responsible for printing the path to problem
  my $newurlp = '';   my $newurlp = '';
  my $HowMany = length($urlp)*2;   my $HowMany = length($urlp)*2;
Line 1037  sub character_chart { Line 1034  sub character_chart {
     $result =~ s/&(Phi|\#934);/\$\\Phi \$/g;      $result =~ s/&(Phi|\#934);/\$\\Phi \$/g;
     $result =~ s/&(Psi|\#936);/\$\\Psi \$/g;      $result =~ s/&(Psi|\#936);/\$\\Psi \$/g;
     $result =~ s/&(Omega|\#937);/\$\\Omega \$/g;      $result =~ s/&(Omega|\#937);/\$\\Omega \$/g;
   
     return $result;      return $result;
 }  }
   
Line 1375  ENDPART Line 1371  ENDPART
  $selectionmade = 1;   $selectionmade = 1;
  if ($currentURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {   if ($currentURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
     my %moreenv;      my %moreenv;
     $moreenv{'form.grade_target'}='tex';  
     $moreenv{'request.filename'}=$currentURL;      $moreenv{'request.filename'}=$currentURL;
     $moreenv{'form.textwidth'}=$LaTeXwidth;      my %form;
       $form{'grade_target'}='tex';
       $form{'textwidth'}=$LaTeXwidth;
     &Apache::lonnet::appenv(%moreenv);      &Apache::lonnet::appenv(%moreenv);
     my $texversion=&Apache::lonnet::ssi($currentURL);      my $texversion=&Apache::lonnet::ssi($currentURL,$form);
     &Apache::lonnet::delenv('form.grade_target','form.textwidth','form.counter');      &Apache::lonnet::delenv('form.counter');
       &Apache::lonnet::delenv('request.filename');
     if($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {      if($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {
  $moreenv{'form.grade_target'}='answer';   my %form;
  $moreenv{'form.print_answer'}='yes';   $form{'grade_target'}='answer';
  &Apache::lonnet::appenv(%moreenv);   $form{'print_answer'}='yes';
  my $answer=&Apache::lonnet::ssi($currentURL);   my $answer=&Apache::lonnet::ssi($currentURL,%form);
  &Apache::lonnet::delenv('form.grade_target','form.print_answer');  
  my $start=index($answer,'\vskip 0 mm',0);  
  my $finish=rindex $answer,'\vskip 0 mm' ;  
  if ($start!=-1 && $finish!=-1) {$answer=substr($answer,$start,$finish-$start+12);}  
 # $r->print('<pre>'.$answer.'</pre>'); return OK;  # $r->print('<pre>'.$answer.'</pre>'); return OK;
  $texversion=~s/(\\end{document})/$answer$1/;   $texversion=~s/(\\end{document})/$answer$1/;
     }      }
Line 1423  ENDPART Line 1417  ENDPART
     } elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems') {      } elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems') {
  $selectionmade = 4;   $selectionmade = 4;
     }      }
     my %moreenv;      my %form;
     $moreenv{'form.grade_target'}='tex';      $form{'grade_target'}='tex';
     $moreenv{'form.textwidth'}=$LaTeXwidth;      $form{'textwidth'}=$LaTeXwidth;
     &Apache::lonnet::appenv(%moreenv);      $form{'symb'}=$master_seq[$i];
     #&Apache::lonnet::logthis("Trying to get $urlp with symb $master_seq[$i]");      #&Apache::lonnet::logthis("Trying to get $urlp with symb $master_seq[$i]");
     my $texversion=&Apache::lonnet::ssi($urlp,('symb'=>$master_seq[$i]));      my $texversion=&Apache::lonnet::ssi($urlp,%form);
     &Apache::lonnet::delenv('form.grade_target','form.textwidth');  
     if ($urlp=~/\.page$/) {      if ($urlp=~/\.page$/) {
  ($texversion,my $number_of_columns_page) = &page_cleanup($texversion);   ($texversion,my $number_of_columns_page) = &page_cleanup($texversion);
  if ($number_of_columns_page > $number_of_columns) {$number_of_columns=$number_of_columns_page;}    if ($number_of_columns_page > $number_of_columns) {$number_of_columns=$number_of_columns_page;} 
Line 1506  ENDPART Line 1499  ENDPART
  for (my $i=0;$i<=$#list_of_files;$i++) {   for (my $i=0;$i<=$#list_of_files;$i++) {
     my $urlp = $list_of_files[$i];      my $urlp = $list_of_files[$i];
     if ($urlp=~/\//) {      if ($urlp=~/\//) {
  my %moreenv;   my %form;
  $moreenv{'form.grade_target'}='tex';   $form{'grade_target'}='tex';
  $moreenv{'form.textwidth'}=$LaTeXwidth;   $form{'textwidth'}=$LaTeXwidth;
  &Apache::lonnet::appenv(%moreenv);  
  if ($urlp =~ m|/home/([^/]+)/public_html|) {   if ($urlp =~ m|/home/([^/]+)/public_html|) {
     $urlp =~ s|/home/([^/]*)/public_html|/~$1|;      $urlp =~ s|/home/([^/]*)/public_html|/~$1|;
  } else {   } else {
     $urlp =~ s|^/home/httpd/html||;      $urlp =~ s|^/home/httpd/html||;
  }   }
  my $texversion=&Apache::lonnet::ssi($urlp);   my $texversion=&Apache::lonnet::ssi($urlp,%form);
  &Apache::lonnet::delenv('form.grade_target','form.textwidth');  
                 #this chunck is responsible for printing the path to problem                  #this chunck is responsible for printing the path to problem
  my $newurlp = '';   my $newurlp = '';
  my $HowMany = length($urlp)*2;   my $HowMany = length($urlp)*2;

Removed from v.1.164  
changed lines
  Added in v.1.166


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