--- loncom/interface/lonprintout.pm 2003/09/29 20:06:20 1.242 +++ loncom/interface/lonprintout.pm 2003/09/30 17:29:26 1.244 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.242 2003/09/29 20:06:20 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.244 2003/09/30 17:29:26 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1225,7 +1225,8 @@ sub printHelper { # If we're in a sequence... if (($helper->{'VARS'}->{'construction'} ne '1') && - $helper->{VARS}->{'postdata'} && $sequenceTitle) { + $helper->{VARS}->{'postdata'} && + $helper->{VARS}->{'assignment'}) { # Allow problems from sequence push @{$printChoices}, ["Problems in $sequenceTitle", 'map_problems', 'CHOOSE_PROBLEMS']; # Allow all resources from sequence @@ -1260,7 +1261,7 @@ HELPERFRAGMENT # problems in the course, optionally for selected students if ($userPriviledged && ($helper->{VARS}->{'postdata'}=~/\/res\//)) { push @{$printChoices}, ['Problems from entire course', 'all_problems', 'ALL_PROBLEMS']; - if ($sequenceTitle) { + if ($helper->{VARS}->{'assignment'}) { push @{$printChoices}, ["Problems from $sequenceTitle for selected students", 'problems_for_students', 'CHOOSE_STUDENTS']; } @@ -1325,6 +1326,10 @@ CHOOSE_FROM_SUBDIR if (!$helper->{VARS}->{'construction'}) { push @$printChoices, ["Resources from selected sequence in course", 'map_problems_pages', 'CHOOSE_SEQUENCE']; + my $escapedSequenceName = $helper->{VARS}->{'SEQUENCE'}; + #Escape apostrophes and backslashes for Perl + $escapedSequenceName =~ s/\\/\\\\/g; + $escapedSequenceName =~ s/'/\\'/g; &Apache::lonxml::xmlparse($r, 'helper', < Select the sequence to print resources from: @@ -1339,7 +1344,7 @@ CHOOSE_FROM_SUBDIR PAGESIZE return $isProblem - return $helper->{VARS}->{'SEQUENCE'}; + return '$escapedSequenceName'; return $symbFilter;