Diff for /loncom/interface/lonprintout.pm between versions 1.159 and 1.163

version 1.159, 2003/05/08 18:41:16 version 1.163, 2003/05/12 20:29:39
Line 1381  ENDPART Line 1381  ENDPART
     &Apache::lonnet::appenv(%moreenv);      &Apache::lonnet::appenv(%moreenv);
     my $texversion=&Apache::lonnet::ssi($currentURL);      my $texversion=&Apache::lonnet::ssi($currentURL);
     &Apache::lonnet::delenv('form.grade_target','form.textwidth','form.counter');      &Apache::lonnet::delenv('form.grade_target','form.textwidth','form.counter');
       if($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {
    $moreenv{'form.grade_target'}='answer';
    &Apache::lonnet::appenv(%moreenv);
    my $answer=&Apache::lonnet::ssi($currentURL);
    &Apache::lonnet::delenv('form.grade_target');
    my $start=index($answer,'<table',0);
    my $finish=index($answer,'</table>',$start);
    if ($start!=-1 && $finish!=-1) {$answer=substr($answer,$start,$finish-$start+8);}
    $answer=~s/<\/td>\s*<td>/ \\\\ \\hline /g;
                   $answer=~s/<table([^>]*)>/\\vskip 0 mm \\begin{tabular}{|c|}\\hline /;
           $answer=~s/<\/table>/\\end{tabular}\\vskip 0 mm/;
           $answer=~s/<tr>\s*<td>//;
           $answer=~s/<\/td>\s*<\/tr>/\\\\ \\hline /;
           $answer=~s/<b>([^\#]*)<\/b>/\\verb|$1|/;
           $answer=~s/<i>([^\#]*)<\/i>/\\textit{$1}/;
   # $r->print('<pre>'.$answer.'</pre>'); return OK;
    $texversion=~s/(\\end{document})/$answer$1/;
       }
     $result .= $texversion;      $result .= $texversion;
     if ($currentURL=~m/\.page\s*$/) {      if ($currentURL=~m/\.page\s*$/) {
  ($result,$number_of_columns) = &page_cleanup($result);   ($result,$number_of_columns) = &page_cleanup($result);
Line 1582  sub handler { Line 1600  sub handler {
         $helper = $result;          $helper = $result;
   
   
 # my $key;   
 # foreach $key (keys %{$helper->{'VARS'}}) {   my $key; 
 #    $r->print(' '.$key.'->'.$helper->{'VARS'}->{$key}.'<-<br />');   foreach $key (keys %{$helper->{'VARS'}}) {
 # }      $r->print(' '.$key.'->'.$helper->{'VARS'}->{$key}.'<-<br />');
    }
 # return OK;  # return OK;
   
   
Line 1749  sub printHelper { Line 1768  sub printHelper {
   
     # "Delete everything after the last slash."      # "Delete everything after the last slash."
     $subdir =~ s|/[^/]+$||;      $subdir =~ s|/[^/]+$||;
     if (not defined $helper->{VARS}->{'construction'}) {      if (not $helper->{VARS}->{'construction'}) {
  $subdir =  '/home/httpd/html/res'.$subdir;      $subdir='/home/httpd/html/res/'.$subdir;
     } else {  
  $helper->{VARS}->{'construction'}=~/^([^\/]+)\/\/([^\/]+)(.*)\/[^\/]*$/;  
  $subdir = $3;  
  $subdir=~/\/~([^\/]+)\/(.*)$/;  
  $subdir = '/home/'.$1.'/public_html/'.$2;  
     }      }
 ####    $r->print('Dir:  '.$subdir.'  ');  
 ####    return OK;  
   
   
     # What can be printed is a very dynamic decision based on      # What can be printed is a very dynamic decision based on
Line 1890  CHOOSE_FROM_SUBDIR Line 1902  CHOOSE_FROM_SUBDIR
     $helper->declareVar('PRINT_TYPE');      $helper->declareVar('PRINT_TYPE');
     $paramHash->{CHOICES} = $printChoices;      $paramHash->{CHOICES} = $printChoices;
     Apache::lonhelper::choices->new();      Apache::lonhelper::choices->new();
   
       if ($ENV{'request.role.adv'}) {
           $paramHash = Apache::lonhelper::getParamHash();
           $paramHash->{MESSAGE_TEXT} = "<br /><big><b><i>Next option is available only for advanced users:</i></b></big><br />";
           Apache::lonhelper::message->new();
           $paramHash = Apache::lonhelper::getParamHash();
    $paramHash->{'variable'} = 'ANSWER_TYPE';   
    $helper->declareVar('ANSWER_TYPE');         
           $paramHash->{CHOICES} = [
                                      ['Print without answer', 'yes'],
                                      ['Print with answers', 'no'] ];
           Apache::lonhelper::choices->new();
       }
   
     Apache::lonprintout::page_format_state->new("FORMAT");      Apache::lonprintout::page_format_state->new("FORMAT");
   
     # Generate the PAGESIZE state which will offer the user the margin      # Generate the PAGESIZE state which will offer the user the margin

Removed from v.1.159  
changed lines
  Added in v.1.163


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