--- loncom/interface/lonprintout.pm 2005/09/19 10:58:33 1.393 +++ loncom/interface/lonprintout.pm 2005/10/07 10:21:08 1.394 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.393 2005/09/19 10:58:33 foxr Exp $ +# $Id: lonprintout.pm,v 1.394 2005/10/07 10:21:08 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1852,21 +1852,27 @@ sub printHelper { $helper->declareVar("showallfoils"); # The page breaks can get loaded initially from the course environment: + # But we only do this in the initial state so that they are allowed to change. + # - if((!defined($env{"form.CURRENT_STATE"})) || - ($env{'form.CURRENT_STATE'} == "START")) { - $helper->{VARS}->{FINISHPAGE} = ""; # In case they did a back e.g. - } - - + $helper->{VARS}->{FINISHPAGE} = ''; &Apache::loncommon::restore_course_settings('print', {'pagebreaks' => 'scalar', 'lastprinttype' => 'scalar'}); - - if("$helper->{VARS}->{PRINT_TYPE}" eq "$env{'form.lastprinttype'}") { - $helper->{VARS}->{FINISHPAGE} = $env{'form.pagebreaks'}; + + if($helper->{VARS}->{PRINT_TYPE} eq $env{'form.lastprinttype'}) { + if (!defined ($env{"form.CURRENT_STATE"})) { + + $helper->{VARS}->{FINISHPAGE} = $env{'form.pagebreaks'}; + } else { + my $state = $env{"form.CURRENT_STATE"}; + if ($state eq "START") { + $helper->{VARS}->{FINISHPAGE} = $env{'form.pagebreaks'}; + } + } + } @@ -1976,7 +1982,7 @@ sub printHelper { $helper->declareVar('SEQUENCE'); # Useful for debugging: Dump the help vars -# $r->print(Dumper($helper->{VARS})); +# $r->print(Dumper($helper->{VARS})); # $r->print($map); # If we're in a sequence...