version 1.177, 2003/05/15 19:11:26
|
version 1.184, 2003/05/27 19:00:35
|
Line 500 sub latex_corrections {
|
Line 500 sub latex_corrections {
|
|
|
|
|
sub output_data { |
sub output_data { |
my ($r,$helper) = @_; |
my ($r,$helper,$rparmhash) = @_; |
|
my %parmhash = %$rparmhash; |
$r->print(<<ENDPART); |
$r->print(<<ENDPART); |
<html> |
<html> |
<head> |
<head> |
Line 599 ENDPART
|
Line 600 ENDPART
|
$form{'grade_target'}='tex'; |
$form{'grade_target'}='tex'; |
$form{'textwidth'}=$LaTeXwidth; |
$form{'textwidth'}=$LaTeXwidth; |
$form{'symb'}=$master_seq[$i]; |
$form{'symb'}=$master_seq[$i]; |
|
$form{'problem_split'}=$parmhash{'problem_stream_switch'}; |
#&Apache::lonnet::logthis("Trying to get $urlp with symb $master_seq[$i]"); |
#&Apache::lonnet::logthis("Trying to get $urlp with symb $master_seq[$i]"); |
my $texversion=&Apache::lonnet::ssi($urlp,%form); |
my $texversion=&Apache::lonnet::ssi($urlp,%form); |
if ($urlp=~/\.page$/) { |
if ($urlp=~/\.page$/) { |
Line 667 ENDPART
|
Line 669 ENDPART
|
} |
} |
my $courseidinfo = $ENV{'course.'.$ENV{'request.course.id'}.'.description'}; |
my $courseidinfo = $ENV{'course.'.$ENV{'request.course.id'}.'.description'}; |
if ($current_output=~/\\documentclass/) { |
if ($current_output=~/\\documentclass/) { |
$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm}\\usepackage{fancyhdr}\\pagestyle{fancy}\\rhead{}\\chead{} \\begin{document}\\noindent\\lhead{\\textit{\\textbf{$fullname}} - $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}\\vskip 3 mm /; |
$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\lhead{\\textit{\\textbf{$fullname}} - $courseidinfo \\hfill \\thepage \\\\ \\textit{$helper->{VARS}->{'assignment'}}}\\vskip 3 mm /; |
} else { |
} else { |
my $blanspages = ''; |
my $blanspages = ''; |
for (my $j=0;$j<$helper->{'VARS'}->{'EMPTY_PAGES'};$j++) {$blanspages.='\clearpage\strut\clearpage';} |
for (my $j=0;$j<$helper->{'VARS'}->{'EMPTY_PAGES'};$j++) {$blanspages.='\clearpage\strut\clearpage';} |
$current_output = '\strut\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License }\\newpage \\vskip 3mm'.$blanspages.'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\lhead{\\textit{\\textbf{'.$fullname.'}} - '.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$assignment.'}}\hskip 1.4in } \vskip 5 mm '.$current_output; |
$current_output = '\strut\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License }\\newpage '.$blanspages.'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\lhead{\\textit{\\textbf{'.$fullname.'}} - '.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$helper->{VARS}->{'assignment'}.'}}} \vskip -5 mm '.$current_output; |
} |
} |
$result .= $current_output; |
$result .= $current_output; |
&Apache::lonnet::delenv('form.counter'); |
&Apache::lonnet::delenv('form.counter'); |
Line 797 sub handler {
|
Line 799 sub handler {
|
# $r->print(' '.$key.'->'.$helper->{'VARS'}->{$key}.'<-<br />'); |
# $r->print(' '.$key.'->'.$helper->{'VARS'}->{$key}.'<-<br />'); |
# } |
# } |
# return OK; |
# return OK; |
|
|
&output_data($r,$helper); |
my %parmhash=&Apache::lonnet::coursedescription($ENV{'request.course.id'}); |
|
# $r->print('<br /> START '.$ENV{'request.course.fn'}.' FINISH <br />'); |
|
# my $key; |
|
# foreach $key (keys %parmhash) { |
|
# $r->print(' '.$key.'->'.$parmhash{$key}.'<-<br />'); |
|
# } |
|
# return OK; |
|
|
|
|
|
&output_data($r,$helper,\%parmhash); |
return OK; |
return OK; |
} |
} |
|
|
Line 842 sub printHelper {
|
Line 853 sub printHelper {
|
$helper->declareVar('postdata'); |
$helper->declareVar('postdata'); |
$helper->declareVar('filename'); |
$helper->declareVar('filename'); |
$helper->declareVar('construction'); |
$helper->declareVar('construction'); |
|
$helper->declareVar('assignment'); |
|
|
# This will persistently load in the data we want from the |
# This will persistently load in the data we want from the |
# very first screen. |
# very first screen. |
Line 871 sub printHelper {
|
Line 883 sub printHelper {
|
} |
} |
|
|
my ($resourceTitle,$sequenceTitle,$mapTitle) = &details_for_menu; |
my ($resourceTitle,$sequenceTitle,$mapTitle) = &details_for_menu; |
$helper->{VARS}->{'assignment'} = $sequenceTitle; |
if ($sequenceTitle ne '') {$helper->{VARS}->{'assignment'}=$sequenceTitle;} |
|
|
|
|
# Extract map |
# Extract map |
Line 904 sub printHelper {
|
Line 916 sub printHelper {
|
$subdir='/home/httpd/html/res/'.$subdir; |
$subdir='/home/httpd/html/res/'.$subdir; |
} |
} |
|
|
|
|
# What can be printed is a very dynamic decision based on |
# What can be printed is a very dynamic decision based on |
# lots of factors. So we need to dynamically build this list. |
# lots of factors. So we need to dynamically build this list. |
# To prevent security leaks, states are only added to the wizard |
# To prevent security leaks, states are only added to the wizard |
Line 992 HELPERFRAGMENT
|
Line 1003 HELPERFRAGMENT
|
</resource> |
</resource> |
<message><br /><big><i><b>How should the results be printed?</b></i></big><br /></message> |
<message><br /><big><i><b>How should the results be printed?</b></i></big><br /></message> |
<choices variable="EMPTY_PAGES"> |
<choices variable="EMPTY_PAGES"> |
<choice computer='0'>Print students assignments without separations (as uniform flow)</choice> |
<choice computer='0'>Start each student's assignment on a new page (add a pagefeed after each assignment)</choice> |
<choice computer='1'>Start student assignment from new page (add pagefeed after each student)</choice> |
<choice computer='1'>Add one empty page after each student's assignment</choice> |
<choice computer='2'>Add one emty page after each student assignment</choice> |
<choice computer='2'>Add two empty pages after each student's assignment</choice> |
<choice computer='3'>Add two emty page after each student assignment</choice> |
|
</choices> |
</choices> |
</state> |
</state> |
CHOOSE_STUDENTS |
CHOOSE_STUDENTS |