--- loncom/interface/lonprintout.pm 2005/02/09 15:56:45 1.359 +++ loncom/interface/lonprintout.pm 2005/02/17 23:19:44 1.362 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.359 2005/02/09 15:56:45 www Exp $ +# $Id: lonprintout.pm,v 1.362 2005/02/17 23:19:44 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -42,9 +42,6 @@ use Apache::lonratedt; use POSIX qw(strftime); use Apache::lonlocal; -my $LaTeXwidth = 0; - - # Compare two students by name. The students are in the form # returned by the helper: # user:domain:section:last, first:status @@ -726,7 +723,7 @@ sub path_to_problem { my $newurlp = ''; $colwidth=~s/\s*mm\s*$//; #characters average about 2 mm in width - if (length($urlp)*2 > $LaTeXwidth) { + if (length($urlp)*2 > $colwidth) { my @elements = split '/',$urlp; my $curlength=0; foreach my $element (@elements) { @@ -787,13 +784,12 @@ sub unsupported { sub output_data { my ($r,$helper,$rparmhash) = @_; my %parmhash = %$rparmhash; + my $html=&Apache::lonxml::xmlbegin(); my $bodytag=&Apache::loncommon::bodytag('Preparing Printout'); $r->print(< - - LON-CAPA output for printing $bodytag Please stand by while processing your print request, this may take some time ... ENDPART - # Common settings for the %form has: - # In some cases these settings get overriddent by specific cases, but the - # settings are common enough to make it worthwhile factoring them out - # here. - # - my %form; - $form{'grade_target'} = 'tex'; - $form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); - my $format_from_helper = $helper->{'VARS'}->{'FORMAT'}; my ($result,$selectionmade) = ('',''); my $number_of_columns = 1; #used only for pages to determine the width of the cell @@ -848,6 +834,15 @@ ENDPART my $LaTeXwidth=&recalcto_mm($textwidth); my @print_array=(); my @student_names=(); + + # Common settings for the %form has: + # In some cases these settings get overriddent by specific cases, but the + # settings are common enough to make it worthwhile factoring them out + # here. + # + my %form; + $form{'grade_target'} = 'tex'; + $form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); if ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'current_document') { #-- single document - problem, page, html, xml, ... @@ -1172,7 +1167,8 @@ ENDPART my ($output,$fullname)=&print_resources($r,$helper, $person,$type, \%moreenv,\@master_seq, - $flag_latex_header_remove); + $flag_latex_header_remove, + $LaTeXwidth); $print_array[$i].=$output; $student_names[$i].=$person.':'.$fullname.'_END_'; &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,&mt('last student').' '.$fullname); @@ -1223,7 +1219,8 @@ ENDPART $moreenv{'CODE'}=&num_to_letters($code); my ($output,$fullname)= &print_resources($r,$helper,'anonymous',$type,\%moreenv, - \@master_seq,$flag_latex_header_remove); + \@master_seq,$flag_latex_header_remove, + $LaTeXwidth); $print_array[$file_num].=$output; &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, &mt('last assignment').' '.$fullname); @@ -1420,7 +1417,8 @@ sub get_CODE { } sub print_resources { - my ($r,$helper,$person,$type,$moreenv,$master_seq,$remove_latex_header)=@_; + my ($r,$helper,$person,$type,$moreenv,$master_seq,$remove_latex_header, + $LaTeXwidth)=@_; my $current_output = ''; my ($username,$userdomain,$usersection) = split /:/,$person; my $fullname = &get_name($username,$userdomain); @@ -1839,10 +1837,22 @@ CHOOSE_STUDENTS &Apache::lonxml::xmlparse($r, 'helper', < PAGESIZE -
Number of anonymous assignments to print?
- -
Names to store the CODEs under for later:
+
+
Number of anonymous assignments to print? + + + if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) < 1) && + !\$helper->{'VARS'}{'REUSE_OLD_CODES'}) { + return "You need to specify the number of assignments to print"; + } + return undef; + + +
+ Names to store the CODEs under for later: + +

Reprint a set of saved CODEs: @@ -1895,10 +1905,21 @@ CHOOSE_STUDENTS1 &Apache::lonxml::xmlparse($r, 'helper', < PAGESIZE -
Number of anonymous assignments to print?
- -
Names to store the CODEs under for later:
+
Number of anonymous assignments to print? + + + if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) < 1) && + !\$helper->{'VARS'}{'REUSE_OLD_CODES'}) { + return "You need to specify the number of assignments to print"; + } + return undef; + + +
+ Names to store the CODEs under for later: + +

Reprint a set of saved CODEs: