version 1.572, 2010/02/28 22:38:45
|
version 1.579, 2010/05/24 09:36:26
|
Line 196 sub generate_code_selector {
|
Line 196 sub generate_code_selector {
|
<message><br /><hr /> <br /></message> |
<message><br /><hr /> <br /></message> |
<message><h3>Generate new CODEd Assignments</h3></message> |
<message><h3>Generate new CODEd Assignments</h3></message> |
<message><table><tr><td><b>Number of CODEd assignments to print:</b></td><td></message> |
<message><table><tr><td><b>Number of CODEd assignments to print:</b></td><td></message> |
<string variable="NUMBER_TO_PRINT_TOTAL" maxlength="5" size="5"> |
<string variable="NUMBER_TO_PRINT_TOTAL" maxlength="5" size="5" noproceed="1"> |
<validator> |
<validator> |
if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) < 1) && |
if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) < 1) && |
!\$helper->{'VARS'}{'REUSE_OLD_CODES'} && |
!\$helper->{'VARS'}{'REUSE_OLD_CODES'} && |
!\$helper->{'VARS'}{'SINGLE_CODE'} && |
!\$helper->{'VARS'}{'SINGLE_CODE'} && |
!\$helper->{'VARS'}{'CODE_SELECTED_FROM_LIST'}) { |
!\$helper->{'VARS'}{'CODE_SELECTED_FROM_LIST'} ) { |
|
|
return "You need to specify the number of assignments to print"; |
return "You need to specify the number of assignments to print"; |
} |
} |
|
if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) >= 1) && |
|
(\$helper->{'VARS'}{'SINGLE_CODE'} ne '') ) { |
|
return 'Specifying number of codes to print and a specific code is not compatible'; |
|
} |
return undef; |
return undef; |
</validator> |
</validator> |
</string> |
</string> |
Line 228 sub generate_code_selector {
|
Line 233 sub generate_code_selector {
|
!\$helper->{'VARS'}{'CODE_SELECTED_FROM_LIST'}) { |
!\$helper->{'VARS'}{'CODE_SELECTED_FROM_LIST'}) { |
return &Apache::lonprintout::is_code_valid(\$helper->{'VARS'}{'SINGLE_CODE'}, |
return &Apache::lonprintout::is_code_valid(\$helper->{'VARS'}{'SINGLE_CODE'}, |
\$helper->{'VARS'}{'CODE_OPTION'}); |
\$helper->{'VARS'}{'CODE_OPTION'}); |
|
} elsif (\$helper->{'VARS'}{'SINGLE_CODE'} ne ''){ |
|
return 'Specifying a code name is incompatible with specifying number of codes.'; |
} else { |
} else { |
return undef; # Other forces control us. |
return undef; # Other forces control us. |
} |
} |
Line 306 sub set_font_size {
|
Line 313 sub set_font_size {
|
|
|
my ($text) = @_; |
my ($text) = @_; |
|
|
$text =~ s/\\begin{document}/\\begin{document}{\\$font_size/; |
# There appear to be cases where the font directive is empty.. in which |
|
# case the first substituion would insert a spurious \ oh happy day. |
|
# as this has been the cause of much mystery and hair pulling _sigh_ |
|
|
|
if ($font_size ne '') { |
|
|
|
$text =~ s/\\begin{document}/\\begin{document}{\\$font_size/; |
|
} |
$text =~ s/\\end{document}/}\\end{document}/; |
$text =~ s/\\end{document}/}\\end{document}/; |
return $text; |
return $text; |
|
|
Line 1309 sub page_format_transformation {
|
Line 1323 sub page_format_transformation {
|
$text =~ s/\\pagestyle{fancy}\\rhead{}\\chead{}\s*\\begin{document}/\\textheight = $textheight\\oddsidemargin = $evenoffset\n\\evensidemargin = $evenoffset $topmargintoinsert\\textwidth= $textwidth\\newlength{\\minipagewidth}\n\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\pagestyle{fancy}\\rhead{}\\chead{}\\usepackage{booktabs}\\begin{document}\\voffset=-0\.8cm\n\\setcounter{page}{1} \\vskip 5 mm\n /; |
$text =~ s/\\pagestyle{fancy}\\rhead{}\\chead{}\s*\\begin{document}/\\textheight = $textheight\\oddsidemargin = $evenoffset\n\\evensidemargin = $evenoffset $topmargintoinsert\\textwidth= $textwidth\\newlength{\\minipagewidth}\n\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\pagestyle{fancy}\\rhead{}\\chead{}\\usepackage{booktabs}\\begin{document}\\voffset=-0\.8cm\n\\setcounter{page}{1} \\vskip 5 mm\n /; |
} |
} |
if ($papersize eq 'a4') { |
if ($papersize eq 'a4') { |
$text =~ s/(\\begin{document})/$1\\special{papersize=210mm,297mm}/; |
my $papersize_text; |
|
if ($perm{'pav'}) { |
|
$papersize_text = '\\special{papersize=210mm,297mm}'; |
|
} else { |
|
$papersize_text = '\special{papersize=210mm,297mm}'; |
|
} |
|
$text =~ s/(\\begin{document})/$1$papersize_text/; |
} |
} |
} |
} |
if ($tableofcontents eq 'yes') {$text=~s/(\\setcounter\{page\}\{1\})/$1 \\tableofcontents\\newpage /;} |
if ($tableofcontents eq 'yes') {$text=~s/(\\setcounter\{page\}\{1\})/$1 \\tableofcontents\\newpage /;} |
Line 1570 sub print_page_in_course {
|
Line 1590 sub print_page_in_course {
|
} |
} |
# these resources go through the XML transformer: |
# these resources go through the XML transformer: |
|
|
elsif ($resource_src =~ /\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm\xhtml|xhtm)$/) { |
elsif ($resource_src =~ /\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { |
my $urlp = &Apache::lonnet::clutter($resource_src); |
my $urlp = &Apache::lonnet::clutter($resource_src); |
my %form; |
my %form; |
my %moreenv; |
my %moreenv; |
Line 1581 sub print_page_in_course {
|
Line 1601 sub print_page_in_course {
|
|
|
$form{'grade_target'} = 'tex'; |
$form{'grade_target'} = 'tex'; |
$form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); |
$form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); |
$form{'pdfFormFiels'} = $pdfFormFields; # |
$form{'pdfFormFields'} = $pdfFormFields; # |
$form{'showallfoils'} = $helper->{'VARS'}->{'showallfoils'}; |
$form{'showallfoils'} = $helper->{'VARS'}->{'showallfoils'}; |
|
|
$form{'problem_split'}=$parmhash{'problem_stream_switch'}; |
$form{'problem_split'}=$parmhash{'problem_stream_switch'}; |
Line 3710 CHOOSE_STUDENTS1
|
Line 3730 CHOOSE_STUDENTS1
|
<message><br /><hr /> <br /></message> |
<message><br /><hr /> <br /></message> |
<message><h3>Generate new CODEd Assignments</h3></message> |
<message><h3>Generate new CODEd Assignments</h3></message> |
<message><table><tr><td><b>Number of CODEd assignments to print:</b></td><td></message> |
<message><table><tr><td><b>Number of CODEd assignments to print:</b></td><td></message> |
<string variable="NUMBER_TO_PRINT_TOTAL" maxlength="5" size="5"> |
<string variable="NUMBER_TO_PRINT_TOTAL" maxlength="5" size="5" noproceed="1"> |
<validator> |
<validator> |
if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) < 1) && |
if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) < 1) && |
!\$helper->{'VARS'}{'REUSE_OLD_CODES'} && |
!\$helper->{'VARS'}{'REUSE_OLD_CODES'} && |
Line 3718 CHOOSE_STUDENTS1
|
Line 3738 CHOOSE_STUDENTS1
|
!\$helper->{'VARS'}{'CODE_SELECTED_FROM_LIST'}) { |
!\$helper->{'VARS'}{'CODE_SELECTED_FROM_LIST'}) { |
return "You need to specify the number of assignments to print"; |
return "You need to specify the number of assignments to print"; |
} |
} |
|
if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) >= 1) && |
|
(\$helper->{'VARS'}{'SINGLE_CODE'} ne '') ) { |
|
return 'Specifying number of codes to print and a specific code is not compatible'; |
|
} |
return undef; |
return undef; |
</validator> |
</validator> |
</string> |
</string> |
Line 3741 CHOOSE_STUDENTS1
|
Line 3765 CHOOSE_STUDENTS1
|
!\$helper->{'VARS'}{'CODE_SELECTED_FROM_LIST'}) { |
!\$helper->{'VARS'}{'CODE_SELECTED_FROM_LIST'}) { |
return &Apache::lonprintout::is_code_valid(\$helper->{'VARS'}{'SINGLE_CODE'}, |
return &Apache::lonprintout::is_code_valid(\$helper->{'VARS'}{'SINGLE_CODE'}, |
\$helper->{'VARS'}{'CODE_OPTION'}); |
\$helper->{'VARS'}{'CODE_OPTION'}); |
|
} elsif (\$helper->{'VARS'}{'SINGLE_CODE'} ne ''){ |
|
return 'Specifying a code name is incompatible specifying number of codes.'; |
} else { |
} else { |
return undef; # Other forces control us. |
return undef; # Other forces control us. |
} |
} |