version 1.437, 2006/04/18 10:03:45
|
version 1.456, 2006/07/07 21:55:05
|
Line 42 use Apache::lonratedt;
|
Line 42 use Apache::lonratedt;
|
use POSIX qw(strftime); |
use POSIX qw(strftime); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Carp; |
use Carp; |
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA; |
|
|
my %perm; |
my %perm; |
|
my %parmhash; |
|
|
|
|
|
# Format a header according to a format. |
|
# |
|
|
|
# Substitutions: |
|
# %a - Assignment name. |
|
# %c - Course name. |
|
# %n - Student name. |
|
# |
|
sub format_page_header { |
|
my ($format, $assignment, $course, $student) = @_; |
|
|
|
# Default format? |
|
|
|
if ($format eq '') { |
|
$format = "\\textbf{$student} $course \\hfill \\thepage \\\\ \\textit{$assignment}"; |
|
|
|
} else { |
|
$format =~ s/%a/$assignment/g; |
|
$format =~ s/%c/$course/g; |
|
$format =~ s/%n/$student/g; |
|
} |
|
|
|
|
|
return $format; |
|
|
|
} |
|
|
# |
# |
# Convert a numeric code to letters |
# Convert a numeric code to letters |
Line 700 sub get_name {
|
Line 731 sub get_name {
|
if (!defined($udom)) { $udom=$env{'user.domain'}; } |
if (!defined($udom)) { $udom=$env{'user.domain'}; } |
my $plainname=&Apache::loncommon::plainname($uname,$udom); |
my $plainname=&Apache::loncommon::plainname($uname,$udom); |
if ($plainname=~/^\s*$/) { $plainname=$uname.'@'.$udom; } |
if ($plainname=~/^\s*$/) { $plainname=$uname.'@'.$udom; } |
$plainname=&Apache::lonxml::latex_special_symbols($plainname,'header'); |
$plainname=&Apache::lonxml::latex_special_symbols($plainname,'header'); |
return $plainname; |
return $plainname; |
} |
} |
|
|
sub get_course { |
sub get_course { |
my $courseidinfo; |
my $courseidinfo; |
if (defined($env{'request.course.id'})) { |
if (defined($env{'request.course.id'})) { |
$courseidinfo = &Apache::lonxml::latex_special_symbols(&Apache::lonnet::unescape($env{'course.'.$env{'request.course.id'}.'.description'}),'header'); |
$courseidinfo = &Apache::lonxml::latex_special_symbols(&unescape($env{'course.'.$env{'request.course.id'}.'.description'}),'header'); |
} |
} |
return $courseidinfo; |
return $courseidinfo; |
} |
} |
Line 715 sub get_course {
|
Line 746 sub get_course {
|
sub page_format_transformation { |
sub page_format_transformation { |
my ($papersize,$layout,$numberofcolumns,$choice,$text,$assignment,$tableofcontents,$indexlist,$selectionmade) = @_; |
my ($papersize,$layout,$numberofcolumns,$choice,$text,$assignment,$tableofcontents,$indexlist,$selectionmade) = @_; |
my ($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin); |
my ($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin); |
|
|
if ($selectionmade eq '4') { |
if ($selectionmade eq '4') { |
$assignment='Problems from the Whole Course'; |
$assignment='Problems from the Whole Course'; |
} else { |
} else { |
$assignment=&Apache::lonxml::latex_special_symbols($assignment,'header'); |
$assignment=&Apache::lonxml::latex_special_symbols($assignment,'header'); |
} |
} |
($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin) = &page_format($papersize,$layout,$numberofcolumns,$topmargin); |
($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin) = &page_format($papersize,$layout,$numberofcolumns,$topmargin); |
|
|
|
|
my $name = &get_name(); |
my $name = &get_name(); |
my $courseidinfo = &get_course(); |
my $courseidinfo = &get_course(); |
if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo } |
if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo } |
|
my $header_text = $parmhash{'print_header_format'}; |
|
$header_text = &format_page_header($header_text, $assignment, |
|
$courseidinfo, $name); |
my $topmargintoinsert = ''; |
my $topmargintoinsert = ''; |
if ($topmargin ne '0') {$topmargintoinsert='\setlength{\topmargin}{'.$topmargin.'}';} |
if ($topmargin ne '0') {$topmargintoinsert='\setlength{\topmargin}{'.$topmargin.'}';} |
my $fancypagestatement=''; |
my $fancypagestatement=''; |
if ($numberofcolumns eq '2') { |
if ($numberofcolumns eq '2') { |
$fancypagestatement="\\fancyhead{}\\fancyhead[LO]{\\textbf{$name} $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}"; |
$fancypagestatement="\\fancyhead{}\\fancyhead[LO]{$header_text}"; |
} else { |
} else { |
$fancypagestatement="\\rhead{}\\chead{}\\lhead{\\textbf{$name} $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}"; |
$fancypagestatement="\\rhead{}\\chead{}\\lhead{$header_text}"; |
} |
} |
if ($layout eq 'album') { |
if ($layout eq 'album') { |
$text =~ s/\\begin{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}$topmargintoinsert\n\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\n\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\usepackage{fancyhdr}\\addtolength{\\headheight}{\\baselineskip}\n\\pagestyle{fancy}$fancypagestatement\\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1}\n /; |
$text =~ s/\\begin{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}$topmargintoinsert\n\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\n\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\usepackage{fancyhdr}\\addtolength{\\headheight}{\\baselineskip}\n\\pagestyle{fancy}$fancypagestatement\\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1}\n /; |
Line 1119 ENDPART
|
Line 1156 ENDPART
|
$selectionmade = 1; |
$selectionmade = 1; |
if ($cleanURL!~m|^/adm/| |
if ($cleanURL!~m|^/adm/| |
&& $cleanURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { |
&& $cleanURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { |
if ($cleanURL =~/\.page/) { |
|
} |
|
my $rndseed=time; |
my $rndseed=time; |
my $texversion=''; |
my $texversion=''; |
if ($helper->{'VARS'}->{'ANSWER_TYPE'} ne 'only') { |
if ($helper->{'VARS'}->{'ANSWER_TYPE'} ne 'only') { |
Line 1321 ENDPART
|
Line 1356 ENDPART
|
my $texversion=''; |
my $texversion=''; |
if ($urlp!~m|^/adm/| |
if ($urlp!~m|^/adm/| |
&& $urlp=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { |
&& $urlp=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { |
if ($urlp =!/\.page/) { |
|
} |
|
$resources_printed .= $urlp.':'; |
$resources_printed .= $urlp.':'; |
|
|
&Apache::lonxml::remember_problem_counter(); |
&Apache::lonxml::remember_problem_counter(); |
|
|
$texversion.=&Apache::lonnet::ssi($urlp,%form); |
$texversion.=&Apache::lonnet::ssi($urlp,%form); |
if ($urlp=~/\.page$/) { |
if ($urlp=~/\.page$/) { |
($texversion,my $number_of_columns_page) = &page_cleanup($texversion); |
($texversion,my $number_of_columns_page) = &page_cleanup($texversion); |
Line 1374 ENDPART
|
Line 1406 ENDPART
|
my $courseidinfo = &get_course(); |
my $courseidinfo = &get_course(); |
if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo } |
if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo } |
$prevassignment=$assignment; |
$prevassignment=$assignment; |
|
my $header_text = $parmhash{'print_header_format'}; |
|
$header_text = &format_page_header($header_text, |
|
$assignment, |
|
$courseidinfo, |
|
$name); |
if ($numberofcolumns eq '1') { |
if ($numberofcolumns eq '1') { |
$result .='\newpage \noindent\parbox{\minipagewidth}{\noindent\\lhead{\\textit{\\textbf{'.$name.'}}'.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$assignment.'}}} \vskip 5 mm '; |
$result .='\newpage \noindent\parbox{\minipagewidth}{\noindent\\lhead{'.$header_text.'}} \vskip 5 mm '; |
} else { |
} else { |
$result .='\newpage \noindent\parbox{\minipagewidth}{\noindent\\fancyhead[LO]{\\textit{\\textbf{'.$name.'}}'.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$assignment.'}}} \vskip 5 mm '; |
$result .='\newpage \noindent\parbox{\minipagewidth}{\noindent\\fancyhead[LO]{'.$header_text.'}} \vskip 5 mm '; |
} |
} |
} |
} |
$result .= $texversion; |
$result .= $texversion; |
Line 1564 ENDPART
|
Line 1601 ENDPART
|
} |
} |
my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'}; |
my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'}; |
my ($type) = split(/_/,$helper->{'VARS'}->{'PRINT_TYPE'}); |
my ($type) = split(/_/,$helper->{'VARS'}->{'PRINT_TYPE'}); |
|
&adjust_number_to_print($helper); |
my $number_per_page=$helper->{'VARS'}->{'NUMBER_TO_PRINT'}; |
my $number_per_page=$helper->{'VARS'}->{'NUMBER_TO_PRINT'}; |
if ($number_per_page eq '0' || $number_per_page eq 'all') { |
if ($number_per_page eq '0' || $number_per_page eq 'all') { |
$number_per_page=$num_todo; |
$number_per_page=$num_todo; |
Line 1675 ENDPART
|
Line 1713 ENDPART
|
$selectionmade, |
$selectionmade, |
$helper->{'VARS'}->{'ANSWER_TYPE'}); |
$helper->{'VARS'}->{'ANSWER_TYPE'}); |
} |
} |
#changes page's parameters for the one column output |
|
if ($numberofcolumns == 1) { |
if ($numberofcolumns == 1) { |
$result =~ s/\\textwidth\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\textwidth= $helper->{'VARS'}->{'pagesize.width'} $helper->{'VARS'}->{'pagesize.widthunit'} /; |
$result =~ s/\\textwidth\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\textwidth= $helper->{'VARS'}->{'pagesize.width'} $helper->{'VARS'}->{'pagesize.widthunit'} /; |
$result =~ s/\\textheight\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\textheight $helper->{'VARS'}->{'pagesize.height'} $helper->{'VARS'}->{'pagesize.heightunit'} /; |
$result =~ s/\\textheight\s*=?\s*-?\d*\.?\d*\s*(cm|mm|in)/\\textheight $helper->{'VARS'}->{'pagesize.height'} $helper->{'VARS'}->{'pagesize.heightunit'} /; |
$result =~ s/\\evensidemargin\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\evensidemargin= $helper->{'VARS'}->{'pagesize.lmargin'} $helper->{'VARS'}->{'pagesize.lmarginunit'} /; |
$result =~ s/\\evensidemargin\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\evensidemargin= $helper->{'VARS'}->{'pagesize.lmargin'} $helper->{'VARS'}->{'pagesize.lmarginunit'} /; |
$result =~ s/\\oddsidemargin\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\oddsidemargin= $helper->{'VARS'}->{'pagesize.lmargin'} $helper->{'VARS'}->{'pagesize.lmarginunit'} /; |
$result =~ s/\\oddsidemargin\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\oddsidemargin= $helper->{'VARS'}->{'pagesize.lmargin'} $helper->{'VARS'}->{'pagesize.lmarginunit'} /; |
} |
} |
Line 1737 ENDPART
|
Line 1774 ENDPART
|
my $URLback=''; #link to original document |
my $URLback=''; #link to original document |
if ($helper->{'VARS'}->{'construction'} ne '1') { |
if ($helper->{'VARS'}->{'construction'} ne '1') { |
#prints published resource |
#prints published resource |
$URLback=&Apache::lonnet::escape('/adm/flip?postdata=return:'); |
$URLback=&escape('/adm/flip?postdata=return:'); |
} else { |
} else { |
#prints resource from the construction space |
#prints resource from the construction space |
$URLback='/'.$helper->{'VARS'}->{'filename'}; |
$URLback='/'.$helper->{'VARS'}->{'filename'}; |
Line 1806 sub print_resources {
|
Line 1843 sub print_resources {
|
$namepostfix="\\\\Name: "; |
$namepostfix="\\\\Name: "; |
$fullname = "CODE - ".$moreenv->{'CODE'}; |
$fullname = "CODE - ".$moreenv->{'CODE'}; |
} |
} |
|
# Fullname may have special latex characters that need \ prefixing: |
|
# |
|
|
my $i = 0; |
my $i = 0; |
#goes through all resources, checks if they are available for |
#goes through all resources, checks if they are available for |
#current student, and produces output |
#current student, and produces output |
Line 1814 sub print_resources {
|
Line 1854 sub print_resources {
|
my %page_breaks = &get_page_breaks($helper); |
my %page_breaks = &get_page_breaks($helper); |
my @format_array = split(/\|/,$helper->{'VARS'}->{'FORMAT'}); |
my @format_array = split(/\|/,$helper->{'VARS'}->{'FORMAT'}); |
my $columns_in_format = $format_array[1]; |
my $columns_in_format = $format_array[1]; |
|
# |
|
# end each student with a |
|
# Special that allows the post processor to even out the page |
|
# counts later. Nasty problem this... it would be really |
|
# nice to put the special in as a postscript comment |
|
# e.g. \special{ps:\ENDOFSTUDENTSTAMP} unfortunately, |
|
# The special gets passed the \ and dvips puts it in the output file |
|
# so we will just rely on prntout.pl to strip ENDOFSTUDENTSTAMP from the |
|
# postscript. Each ENDOFSTUDENTSTAMP will go on a line by itself. |
|
# |
|
|
foreach my $curresline (@{$master_seq}) { |
foreach my $curresline (@{$master_seq}) { |
if (defined $page_breaks{$curresline}) { |
if (defined $page_breaks{$curresline}) { |
Line 1828 sub print_resources {
|
Line 1878 sub print_resources {
|
if (&Apache::lonnet::allowed('bre',$res_url)) { |
if (&Apache::lonnet::allowed('bre',$res_url)) { |
if ($res_url!~m|^ext/| |
if ($res_url!~m|^ext/| |
&& $res_url=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { |
&& $res_url=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { |
if ($res_url =~ /\.page/) { |
|
} |
|
$printed .= $curresline.':'; |
$printed .= $curresline.':'; |
|
|
&Apache::lonxml::remember_problem_counter(); |
&Apache::lonxml::remember_problem_counter(); |
Line 1895 sub print_resources {
|
Line 1943 sub print_resources {
|
if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo } |
if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo } |
if ($usersection ne '') {$courseidinfo.=' - Sec. '.$usersection} |
if ($usersection ne '') {$courseidinfo.=' - Sec. '.$usersection} |
my $currentassignment=&Apache::lonxml::latex_special_symbols($helper->{VARS}->{'assignment'},'header'); |
my $currentassignment=&Apache::lonxml::latex_special_symbols($helper->{VARS}->{'assignment'},'header'); |
|
my $HeaderLine = $parmhash{'print_header_format'}; |
|
$HeaderLine = format_page_header($HeaderLine, $currentassignment, $courseidinfo, $fullname); |
|
&Apache::lonnet::logthis("Hdr format: $HeaderLine"); |
if ($current_output=~/\\documentclass/) { |
if ($current_output=~/\\documentclass/) { |
if ($columns_in_format == 1) { |
if ($columns_in_format == 1) { |
$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent\\lhead{\\textit{\\textbf{$fullname}}$courseidinfo \\hfill \\thepage \\\\ \\textit{$currentassignment}$namepostfix}}\\vskip 5 mm /; |
$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent\\lhead{$HeaderLine$namepostfix}}\\vskip 5 mm /; |
} else { |
} else { |
$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent\\fancyhead[LO]{\\textit{\\textbf{$fullname}}$courseidinfo \\hfill \\thepage \\\\ \\textit{$currentassignment}$namepostfix}}\\vskip 5 mm /; |
$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent\\fancyhead[LO]{$HeaderLine$namepostfix}}\\vskip 5 mm /; |
|
|
} |
} |
} else { |
} else { |
my $blankpages = ''; |
my $blankpages = ''; |
for (my $j=0;$j<$helper->{'VARS'}->{'EMPTY_PAGES'};$j++) {$blankpages.='\clearpage\strut\clearpage';} |
for (my $j=0;$j<$helper->{'VARS'}->{'EMPTY_PAGES'};$j++) {$blankpages.='\clearpage\strut\clearpage';} |
if ($columns_in_format == 1) { |
if ($columns_in_format == 1) { |
$current_output = '\strut\vspace*{-6 mm}\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\vspace*{-2 mm}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License }\\newpage '.$blankpages.'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\lhead{\\textit{\\textbf{'.$fullname.'}}'.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$currentassignment.'}'.$namepostfix.'}} \vskip 5 mm '.$current_output; |
$current_output = '\strut\vspace*{-6 mm}\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\vspace*{-2 mm}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License }\\newpage '.$blankpages.'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\lhead{'.$HeaderLine.'}'.$namepostfix.'} \vskip 5 mm '.$current_output; |
} else { |
} else { |
$current_output = '\strut\vspace*{-6 mm}\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\vspace*{-2 mm}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License }\\newpage '.$blankpages.'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\fancyhead[LO]{\\textit{\\textbf{'.$fullname.'}}'.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$currentassignment.'}'.$namepostfix.'}} \vskip 5 mm '.$current_output; |
$current_output = '\strut\vspace*{-6 mm}\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\vspace*{-2 mm}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License }\\newpage '.$blankpages.'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\fancyhead[LO]{'.$HeaderLine.'}'.$namepostfix.'} \vskip 5 mm '.$current_output; |
} |
} |
} |
} |
|
# |
|
# Close the student bracketing. |
|
# |
|
$current_output .= "\n\\special{ps:ENDOFSTUDENTSTAMP}\n"; |
return ($current_output,$fullname, $printed); |
return ($current_output,$fullname, $printed); |
|
|
} |
} |
Line 1929 sub handler {
|
Line 1984 sub handler {
|
} |
} |
|
|
|
|
my %parmhash=&Apache::lonnet::coursedescription($env{'request.course.id'}); |
%parmhash=&Apache::lonnet::coursedescription($env{'request.course.id'}); |
|
|
|
|
|
|
Line 2253 ALL_PROBLEMS
|
Line 2308 ALL_PROBLEMS
|
<choice computer="all">All assignments in a single PDF file</choice> |
<choice computer="all">All assignments in a single PDF file</choice> |
<choice computer="sections">Each PDF contains exactly one section</choice> |
<choice computer="sections">Each PDF contains exactly one section</choice> |
<choice computer="oneper">Each PDF contains exactly one assignment</choice> |
<choice computer="oneper">Each PDF contains exactly one assignment</choice> |
<choice computer="usenumber" relatedvalue="NUMBER_TO_PRINT" relateddefault="all"> |
<choice computer="usenumber" relatedvalue="NUMBER_TO_PRINT"> |
Specify Number:</choice> |
Specify the number of assignments per PDF:</choice> |
</choices> |
</choices> |
</state> |
</state> |
RESOURCE_SELECTOR |
RESOURCE_SELECTOR |
Line 2292 CHOOSE_STUDENTS
|
Line 2347 CHOOSE_STUDENTS
|
} |
} |
} |
} |
|
|
my $code_selection = "<choice></choice>\n"; |
my $code_selection; |
foreach my $code (sort {uc($a) cmp uc($b)} (keys(%codes_to_print))) { |
foreach my $code (sort {uc($a) cmp uc($b)} (keys(%codes_to_print))) { |
my $choice = $code; |
my $choice = $code; |
if ($code =~ /^[A-Z]+$/) { # Alpha code |
if ($code =~ /^[A-Z]+$/) { # Alpha code |
Line 2302 CHOOSE_STUDENTS
|
Line 2357 CHOOSE_STUDENTS
|
} |
} |
if (%codes_to_print) { |
if (%codes_to_print) { |
$code_selection .=' |
$code_selection .=' |
<exec> |
<message><b>Choose single code from list</b></message> |
push(@{$state->{CHOICES}},@{$helper->{DATA}{ALL_CODE_CHOICES}}); |
<message></td><td></message> |
</exec> |
<dropdown variable="CODE_SELECTED_FROM_LIST" multichoice="0" allowempty="0"> |
|
<choice></choice> |
|
<exec> |
|
push(@{$state->{CHOICES}},@{$helper->{DATA}{ALL_CODE_CHOICES}}); |
|
</exec> |
|
</dropdown> |
|
<message></td></tr><tr><td colspan="2"><hr width=\'33%\' /></td></tr><tr><td></message> |
'.$/; |
'.$/; |
|
|
} |
} |
|
|
|
|
Line 2363 CHOOSE_STUDENTS
|
Line 2425 CHOOSE_STUDENTS
|
</validator> |
</validator> |
</string> |
</string> |
<message></td></tr><tr><td colspan="2"><hr width='33%' /></td></tr><tr><td></message> |
<message></td></tr><tr><td colspan="2"><hr width='33%' /></td></tr><tr><td></message> |
<message><b>Choose single code from list</b></message> |
|
<message></td><td></message> |
|
<choices variable="CODE_SELECTED_FROM_LIST" multichoice="0" allowempty="0"> |
|
$code_selection |
$code_selection |
</choices> |
|
<message></td></tr><tr><td colspan="2"><hr width='33%' /></td></tr><tr><td></message> |
|
<message><b>Reprint a set of saved CODEs:</b></message> |
<message><b>Reprint a set of saved CODEs:</b></message> |
<message></td><td></message> |
<message></td><td></message> |
<dropdown variable="REUSE_OLD_CODES"> |
<dropdown variable="REUSE_OLD_CODES"> |
Line 2414 CHOOSE_ANON1
|
Line 2473 CHOOSE_ANON1
|
<choice computer="all">All assignments in a single PDF file</choice> |
<choice computer="all">All assignments in a single PDF file</choice> |
<choice computer="sections">Each PDF contains exactly one section</choice> |
<choice computer="sections">Each PDF contains exactly one section</choice> |
<choice computer="oneper">Each PDF contains exactly one assignment</choice> |
<choice computer="oneper">Each PDF contains exactly one assignment</choice> |
<choice computer="usenumber" relatedvalue="NUMBER_TO_PRINT" relateddefault="all"> |
<choice computer="usenumber" relatedvalue="NUMBER_TO_PRINT"> |
Specify Number:</choice> |
Specify the number of assignments per PDF:</choice> |
</choices> |
</choices> |
</state> |
</state> |
RESOURCE_SELECTOR |
RESOURCE_SELECTOR |
Line 2474 CHOOSE_STUDENTS1
|
Line 2533 CHOOSE_STUDENTS1
|
</validator> |
</validator> |
</string> |
</string> |
<message></td></tr><tr><td colspan="2"><hr width='33%' /></td></tr><tr><td></message> |
<message></td></tr><tr><td colspan="2"><hr width='33%' /></td></tr><tr><td></message> |
<message><b>Choose single code from list</b></message> |
|
<message></td><td></message> |
|
<dropdown variable="CODE_SELECTED_FROM_LIST" multichoice="0" allowempty="0"> |
|
$code_selection |
$code_selection |
</dropdown> |
|
<message></td></tr><tr><td colspan="2"><hr width='33%' /></td></tr><tr><td></message> |
|
<message><b>Reprint a set of saved CODEs:</b></message> |
<message><b>Reprint a set of saved CODEs:</b></message> |
<message></td><td></message> |
<message></td><td></message> |
<dropdown variable="REUSE_OLD_CODES"> |
<dropdown variable="REUSE_OLD_CODES"> |
Line 2888 sub render {
|
Line 2942 sub render {
|
$result .= '<br /><font color="#FF0000">' . $self->{ERROR_MSG} . '</font><br />'; |
$result .= '<br /><font color="#FF0000">' . $self->{ERROR_MSG} . '</font><br />'; |
} |
} |
|
|
|
my $width = 18; |
|
my $format = $helper->{VARS}->{$self->{'formatvar'}}; |
|
if (substr($format, 2, 1) ne '1') { |
|
$width = 9; |
|
} |
|
|
$result .= <<ELEMENTHTML; |
$result .= <<ELEMENTHTML; |
|
|
<p>How should the column be formatted?</p> |
<p>How should the column be formatted?</p> |
Line 2895 sub render {
|
Line 2955 sub render {
|
<table cellpadding='3'> |
<table cellpadding='3'> |
<tr> |
<tr> |
<td align='right'><b>Width</b>:</td> |
<td align='right'><b>Width</b>:</td> |
<td align='left'><input type='text' name='$var.width' value='18' size='4'></td> |
<td align='left'><input type='text' name='$var.width' value='$width' size='4'></td> |
<td align='left'> |
<td align='left'> |
<select name='$var.widthunit'> |
<select name='$var.widthunit'> |
<option>cm</option><option>in</option> |
<option>cm</option><option>in</option> |