--- loncom/interface/lonprintout.pm 2002/04/01 18:23:12 1.20 +++ loncom/interface/lonprintout.pm 2002/09/05 15:51:07 1.54 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.20 2002/04/01 18:23:12 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.54 2002/09/05 15:51:07 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,10 +43,13 @@ use strict; use Apache::Constants qw(:common :http); use Apache::lonxml; use Apache::lonnet; +use Apache::loncommon; use Apache::inputtags; +use Apache::loncoursedata; +use Apache::grades; use Apache::edit; use Apache::File(); - +use POSIX qw(strftime); sub headerform { @@ -58,6 +61,7 @@ sub headerform {
+$ENV{'form.postdata'}

What do you want to print? Make a choice.


ENDHEADER } @@ -65,19 +69,117 @@ 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 (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 $c = $r->connection; + my %cache; + my $courseID = $ENV{'request.course.id'}; + my $classlist = &Apache::loncoursedata::DownloadClasslist($courseID,$cache{'ClasslistTimestamp'},$c); + &Apache::loncoursedata::ProcessClasslist(\%cache,$classlist,$courseID,$c); + my @all_students = split(':::',$cache{'NamesOfStudents'}); + my @active_students = (); + foreach my $student (@all_students) { + if ($cache{$student.':Status'} eq 'Active') { + push @active_students,$student; + } + } + my $what_to_print = ''; + my $i = 0; + foreach my $student (@active_students) { + $what_to_print .= ''; +# $what_to_print .= ''; + $i++; + } + $what_to_print .= '
'.$cache{$student.':fullname'}.'
'.$cache{$student.':fullname'}.'
'; + $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(< + + + + +Enter width of the page:
+ + @@ -85,8 +187,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,'