--- loncom/interface/lonprintout.pm 2004/09/29 06:07:36 1.316.2.4
+++ loncom/interface/lonprintout.pm 2004/07/28 19:07:16 1.318
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.316.2.4 2004/09/29 06:07:36 albertel Exp $
+# $Id: lonprintout.pm,v 1.318 2004/07/28 19:07:16 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -629,21 +629,24 @@ sub print_latex_header {
}
sub path_to_problem {
- my ($urlp,$colwidth)=@_;
+ my ($urlp,$LaTeXwidth)=@_;
my $newurlp = '';
- $colwidth=~s/\s*mm\s*$//;
-#characters average about 2 mm in width
- if (length($urlp)*2 > $LaTeXwidth) {
- my @elements = split '/',$urlp;
- my $curlength=0;
- foreach my $element (@elements) {
- if ($curlength+(length($element)*2) > $colwidth) {
- $newurlp .= '|\vskip -1 mm \noindent \verb|';
- $curlength=0;
- } else {
- $curlength+=length($element)*2;
+ $LaTeXwidth=~s/\s*mm\s*$//;
+ my $HowMany = length($urlp)*2;
+ if ($HowMany > $LaTeXwidth) {
+ my @temporrary = split '/',$urlp;
+ my $HowManyNew = 0;
+ for (my $ii=0;$ii<=$#temporrary;$ii++) {
+ if ($temporrary[$ii] ne '') {
+ $HowManyNew += length($temporrary[$ii])*2;
+ if ($HowManyNew < $LaTeXwidth ) {
+ $newurlp .= '/'.$temporrary[$ii];
+ } else {
+ $HowManyNew = 0;
+ $newurlp .= '|\vskip -1 mm \noindent \verb|';
+ $ii--;
+ }
}
- $newurlp.='/'.$element;
}
} else {
$newurlp=$urlp;
@@ -1007,7 +1010,6 @@ ENDPART
$result .= $texversion;
$flag_latex_header_remove = 'YES';
}
- if (&Apache::loncommon::connection_aborted($r)) { last; }
}
&Apache::lonnet::delenv('form.counter');
if ($flag_page_in_sequence eq 'YES') {$result =~ s/\\usepackage{calc}/\\usepackage{calc}\\usepackage{longtable}/;}
@@ -1032,11 +1034,10 @@ ENDPART
#loop over students
my $flag_latex_header_remove = 'NO';
my %moreenv;
- $moreenv{'instructor_comments'}='hide';
$moreenv{'textwidth'}=&get_textwidth($helper,$LaTeXwidth);
$moreenv{'print_discussions'}=$helper->{'VARS'}->{'PRINT_DISCUSSIONS'};
if ($helper->{'VARS'}->{'PRINT_DISCUSSIONS'} eq 'yes') {$moreenv{'problem_split'}='yes';}
- my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Print Status','Class Print Status',$#students+1);
+ my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Print Status','Class Print Status',$#students+1,'inline','75');
my $student_counter=-1;
foreach my $person (@students) {
my $duefile="/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.due";
@@ -1051,7 +1052,6 @@ ENDPART
$student_names[$i].=$person.':'.$fullname.'_END_';
&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,&mt('last student').' '.$fullname);
$flag_latex_header_remove = 'YES';
- if (&Apache::loncommon::connection_aborted($r)) { last; }
}
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
$result .= $print_array[0].' \end{document}';
@@ -1101,7 +1101,6 @@ ENDPART
&mt('last assignment').' '.$fullname);
$flag_latex_header_remove = 'YES';
$count++;
- if (&Apache::loncommon::connection_aborted($r)) { last; }
}
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
$result .= $print_array[0].' \end{document}';
@@ -1264,7 +1263,9 @@ ENDPART
'cgi.'.$identifier.'backref' => $URLback,);
$r->print(<
+Continue