--- loncom/interface/lonprintout.pm 2002/03/21 18:46:15 1.19 +++ loncom/interface/lonprintout.pm 2002/09/04 03:59:20 1.53 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.19 2002/03/21 18:46:15 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.53 2002/09/04 03:59:20 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -46,7 +46,8 @@ use Apache::lonnet; use Apache::inputtags; use Apache::edit; use Apache::File(); - +use POSIX qw(strftime); +use Apache::loncoursedata; sub headerform { @@ -58,6 +59,7 @@ sub headerform {
+$ENV{'form.postdata'}

What do you want to print? Make a choice.


ENDHEADER } @@ -65,18 +67,107 @@ ENDHEADER sub menu_for_output { my $r = shift; - $r->print(<print(< - Current document + Current document (you will print what you see on the screen)
+ENDMENUOUT1 + if ((not $ENV{'request.role'}=~m/^au\./) and (not $ENV{'request.role'}=~m/^ca\./)) { + $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 for students in class
+ENDMENUOUT6 + } + my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'}); + $subdirtoprint =~ s/\/[^\/]+$//; + if (&Apache::lonnet::allowed('bre',$subdirtoprint) eq 'F') { + $r->print(< All problems from current subdirectory (where this particular problem is)
+ENDMENUOUT4 + } + $r->print(<

And what page format do you prefer?

- CBI
- CAPA
+ + + + + + +
+ Landscape
+ Portrait
+
  + Number of columns: +
+
+ENDMENUOUT5 +} + + +sub additional_class_menu { + my $r = shift; + $r->print(< + + + +

Mark students which assignments you want to print

+ENDMENUOUT1 + my $c = $r->connection; + my %cache; + my $courseID=$ENV{'request.course.id'}; + my $classlist=&Apache::loncoursedata::DownloadClasslist($courseID, + $cache{'ClasslistTimestamp'}, + $c); + foreach (keys(%$classlist)) { + if(/^(con_lost|error|no_such_host)/i) { + untie(%cache); + return "Error getting student data."; + } + } + my $classlistaa = ''; + foreach my $st (keys(%$classlist)) { + $classlistaa .= ' SSS '.$st.' => '.$$classlist{$st}.' FFF '."\r\n"; + } + + $r->print(< + + +ENDMENUOUT2 +} + + +sub additional_print_menu { + my $r = shift; + $r->print(< + + + +Enter width of the page:
+ + @@ -84,8 +175,6 @@ ENDMENUOUT } - - sub output_data { my $r = shift; $r->print(<',$first_comment); + substr($result,$first_comment,$end_comment-$first_comment+3) = ''; + $first_comment = index($result,'