--- loncom/interface/lonprintout.pm 2012/06/11 11:07:33 1.619 +++ loncom/interface/lonprintout.pm 2012/11/20 12:03:06 1.622 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.619 2012/06/11 11:07:33 foxr Exp $ +# $Id: lonprintout.pm,v 1.622 2012/11/20 12:03:06 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -582,14 +582,17 @@ sub printable { sub get_print_dates { my $res = shift; my $partsref = $res->parts(); - my @parts = @$partsref; + my @parts; + if (ref($partsref) eq 'ARRAY') { + @parts = @{$partsref}; + } my $open_date; my $close_date; my @open_dates; my @close_dates; - if (defined(@parts) && (scalar(@parts) > 0)) { + if (@parts) { foreach my $part (@parts) { my $partopen = $res->parmval('printstartdate', $part); my $partclose = $res->parmval('printenddate', $part); @@ -632,7 +635,7 @@ sub course_print_dates { # Don't bother looping over undefined or empty parts arraY; - if (defined(@parts) && (scalar(@parts) > 0)) { + if (@parts) { foreach my $part (@parts) { my ($partopen, $partclose) = $navmap->course_printdates($res, $part); push(@open_dates, $partopen); @@ -658,7 +661,7 @@ sub map_print_dates { # Don't bother looping over undefined or empty parts arraY; - if (defined(@parts) && (scalar(@parts) > 0)) { + if (@parts) { foreach my $part (@parts) { my ($partopen, $partclose) = $navmap->map_printdates($res, $part); push(@open_dates, $partopen); @@ -2602,6 +2605,7 @@ sub print_construction_sequence { # For item 100, filtering was done at the helper level. sub output_data { + my ($r,$helper,$rparmhash) = @_; my %parmhash = %$rparmhash; $ssi_error = 0; # This will be set nonzero by failing ssi's. @@ -2875,7 +2879,6 @@ ENDPART ($print_type eq 'select_sequences') or ($print_type eq 'map_incomplete_problems_seq') ) { - #-- produce an output string if (($print_type eq 'map_problems') or @@ -3530,7 +3533,6 @@ sub print_resources { my $namepostfix = "\\\\"; # Both anon and not anon should get the same vspace. - # # Figure out if we need to filter the output by # the incomplete problems for that person @@ -3797,7 +3799,6 @@ sub handler { } &init_perm(); - my $helper = printHelper($r); if (!ref($helper)) { return $helper; @@ -4216,7 +4217,7 @@ sub printHelper { 'RESOURCES', 'PAGESIZE', $map, - ! $isProblem, '', + $isProblem, '', $symbFilter, $start_new_option); $helperFragment .= &generate_resource_chooser('CHOOSE_PROBLEMS_HTML',