--- loncom/interface/lonprintout.pm 2002/09/06 17:46:13 1.56 +++ 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.56 2002/09/06 17:46:13 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.57 2002/09/09 19:27:42 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -45,7 +45,6 @@ use Apache::lonxml; use Apache::lonnet; use Apache::loncommon; use Apache::inputtags; -use Apache::loncoursedata; use Apache::grades; use Apache::edit; use Apache::File(); @@ -62,7 +61,6 @@ sub headerform {
$ENV{'form.postdata'}

-

What do you want to print? Make a choice.


ENDHEADER } @@ -70,6 +68,7 @@ ENDHEADER sub menu_for_output { my $r = shift; $r->print(<What do you want to print? Make a choice.
Current document @@ -109,13 +108,6 @@ ENDMENUOUT4 Number of columns: @@ -135,28 +127,72 @@ sub additional_class_menu {

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 %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 my $student (@active_students) { - $what_to_print .= ''.$cache{$student.':fullname'}.''; -# $what_to_print .= ''.$cache{$student.':fullname'}.''; - $i++; + 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++; + } } - $what_to_print .= ''; $r->print(< +
@@ -177,7 +213,10 @@ sub additional_print_menu { -Enter width of the page:
+Define page layout parameters:
+Width:
+Height:
+Left margin:
@@ -339,7 +378,7 @@ ENDPART #loop over students foreach my $person (@students) { my $current_output = ''; - my ($username,$userdomain) = split /:/,$person; + my ($usersection,$username,$userdomain) = split /:/,$person; my $fullname = &Apache::grades::get_fullname($username,$userdomain); #goes through all resources, checks if they are available for current student, and produces output foreach my $curres (@master_seq) {