--- loncom/interface/lonprintout.pm 2004/11/13 08:16:09 1.334
+++ loncom/interface/lonprintout.pm 2004/11/16 21:59:48 1.338
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.334 2004/11/13 08:16:09 albertel Exp $
+# $Id: lonprintout.pm,v 1.338 2004/11/16 21:59:48 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -374,11 +374,11 @@ sub character_chart {
my %page_formats=
('letter' => {
'book' => {
- '1' => [ '7.1 in','10.2 in', '-0.57 in','-0.57 in','0 in'],
- '2' => ['3.66 in','10.2 in', '-0.57 in','-0.57 in','0 in']
+ '1' => [ '7.1 in','10.2 in', '-0.57 in','-0.57 in','1 cm'],
+ '2' => ['3.66 in','10.2 in', '-0.57 in','-0.57 in','1 cm']
},
'album' => {
- '1' => [ '8.8 in', '6.8 in','-40 pt in', '-60 pt','0 in'],
+ '1' => [ '8.8 in', '6.8 in','-40 pt in', '-60 pt','1 cm'],
'2' => [ '4.4 in', '6.8 in','-0.5 in', '-1.5 in','3.5 in']
},
},
@@ -551,9 +551,11 @@ sub page_cleanup {
sub details_for_menu {
-
- my $name_of_resourse = &Apache::lonnet::gettitle($ENV{'form.postdata'});
- my $symbolic = &Apache::lonnet::symbread($ENV{'form.postdata'});
+ my ($helper)=@_;
+ my $postdata=$ENV{'form.postdata'};
+ if (!$postdata) { $postdata=$helper->{VARS}{'postdata'}; }
+ my $name_of_resource = &Apache::lonnet::gettitle($postdata);
+ my $symbolic = &Apache::lonnet::symbread($postdata);
my ($map,$id,$resource)=&Apache::lonnet::decode_symb($symbolic);
$map=&Apache::lonnet::clutter($map);
my $name_of_sequence = &Apache::lonnet::gettitle($map);
@@ -566,8 +568,7 @@ sub details_for_menu {
$ENV{'request.course.uri'} =~ m|([^/]+)$|;
$name_of_map = $1;
}
- return ($name_of_resourse,$name_of_sequence,$name_of_map);
-
+ return ($name_of_resource,$name_of_sequence,$name_of_map);
}
@@ -1095,20 +1096,13 @@ ENDPART
my $num_todo=$helper->{'VARS'}->{'NUMBER_TO_PRINT_TOTAL'};
my $code_name=$helper->{'VARS'}->{'ANON_CODE_STORAGE_NAME'};
my $old_name=$helper->{'VARS'}->{'REUSE_OLD_CODES'};
- my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'};
- my ($type) = split(/_/,$helper->{'VARS'}->{'PRINT_TYPE'});
- my $number_per_page=$helper->{'VARS'}->{'NUMBER_TO_PRINT'};
- if ($number_per_page eq '0' || $number_per_page eq 'all') {
- $number_per_page=$num_todo;
- }
- my $flag_latex_header_remove = 'NO';
my %moreenv = ('textwidth' => &get_textwidth($helper,$LaTeXwidth));
- my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Print Status','Class Print Status',$num_todo,'inline','75');
my $seed=time+($$<<16)+($$);
my @allcodes;
if ($old_name) {
my %result=&Apache::lonnet::get('CODEs',[$old_name],$cdom,$cnum);
@allcodes=split(',',$result{$old_name});
+ $num_todo=scalar(@allcodes);
} else {
my %allcodes;
srand($seed);
@@ -1122,6 +1116,14 @@ ENDPART
}
@allcodes=keys(%allcodes);
}
+ my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'};
+ my ($type) = split(/_/,$helper->{'VARS'}->{'PRINT_TYPE'});
+ my $number_per_page=$helper->{'VARS'}->{'NUMBER_TO_PRINT'};
+ if ($number_per_page eq '0' || $number_per_page eq 'all') {
+ $number_per_page=$num_todo;
+ }
+ my $flag_latex_header_remove = 'NO';
+ my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Print Status','Class Print Status',$num_todo,'inline','75');
my $count=0;
foreach my $code (sort(@allcodes)) {
my $file_num=int($count/$number_per_page);
@@ -1532,7 +1534,7 @@ sub printHelper {
}
- my ($resourceTitle,$sequenceTitle,$mapTitle) = &details_for_menu;
+ my ($resourceTitle,$sequenceTitle,$mapTitle) = &details_for_menu($helper);
if ($sequenceTitle ne '') {$helper->{VARS}->{'assignment'}=$sequenceTitle;}
@@ -1701,7 +1703,7 @@ CHOOSE_STUDENTS
my $cnum = $ENV{'course.'.$ENV{'request.course.id'}.'.num'};
my @names=&Apache::lonnet::getkeys('CODEs',$cdom,$cnum);
my $namechoice='';
- foreach my $name (@names) {
+ foreach my $name (sort {uc($a) cmp uc($b)} @names) {
if ($name =~ /^error: 2 /) { next; }
$namechoice.=''.$name.'';
}