[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Fri, 02 Aug 2002 18:27:04 -0000


sakharuk		Fri Aug  2 14:27:04 2002 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Done additional cleanup of the code.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.45 loncom/interface/lonprintout.pm:1.46
--- loncom/interface/lonprintout.pm:1.45	Fri Aug  2 14:08:12 2002
+++ loncom/interface/lonprintout.pm	Fri Aug  2 14:27:04 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.45 2002/08/02 18:08:12 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.46 2002/08/02 18:27:04 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -245,22 +245,16 @@
 	} else {
 	    $subdirtoprint =~ s/.*(\/res\/)/$1/;
 	}
+	my @content_directory = ();
 	if ($ENV{'request.role'}=~m/^au\./) {
-	    my @content_directory = &Apache::lonnet::dirlist($subdirtoprint,$ENV{'user.domain'}, $ENV{'user.name'},'');
-	    for (my $iy=0;$iy<=$#content_directory;$iy++) {
-		my @tempo_array = split(/&/,$content_directory[$iy]);
-		if ($tempo_array[0] =~ m/^[^\.]+\.problem$/) {
-		    push(@list_of_files,$tempo_array[0]);
-		}
-	    }
+	    @content_directory = &Apache::lonnet::dirlist($subdirtoprint,$ENV{'user.domain'}, $ENV{'user.name'},'');
 	} else {
-	    my @content_directory = &Apache::lonnet::dirlist($subdirtoprint);
-	    for (my $iy=0;$iy<=$#content_directory;$iy++) {
-		my @tempo_array = split(/&/,$content_directory[$iy]);
-		$content_directory[$iy] = $tempo_array[0];
-		if ($content_directory[$iy] =~ m/^[^\.]+\.problem$/) {
-		    push @list_of_files,$content_directory[$iy];
-		}
+	    @content_directory = &Apache::lonnet::dirlist($subdirtoprint);
+	}
+	for (my $iy=0;$iy<=$#content_directory;$iy++) {
+	    my @tempo_array = split(/&/,$content_directory[$iy]);
+	    if ($tempo_array[0] =~ m/^[^\.]+\.(problem|exam|quiz|assess|survey|form|library)$/) {
+		push(@list_of_files,$tempo_array[0]);
 	    }
 	}
 	$subdirtoprint =~ s/\/$//;
@@ -269,9 +263,7 @@
 	    my %moreenv;
 	    $moreenv{'form.grade_target'}='tex';
 	    &Apache::lonnet::appenv(%moreenv);
-	    if ($ENV{'request.role'}=~m/^au\./) {
-		$urlp =~ s/\/home\/([^\/]*)\/public_html/\/~$1/;
-	    }
+	    if ($ENV{'request.role'}=~m/^au\./) { $urlp =~ s/\/home\/([^\/]*)\/public_html/\/~$1/; }
 	    my $texversion=&Apache::lonnet::ssi($urlp);
 	    &Apache::lonnet::delenv('form.grade_target');
 	    $texversion =~ s/(\\begin{document})/$1 {\\tiny\\begin{verbatim}$urlp\\end{verbatim}}/;