--- loncom/interface/lonprintout.pm 2006/07/24 22:13:58 1.467 +++ loncom/interface/lonprintout.pm 2006/08/02 20:49:55 1.474 @@ -1,7 +1,8 @@ +# # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.467 2006/07/24 22:13:58 foxr Exp $ +# $Id: lonprintout.pm,v 1.474 2006/08/02 20:49:55 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -892,7 +893,7 @@ sub IndexCreation { sub print_latex_header { my $mode=shift; - my $output='\documentclass[letterpaper,twoside]{article}'; + my $output='\documentclass[letterpaper,twoside]{article}\raggedbottom'; if (($mode eq 'batchmode') || (!$perm{'pav'})) { $output.='\batchmode'; } @@ -2317,7 +2318,7 @@ ALL_PROBLEMS if ($helper->{VARS}->{'assignment'}) { push @{$printChoices}, [&mt("Selected Problems from folder [_1] for selected students",$sequenceTitle), 'problems_for_students', 'CHOOSE_STUDENTS']; - push @{$printChoices}, [&mt("Selected Problems from folder [_1] for anonymous students",$sequenceTitle), 'problems_for_anon', 'CHOOSE_ANON1']; + push @{$printChoices}, [&mt("Selected Problems from folder [_1] for CODEd assignments",$sequenceTitle), 'problems_for_anon', 'CHOOSE_ANON1']; } # resource_selector will hold a few states that: @@ -2404,7 +2405,7 @@ CHOOSE_STUDENTS } if (%codes_to_print) { $code_selection .=' - Choose single code from list + Choose single CODE from list: @@ -2412,7 +2413,7 @@ CHOOSE_STUDENTS push(@{$state->{CHOICES}},@{$helper->{DATA}{ALL_CODE_CHOICES}}); -
+ '.$/; } @@ -2432,9 +2433,12 @@ CHOOSE_STUDENTS $codechoice='Default'; } &Apache::lonxml::xmlparse($r, 'helper', < + SELECT_PROBLEMS -
Number of anonymous assignments to print: +

Fill out one of the forms below

+


+

Generate new CODEd Assignments

+
Number of CODEd assignments to print: if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) < 1) && @@ -2456,9 +2460,10 @@ CHOOSE_STUDENTS $codechoice -

-
- Enter a CODE to print: +
+
+

Print a Specific CODE


+
Enter a CODE to print: if(!\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'} && @@ -2471,17 +2476,16 @@ CHOOSE_STUDENTS } -

+
$code_selection - - - Reprint a set of saved CODEs: +
+

Reprint a Set of Saved CODEs

+ Select saved CODEs: $namechoice
-
$resource_selector CHOOSE_ANON1 @@ -2489,7 +2493,7 @@ CHOOSE_ANON1 if ($helper->{VARS}->{'assignment'}) { push @{$printChoices}, [&mt("Selected Resources from folder [_1] for selected students",$sequenceTitle), 'resources_for_students', 'CHOOSE_STUDENTS1']; - push @{$printChoices}, [&mt("Selected Resources from folder [_1] for anonymous students",$sequenceTitle), 'resources_for_anon', 'CHOOSE_ANON2']; + push @{$printChoices}, [&mt("Selected Resources from folder [_1] for CODEd assignments",$sequenceTitle), 'resources_for_anon', 'CHOOSE_ANON2']; } @@ -2540,9 +2544,12 @@ RESOURCE_SELECTOR CHOOSE_STUDENTS1 &Apache::lonxml::xmlparse($r, 'helper', < + SELECT_RESOURCES -
Number of anonymous assignments to print: +

Fill out one of the forms below

+


+

Generate new CODEd Assignments

+
Number of CODEd assignments to print: if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) < 1) && @@ -2564,9 +2571,9 @@ CHOOSE_STUDENTS1 $codechoice -

-
- Enter a CODE to print: +
+

Print a Specific CODE


+
Enter a CODE to print: if(!\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'} && @@ -2579,15 +2586,16 @@ CHOOSE_STUDENTS1 } -

+
$code_selection - Reprint a set of saved CODEs: +
+

Reprint a Set of Saved CODEs

+ Select saved CODEs: $namechoice
-
$resource_selector CHOOSE_ANON2 @@ -3026,9 +3034,16 @@ sub render { } } - $result .= <How should each column be formatted?

@@ -3070,7 +3085,7 @@ ELEMENTHTML return $result; } -# If the user didn't select 1 column, skip this state. + sub preprocess { my $self = shift; my $helper = Apache::lonhelper::getHelper(); @@ -3103,9 +3118,7 @@ sub preprocess { foreach my $dim ('width', 'height', 'lmargin') { my ($value, $units) = split(/ /, $size{$dim}); - - &Apache::lonnet::logthis("$dim : $value : $units"); - + $helper->{VARS}->{"$var.".$dim} = $value; $helper->{VARS}->{"$var.".$dim.'unit'} = $units; @@ -3145,6 +3158,14 @@ sub postprocess { } if ($lmargin !~ /^-?[0-9]*(\.[0-9]*)?$/) { $error .= "Invalid left margin; please type only a number.
\n"; + } else { + # Adjust for LaTeX 1.0 inch margin: + + if ($env{"form.${var}.lmarginunit"} eq "in") { + $helper->{VARS}->{$var.'.lmargin'} = $lmargin - 1; + } else { + $helper->{VARS}->{$var.'.lmargin'} = $lmargin - 2.54; + } } if (!$error) {