--- loncom/interface/lonprintout.pm 2002/07/23 14:09:45 1.41
+++ loncom/interface/lonprintout.pm 2002/08/02 18:27:04 1.46
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.41 2002/07/23 14:09:45 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.46 2002/08/02 18:27:04 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -79,6 +79,7 @@ ENDMENUOUT1
All problems from the top level sequence
ENDMENUOUT2
+ }
my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'});
$subdirtoprint =~ s/\/[^\/]+$//;
if (&Apache::lonnet::allowed('bre',$subdirtoprint) eq 'F') {
@@ -86,7 +87,6 @@ ENDMENUOUT2
All problems from current subdirectory (where this particular problem is)
ENDMENUOUT4
}
- }
$r->print(<
And what page format do you prefer?
@@ -98,7 +98,17 @@ ENDMENUOUT4
- Number of columns:
+ Number of columns:
@@ -157,6 +167,11 @@ ENDPART
my $sequence_file=&Apache::lonnet::filelocation("",$primary_sequence);
my $sequencefilecontents=&Apache::lonnet::getfile($sequence_file);
my @master_seq = &content_map($sequencefilecontents);
+#
+# for (my $iu=0;$iu<=$#master_seq;$iu++) {
+# $result .= ' '.$master_seq[$iu].' ';
+# }
+#
#-- produce an output string
for (my $i=0;$i<=$#master_seq;$i++) {
$_ = $master_seq[$i];
@@ -225,22 +240,30 @@ ENDPART
my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'});
$subdirtoprint =~ s/\/[^\/]+$//;
my @list_of_files = ();
- my $localdirectory = $subdirtoprint;
- $localdirectory =~ s/.*(\/res\/)/$1/;
- my @content_directory = &Apache::lonnet::dirlist($localdirectory);
+ if ($ENV{'request.role'}=~m/^au\./) {
+ $subdirtoprint =~ s/^[^~]*~(\w+)\//\/home\/$1\/public_html\//;
+ } else {
+ $subdirtoprint =~ s/.*(\/res\/)/$1/;
+ }
+ my @content_directory = ();
+ if ($ENV{'request.role'}=~m/^au\./) {
+ @content_directory = &Apache::lonnet::dirlist($subdirtoprint,$ENV{'user.domain'}, $ENV{'user.name'},'');
+ } else {
+ @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];
+ if ($tempo_array[0] =~ m/^[^\.]+\.(problem|exam|quiz|assess|survey|form|library)$/) {
+ push(@list_of_files,$tempo_array[0]);
}
}
- $localdirectory =~ s/\/$//;
+ $subdirtoprint =~ s/\/$//;
for (my $i=0;$i<=$#list_of_files;$i++) {
- my $urlp = $localdirectory.'/'.$list_of_files[$i];
+ my $urlp = $subdirtoprint.'/'.$list_of_files[$i];
my %moreenv;
$moreenv{'form.grade_target'}='tex';
&Apache::lonnet::appenv(%moreenv);
+ 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}}/;
@@ -284,7 +307,7 @@ ENDPART
$first_comment = index($result,'