version 1.270, 2004/01/15 21:23:22
|
version 1.270.2.1, 2004/02/19 19:35:06
|
Line 647 sub path_to_problem {
|
Line 647 sub path_to_problem {
|
return '{\small\noindent\verb|'.$newurlp.'|\vskip 0 mm}'; |
return '{\small\noindent\verb|'.$newurlp.'|\vskip 0 mm}'; |
} |
} |
|
|
|
sub recalcto_mm { |
|
my $textwidth=shift; |
|
my $LaTeXwidth; |
|
if ($textwidth=~/(\d+\.?\d*)\s*cm/) { |
|
$LaTeXwidth = $1*10; |
|
} elsif ($textwidth=~/(\d+\.?\d*)\s*mm/) { |
|
$LaTeXwidth = $1; |
|
} elsif ($textwidth=~/(\d+\.?\d*)\s*in/) { |
|
$LaTeXwidth = $1*25.4; |
|
} |
|
$LaTeXwidth.=' mm'; |
|
return $LaTeXwidth; |
|
} |
|
|
sub output_data { |
sub output_data { |
my ($r,$helper,$rparmhash) = @_; |
my ($r,$helper,$rparmhash) = @_; |
my %parmhash = %$rparmhash; |
my %parmhash = %$rparmhash; |
Line 696 ENDPART
|
Line 710 ENDPART
|
} |
} |
my ($textwidth,$textheight,$oddoffset,$evenoffset) = &page_format($papersize,$laystyle,$numberofcolumns); |
my ($textwidth,$textheight,$oddoffset,$evenoffset) = &page_format($papersize,$laystyle,$numberofcolumns); |
my $assignment = $ENV{'form.assignment'}; |
my $assignment = $ENV{'form.assignment'}; |
my $LaTeXwidth; |
my $LaTeXwidth=&recalcto_mm($textwidth); |
if ($textwidth=~/(\d+\.?\d*)\s*cm/) { |
|
$LaTeXwidth = $1*10; |
|
} elsif ($textwidth=~/(\d+\.?\d*)\s*mm/) { |
|
$LaTeXwidth = $1; |
|
} elsif ($textwidth=~/(\d+\.?\d*)\s*in/) { |
|
$LaTeXwidth = $1*25.4; |
|
} |
|
$LaTeXwidth.=' mm'; |
|
|
|
if ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'current_document') { |
if ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'current_document') { |
#-- single document - problem, page, html, xml, ... |
#-- single document - problem, page, html, xml, ... |
my $currentURL; |
my $currentURL; |
Line 732 ENDPART
|
Line 737 ENDPART
|
} |
} |
my %form; |
my %form; |
$form{'grade_target'}='tex'; |
$form{'grade_target'}='tex'; |
$form{'textwidth'}=$LaTeXwidth; |
if ($helper->{'VARS'}->{'pagesize.width'}=~/\d+/ && |
|
$helper->{'VARS'}->{'pagesize.widthunit'}=~/\w+/) { |
|
$form{'textwidth'}=&recalcto_mm($helper->{'VARS'}->{'pagesize.width'}.' '.$helper->{'VARS'}->{'pagesize.widthunit'}); |
|
} else { |
|
$form{'textwidth'}=$LaTeXwidth; |
|
} |
$form{'problem_split'}=$parmhash{'problem_stream_switch'}; |
$form{'problem_split'}=$parmhash{'problem_stream_switch'}; |
$form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; |
$form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; |
if ($helper->{'VARS'}->{'curseed'}) { |
if ($helper->{'VARS'}->{'curseed'}) { |
Line 742 ENDPART
|
Line 752 ENDPART
|
&Apache::lonnet::appenv(%moreenv); |
&Apache::lonnet::appenv(%moreenv); |
&Apache::lonnet::delenv('form.counter'); |
&Apache::lonnet::delenv('form.counter'); |
&Apache::lonxml::init_counter(); |
&Apache::lonxml::init_counter(); |
$texversion=&Apache::lonnet::ssi($currentURL,%form); |
$texversion.=&Apache::lonnet::ssi($currentURL,%form); |
&Apache::lonnet::delenv('form.counter'); |
&Apache::lonnet::delenv('form.counter'); |
&Apache::lonnet::delenv('request.filename'); |
&Apache::lonnet::delenv('request.filename'); |
} |
} |
Line 797 ENDPART
|
Line 807 ENDPART
|
if ($helper->{'VARS'}->{'ANSWER_TYPE'} ne 'only') { |
if ($helper->{'VARS'}->{'ANSWER_TYPE'} ne 'only') { |
my %form; |
my %form; |
$form{'grade_target'}='tex'; |
$form{'grade_target'}='tex'; |
$form{'textwidth'}=$LaTeXwidth; |
if ($helper->{'VARS'}->{'pagesize.width'}=~/\d+/ && |
|
$helper->{'VARS'}->{'pagesize.widthunit'}=~/\w+/) { |
|
$form{'textwidth'}=&recalcto_mm($helper->{'VARS'}->{'pagesize.width'}.' '.$helper->{'VARS'}->{'pagesize.widthunit'}); |
|
} else { |
|
$form{'textwidth'}=$LaTeXwidth; |
|
} |
$form{'problem_split'}=$parmhash{'problem_stream_switch'}; |
$form{'problem_split'}=$parmhash{'problem_stream_switch'}; |
$form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; |
$form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; |
$form{'rndseed'}=$rndseed; |
$form{'rndseed'}=$rndseed; |
Line 843 ENDPART
|
Line 858 ENDPART
|
} elsif ($currentURL=~/\/smppg$/) { |
} elsif ($currentURL=~/\/smppg$/) { |
my %form; |
my %form; |
$form{'grade_target'}='tex'; |
$form{'grade_target'}='tex'; |
$form{'textwidth'}=$LaTeXwidth; |
if ($helper->{'VARS'}->{'pagesize.width'}=~/\d+/ && |
|
$helper->{'VARS'}->{'pagesize.widthunit'}=~/\w+/) { |
|
$form{'textwidth'}=&recalcto_mm($helper->{'VARS'}->{'pagesize.width'}.' '.$helper->{'VARS'}->{'pagesize.widthunit'}); |
|
} else { |
|
$form{'textwidth'}=$LaTeXwidth; |
|
} |
$form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; |
$form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; |
my $texversion=&Apache::lonnet::ssi($currentURL,%form); |
my $texversion=&Apache::lonnet::ssi($currentURL,%form); |
$result .= $texversion; |
$result .= $texversion; |
Line 865 ENDPART
|
Line 885 ENDPART
|
#-- produce an output string |
#-- produce an output string |
my %form=(); |
my %form=(); |
$form{'grade_target'}='tex'; |
$form{'grade_target'}='tex'; |
$form{'textwidth'}=$LaTeXwidth; |
if ($helper->{'VARS'}->{'pagesize.width'}=~/\d+/ && |
|
$helper->{'VARS'}->{'pagesize.widthunit'}=~/\w+/) { |
|
$form{'textwidth'}=&recalcto_mm($helper->{'VARS'}->{'pagesize.width'}.' '.$helper->{'VARS'}->{'pagesize.widthunit'}); |
|
} else { |
|
$form{'textwidth'}=$LaTeXwidth; |
|
} |
$form{'problem_split'}=$parmhash{'problem_stream_switch'}; |
$form{'problem_split'}=$parmhash{'problem_stream_switch'}; |
$form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; |
$form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; |
my $flag_latex_header_remove = 'NO'; |
my $flag_latex_header_remove = 'NO'; |
Line 958 ENDPART
|
Line 983 ENDPART
|
#loop over students |
#loop over students |
my $flag_latex_header_remove = 'NO'; |
my $flag_latex_header_remove = 'NO'; |
my %moreenv; |
my %moreenv; |
$moreenv{'form.textwidth'}=$LaTeXwidth; |
if ($helper->{'VARS'}->{'pagesize.width'}=~/\d+/ && |
|
$helper->{'VARS'}->{'pagesize.widthunit'}=~/\w+/) { |
|
$moreenv{'textwidth'}=&recalcto_mm($helper->{'VARS'}->{'pagesize.width'}.' '.$helper->{'VARS'}->{'pagesize.widthunit'}); |
|
} else { |
|
$moreenv{'textwidth'}=$LaTeXwidth; |
|
} |
&Apache::lonnet::appenv(%moreenv); |
&Apache::lonnet::appenv(%moreenv); |
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); |
foreach my $person (@students) { |
foreach my $person (@students) { |
Line 1044 ENDPART
|
Line 1074 ENDPART
|
if ($urlp=~/\//) { |
if ($urlp=~/\//) { |
my %form; |
my %form; |
$form{'grade_target'}='tex'; |
$form{'grade_target'}='tex'; |
$form{'textwidth'}=$LaTeXwidth; |
if ($helper->{'VARS'}->{'pagesize.width'}=~/\d+/ && |
|
$helper->{'VARS'}->{'pagesize.widthunit'}=~/\w+/) { |
|
$form{'textwidth'}=&recalcto_mm($helper->{'VARS'}->{'pagesize.width'}.' '.$helper->{'VARS'}->{'pagesize.widthunit'}); |
|
} else { |
|
$form{'textwidth'}=$LaTeXwidth; |
|
} |
$form{'rndseed'}=$rndseed; |
$form{'rndseed'}=$rndseed; |
if ($urlp =~ m|/home/([^/]+)/public_html|) { |
if ($urlp =~ m|/home/([^/]+)/public_html|) { |
$urlp =~ s|/home/([^/]*)/public_html|/~$1|; |
$urlp =~ s|/home/([^/]*)/public_html|/~$1|; |