--- loncom/interface/lonprintout.pm 2002/09/09 19:27:42 1.57 +++ loncom/interface/lonprintout.pm 2002/09/10 20:14:35 1.59 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.57 2002/09/09 19:27:42 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.59 2002/09/10 20:14:35 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -67,6 +67,9 @@ ENDHEADER sub menu_for_output { my $r = shift; + my $symbolic = &Apache::lonnet::symbread($ENV{'form.postdata'}); +# $symbolic =~ m/([^_]+)_/; +# my $primary_sequence = '/res/'.$1; $r->print(<What do you want to print? Make a choice.
@@ -78,13 +81,13 @@ ENDMENUOUT1 $r->print(< All problems from the primary sequence
The whole primary sequence (problems plus all html and xml files)
- All problems from the top level sequence
-
ENDMENUOUT2 } if ($ENV{'request.role'}=~m/^cc\./ or $ENV{'request.role'}=~m/^in\./ or $ENV{'request.role'}=~m/^ta\./) { $r->print(< Print assignment (all problems from the primary sequence) for group of students

+ All problems from the top level sequence
+
+ Print assignment (all problems from the primary sequence) for group of students

ENDMENUOUT6 } my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'}); @@ -106,10 +109,23 @@ ENDMENUOUT4   Number of columns: + + Paper size (format [width x height]): +
@@ -118,6 +134,77 @@ ENDMENUOUT5 } +sub problem_choice_menu { + my $r = shift; + my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'}); + $subdirtoprint =~ s/\/[^\/]+$//; + my @list_of_files = (); + if ($ENV{'request.role'}=~m/^au\./ or $ENV{'request.role'}=~m/^ca\./) { + $subdirtoprint =~ s/^[^~]*~(\w+)\//\/home\/$1\/public_html\//; + } else { + $subdirtoprint =~ s/.*(\/res\/)/$1/; + } + my @content_directory = (); + if ($ENV{'request.role'}=~m/^au\./ or $ENV{'request.role'}=~m/^ca\./) { + @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]); + if ($tempo_array[0] =~ m/^[^\.]+\.(problem|exam|quiz|assess|survey|form|library)$/) { + push(@list_of_files,$tempo_array[0]); + } + } + $subdirtoprint =~ s/\/$//; + for (my $i=0;$i<=$#list_of_files;$i++) { + $list_of_files[$i] = $subdirtoprint.'/'.$list_of_files[$i]; + } + $r->print(< + + + +

Mark problems which you want to print

+ +  + +

+ENDMENUOUT1 + my $i; + foreach my $file (@list_of_files) { + $r->print('
'. + $file); + $i++; + } + $r->print(< + + + +ENDMENUOUT2 +} + + sub additional_class_menu { my $r = shift; $r->print(<print(<