--- loncom/interface/lonprintout.pm 2002/04/10 16:21:33 1.21 +++ loncom/interface/lonprintout.pm 2002/09/09 19:27:42 1.57 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.21 2002/04/10 16:21:33 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.57 2002/09/09 19:27:42 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,10 +43,12 @@ use strict; use Apache::Constants qw(:common :http); use Apache::lonxml; use Apache::lonnet; +use Apache::loncommon; use Apache::inputtags; +use Apache::grades; use Apache::edit; use Apache::File(); - +use POSIX qw(strftime); sub headerform { @@ -58,26 +60,165 @@ sub headerform {
-

What do you want to print? Make a choice.


+$ENV{'form.postdata'}

ENDHEADER } sub menu_for_output { my $r = shift; - $r->print(<print(<What do you want to print? Make a choice.
- 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 (all problems from the primary sequence) for group of students

+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 %courselist=&Apache::lonnet::dump( + 'classlist', + $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, + $ENV{'course.'.$ENV{'request.course.id'}.'.num'}); + my $now=time; + $r->print(< + +  + +  + +

+ENDDISHEADER + my $i = 0; + foreach (sort keys %courselist) { + my ($end,$start)=split(/\:/,$courselist{$_}); + my $active=1; + if (($end) && ($now>$end)) { $active=0; } + if ($active) { + my ($sname,$sdom)=split(/\:/,$_); + my %reply=&Apache::lonnet::get('environment', + ['firstname','middlename','lastname','generation'], + $sdom,$sname); + my $section=&Apache::lonnet::usection + ($sdom,$sname,$ENV{'request.course.id'}); + $r->print( + '
'. + $reply{'firstname'}.' '. + $reply{'middlename'}.' '. + $reply{'lastname'}.' '. + $reply{'generation'}. + ' ('.$_.') '.$section); + $i++; + } + } + $r->print(< + + + +ENDMENUOUT2 +} + + +sub additional_print_menu { + my $r = shift; + my $what_to_print = ''; + for (my $i=0; $i<$ENV{'form.numberofstudents'};$i++) { + $what_to_print .= ''; + } + $r->print(< + + + + +Define page layout parameters:
+Width:
+Height:
+Left margin:
+ + @@ -85,8 +226,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,'