Diff for /loncom/interface/lonprintout.pm between versions 1.349 and 1.350

version 1.349, 2005/01/04 21:59:22 version 1.350, 2005/01/05 12:07:27
Line 1 Line 1
 # The LearningOnline Network  #  The LearningOnline Network
 # Printout  # Printout
 #  #
 # $Id$  # $Id$
Line 1014  ENDPART Line 1014  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';
  my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'};   my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'};
    my @page_breaks = split /\|\|\|/, $helper->{'VARS'}->{'FINISHPAGE'};
    my $page_index = 0;
  my $prevassignment='';   my $prevassignment='';
  &Apache::lonnet::delenv('form.counter');   &Apache::lonnet::delenv('form.counter');
  &Apache::lonxml::init_counter();   &Apache::lonxml::init_counter();
  for (my $i=0;$i<=$#master_seq;$i++) {   for (my $i=0;$i<=$#master_seq;$i++) {
   
       # Note due to document structure, not allowed to put \newpage
       # prior to the first resource
   
       if (($master_seq[$i] eq $page_breaks[$page_index])) {
    $page_index++;
    if($i != 0) {
       $result.="\\newpage\n";
    }
       }
     my (undef,undef,$urlp)=&Apache::lonnet::decode_symb($master_seq[$i]);      my (undef,undef,$urlp)=&Apache::lonnet::decode_symb($master_seq[$i]);
     $urlp=&Apache::lonnet::clutter($urlp);      $urlp=&Apache::lonnet::clutter($urlp);
     $form{'symb'}=$master_seq[$i];      $form{'symb'}=$master_seq[$i];
Line 1135  ENDPART Line 1147  ENDPART
      $helper->{'VARS'}->{'NUMBER_TO_PRINT'}=$#students+1;       $helper->{'VARS'}->{'NUMBER_TO_PRINT'}=$#students+1;
  }   }
  my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'};   my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'};
   
  #loop over students   #loop over students
  my $flag_latex_header_remove = 'NO';    my $flag_latex_header_remove = 'NO'; 
  my %moreenv;   my %moreenv;
Line 1145  ENDPART Line 1158  ENDPART
  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,'Print Status','Class Print Status',$#students+1,'inline','75');
  my $student_counter=-1;   my $student_counter=-1;
  foreach my $person (@students) {   foreach my $person (@students) {
   
              my $duefile="/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.due";               my $duefile="/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.due";
      if (-e $duefile) {       if (-e $duefile) {
  my $temp_file = Apache::File->new('>>'.$duefile);   my $temp_file = Apache::File->new('>>'.$duefile);
Line 1411  sub print_resources { Line 1425  sub print_resources {
  $namepostfix="\\\\Name: ";   $namepostfix="\\\\Name: ";
  $fullname = "CODE - ".$moreenv->{'CODE'};   $fullname = "CODE - ".$moreenv->{'CODE'};
     }      }
       my @page_breaks = split /\|\|\|/,$helper->{'VARS'}->{'FINISHPAGE'};
       my $page_index  = 0;
       my $i           = 0;
     #goes through all resources, checks if they are available for       #goes through all resources, checks if they are available for 
     #current student, and produces output         #current student, and produces output   
     &Apache::lonnet::delenv('form.counter');      &Apache::lonnet::delenv('form.counter');
     &Apache::lonxml::init_counter();      &Apache::lonxml::init_counter();
     foreach my $curresline (@{$master_seq})  {      foreach my $curresline (@{$master_seq})  {
    if ($curresline eq $page_breaks[$page_index]) {
       #
       #  Due to document structure, we cannot put a 
       #  page break prior to the first document
       #
       if($i != 0) {
    $current_output.= "\\newpage\n";
       }
       $page_index++;
    }
    $i++;
  if ( !($type eq 'problems' &&    if ( !($type eq 'problems' && 
        ($curresline!~ m/\.(problem|exam|quiz|assess|survey|form|library)$/)) ) {         ($curresline!~ m/\.(problem|exam|quiz|assess|survey|form|library)$/)) ) {
     my ($map,$id,$res_url) = &Apache::lonnet::decode_symb($curresline);      my ($map,$id,$res_url) = &Apache::lonnet::decode_symb($curresline);
Line 1527  sub handler { Line 1555  sub handler {
 # }  # }
 # return OK;  # return OK;
   
   
   
     
     &output_data($r,$helper,\%parmhash);      &output_data($r,$helper,\%parmhash);
     return OK;      return OK;
 }   } 
Line 1692  sub printHelper { Line 1723  sub printHelper {
   
     # If we're in a sequence...      # If we're in a sequence...
     if (($helper->{'VARS'}->{'construction'} ne '1') &&      if (($helper->{'VARS'}->{'construction'} ne '1') &&
   
  $helper->{VARS}->{'postdata'} &&   $helper->{VARS}->{'postdata'} &&
  $helper->{VARS}->{'assignment'}) {   $helper->{VARS}->{'assignment'}) {
         # Allow problems from sequence          # Allow problems from sequence
Line 1708  sub printHelper { Line 1740  sub printHelper {
       <filterfunc>return $isProblem;</filterfunc>        <filterfunc>return $isProblem;</filterfunc>
       <mapurl>$map</mapurl>        <mapurl>$map</mapurl>
       <valuefunc>return $symbFilter;</valuefunc>        <valuefunc>return $symbFilter;</valuefunc>
       <option text='End Page' variable='FINISHPAGE' />        <option text='Newpage' variable='FINISHPAGE' />
       </resource>        </resource>
     </state>      </state>
   
Line 1720  sub printHelper { Line 1752  sub printHelper {
       <filterfunc>return $isNotMap;</filterfunc>        <filterfunc>return $isNotMap;</filterfunc>
       <mapurl>$map</mapurl>        <mapurl>$map</mapurl>
       <valuefunc>return $symbFilter;</valuefunc>        <valuefunc>return $symbFilter;</valuefunc>
       <option text='End Page' variable='FINISHPAGE' />        <option text='Newpage' variable='FINISHPAGE' />
       </resource>        </resource>
     </state>      </state>
 HELPERFRAGMENT  HELPERFRAGMENT
Line 1732  HELPERFRAGMENT Line 1764  HELPERFRAGMENT
     # problems in the course, optionally for selected students      # problems in the course, optionally for selected students
     if ($userPriviledged &&       if ($userPriviledged && 
         ($helper->{VARS}->{'postdata'}=~/\/res\// || $helper->{VARS}->{'postdata'}=~/\/(syllabus|smppg|aboutme|bulletinboard)$/)) {           ($helper->{VARS}->{'postdata'}=~/\/res\// || $helper->{VARS}->{'postdata'}=~/\/(syllabus|smppg|aboutme|bulletinboard)$/)) { 
   
         push @{$printChoices}, ['<b>Problems</b> from <b>entire course</b>', 'all_problems', 'ALL_PROBLEMS'];          push @{$printChoices}, ['<b>Problems</b> from <b>entire course</b>', 'all_problems', 'ALL_PROBLEMS'];
          &Apache::lonxml::xmlparse($r, 'helper', <<ALL_PROBLEMS);           &Apache::lonxml::xmlparse($r, 'helper', <<ALL_PROBLEMS);
   <state name="ALL_PROBLEMS" title="Select Problem(s) to print">    <state name="ALL_PROBLEMS" title="Select Problem(s) to print">
Line 1742  HELPERFRAGMENT Line 1775  HELPERFRAGMENT
       <filterfunc>return $isProblemOrMap;</filterfunc>        <filterfunc>return $isProblemOrMap;</filterfunc>
       <choicefunc>return $isNotMap;</choicefunc>        <choicefunc>return $isNotMap;</choicefunc>
       <valuefunc>return $symbFilter;</valuefunc>        <valuefunc>return $symbFilter;</valuefunc>
       <option text='End Page' variable='FINISHPAGE' />        <option text='Newpage' variable='FINISHPAGE' />
     </resource>      </resource>
   </state>    </state>
 ALL_PROBLEMS  ALL_PROBLEMS
Line 1758  ALL_PROBLEMS Line 1791  ALL_PROBLEMS
       <filterfunc>return $isProblem;</filterfunc>        <filterfunc>return $isProblem;</filterfunc>
       <mapurl>$map</mapurl>        <mapurl>$map</mapurl>
       <valuefunc>return $symbFilter;</valuefunc>        <valuefunc>return $symbFilter;</valuefunc>
       <option text='End Page' variable='FINISHPAGE' />        <option text='New Page' variable='FINISHPAGE' />
       </resource>        </resource>
     <message><br /><big><i><b>How should the results be printed?</b></i></big><br /></message>      <message><br /><big><i><b>How should the results be printed?</b></i></big><br /></message>
     <choices variable="EMPTY_PAGES">      <choices variable="EMPTY_PAGES">
Line 1821  CHOOSE_ANON1 Line 1854  CHOOSE_ANON1
       <filterfunc>return $isNotMap;</filterfunc>        <filterfunc>return $isNotMap;</filterfunc>
       <mapurl>$map</mapurl>        <mapurl>$map</mapurl>
       <valuefunc>return $symbFilter;</valuefunc>        <valuefunc>return $symbFilter;</valuefunc>
       <option text='End Page' variable='FINISHPAGE' />        <option text='Newpage' variable='FINISHPAGE' />
       </resource>        </resource>
     <message><br /><big><i><b>How should the results be printed?</b></i></big><br /></message>      <message><br /><big><i><b>How should the results be printed?</b></i></big><br /></message>
     <choices variable="EMPTY_PAGES">      <choices variable="EMPTY_PAGES">
Line 1905  CHOOSE_FROM_SUBDIR Line 1938  CHOOSE_FROM_SUBDIR
       <nextstate>CHOOSE_FROM_ANY_SEQUENCE</nextstate>        <nextstate>CHOOSE_FROM_ANY_SEQUENCE</nextstate>
       <filterfunc>return \$res->is_sequence;</filterfunc>        <filterfunc>return \$res->is_sequence;</filterfunc>
       <valuefunc>return $urlValue;</valuefunc>        <valuefunc>return $urlValue;</valuefunc>
       <option text='End Page' variable='FINISHPAGE' />        <option text='Newpage' variable='FINISHPAGE' />
       </resource>        </resource>
     </state>      </state>
   <state name="CHOOSE_FROM_ANY_SEQUENCE" title="Select Resources To Print">    <state name="CHOOSE_FROM_ANY_SEQUENCE" title="Select Resources To Print">
Line 1916  CHOOSE_FROM_SUBDIR Line 1949  CHOOSE_FROM_SUBDIR
       <filterfunc>return $isProblem</filterfunc>        <filterfunc>return $isProblem</filterfunc>
       <mapurl evaluate='1'>return '$escapedSequenceName';</mapurl>        <mapurl evaluate='1'>return '$escapedSequenceName';</mapurl>
       <valuefunc>return $symbFilter;</valuefunc>        <valuefunc>return $symbFilter;</valuefunc>
       <option text='End Page' variable='FINISHPAGE' />        <option text='Newpage' variable='FINISHPAGE' />
       </resource>        </resource>
     </state>      </state>
 CHOOSE_FROM_ANY_SEQUENCE  CHOOSE_FROM_ANY_SEQUENCE

Removed from v.1.349  
changed lines
  Added in v.1.350


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