version 1.431, 2006/03/15 22:11:04
|
version 1.436, 2006/04/14 19:42:19
|
Line 1022 sub output_data {
|
Line 1022 sub output_data {
|
my ($r,$helper,$rparmhash) = @_; |
my ($r,$helper,$rparmhash) = @_; |
my %parmhash = %$rparmhash; |
my %parmhash = %$rparmhash; |
my $resources_printed = ''; |
my $resources_printed = ''; |
my $html=&Apache::lonxml::xmlbegin(); |
my $js = <<ENDPART; |
my $headtag = &Apache::loncommon::headtag('Preparing Printout'); |
<script type="text/javascript"> |
my $end_headtag = &Apache::loncommon::endheadtag(); |
|
my $bodytag = &Apache::loncommon::bodytag('Preparing Printout'); |
|
$r->print(<<ENDPART); |
|
$html |
|
$headtag |
|
<script type="text/javascript" language="Javascript"> |
|
var editbrowser; |
var editbrowser; |
function openbrowser(formname,elementname,only,omit) { |
function openbrowser(formname,elementname,only,omit) { |
var url = '/res/?'; |
var url = '/res/?'; |
Line 1053 $headtag
|
Line 1047 $headtag
|
editbrowser.focus(); |
editbrowser.focus(); |
} |
} |
</script> |
</script> |
$end_headtag |
|
$bodytag |
|
<p> |
|
Please stand by while processing your print request, this may take some time ... |
|
</p> |
|
ENDPART |
ENDPART |
|
|
|
my $start_page = &Apache::loncommon::start_page('Preparing Printout',$js); |
|
my $msg = &mt('Please stand by while processing your print request, this may take some time ...'); |
|
|
|
$r->print($start_page."\n<p>\n$msg\n</p>\n"); |
|
|
# fetch the pagebreaks and store them in the course environment |
# fetch the pagebreaks and store them in the course environment |
# The page breaks will be pulled into the hash %page_breaks which is |
# The page breaks will be pulled into the hash %page_breaks which is |
Line 2242 ALL_PROBLEMS
|
Line 2234 ALL_PROBLEMS
|
</resource> |
</resource> |
</state> |
</state> |
<state name="PRINT_FORMATTING" title="How should results be printed?"> |
<state name="PRINT_FORMATTING" title="How should results be printed?"> |
<nextstate>NUMBER_PER_PDF</nextstate> |
|
<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'>Start each student\'s assignment on a new page/column (add a pagefeed after each assignment)</choice> |
<choice computer='0'>Start each student\'s assignment on a new page/column (add a pagefeed after each assignment)</choice> |
Line 2250 ALL_PROBLEMS
|
Line 2241 ALL_PROBLEMS
|
<choice computer='2'>Add two empty pages/column after each student\'s assignment</choice> |
<choice computer='2'>Add two empty pages/column after each student\'s assignment</choice> |
<choice computer='3'>Add three empty pages/column after each student\'s assignment</choice> |
<choice computer='3'>Add three empty pages/column after each student\'s assignment</choice> |
</choices> |
</choices> |
</state> |
|
<state name="NUMBER_PER_PDF" title="Number printed at once"> |
|
<nextstate>PAGESIZE</nextstate> |
<nextstate>PAGESIZE</nextstate> |
<message><hr width='33%' /><b>How do you want assignments split into PDF files? </b></message> |
<message><hr width='33%' /><b>How do you want assignments split into PDF files? </b></message> |
<choices variable="SPLIT_PDFS"> |
<choices variable="SPLIT_PDFS"> |
<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">Specify Number:</choice> |
<choice computer="usenumber" relatedvalue="NUMBER_TO_PRINT" relateddefault="all"> |
|
Specify Number:</choice> |
</choices> |
</choices> |
<string variable="NUMBER_TO_PRINT" maxlength="5" size="5"><defaultvalue>"all"</defaultvalue></string> |
|
</state> |
</state> |
RESOURCE_SELECTOR |
RESOURCE_SELECTOR |
|
|
Line 2302 CHOOSE_STUDENTS
|
Line 2291 CHOOSE_STUDENTS
|
if ($code =~ /^[A-Z]+$/) { # Alpha code |
if ($code =~ /^[A-Z]+$/) { # Alpha code |
$choice = &letters_to_num($code); |
$choice = &letters_to_num($code); |
} |
} |
$code_selection .= ' <choice computer="'.$choice.'">'.$code."</choice>\n"; |
push(@{$helper->{DATA}{ALL_CODE_CHOICES}},[$code,$choice]); |
|
} |
|
if (%codes_to_print) { |
|
$code_selection .=' |
|
<exec> |
|
push(@{$state->{CHOICES}},@{$helper->{DATA}{ALL_CODE_CHOICES}}); |
|
</exec> |
|
'.$/; |
} |
} |
|
|
|
|
open(FH,$Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab'); |
open(FH,$Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab'); |
my $codechoice=''; |
my $codechoice=''; |
foreach my $line (<FH>) { |
foreach my $line (<FH>) { |
Line 2358 CHOOSE_STUDENTS
|
Line 2356 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 |
|
</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 2397 CHOOSE_ANON1
|
Line 2401 CHOOSE_ANON1
|
<choice computer='2'>Add two empty pages/column after each student\'s assignment</choice> |
<choice computer='2'>Add two empty pages/column after each student\'s assignment</choice> |
<choice computer='3'>Add three empty pages/column after each student\'s assignment</choice> |
<choice computer='3'>Add three empty pages/column after each student\'s assignment</choice> |
</choices> |
</choices> |
</state> |
|
<state name="NUMBER_PER_PDF" title="Number assignments per pdf"> |
|
<nextstate>PAGESIZE</nextstate> |
<nextstate>PAGESIZE</nextstate> |
<message><hr width='33%' /><b>How do you want assignments split into PDF files? </b></message> |
<message><hr width='33%' /><b>How do you want assignments split into PDF files? </b></message> |
<choices variable="SPLIT_PDFS"> |
<choices variable="SPLIT_PDFS"> |
<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">Specify Number:</choice> |
<choice computer="usenumber" relatedvalue="NUMBER_TO_PRINT" relateddefault="all"> |
|
Specify Number:</choice> |
</choices> |
</choices> |
<string variable="NUMBER_TO_PRINT" maxlength="5" size="5"><defaultvalue>"all"</defaultvalue></string> |
|
</state> |
</state> |
RESOURCE_SELECTOR |
RESOURCE_SELECTOR |
|
|
Line 2464 CHOOSE_STUDENTS1
|
Line 2466 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 |
|
</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"> |