version 1.568, 2009/12/21 12:11:51
|
version 1.568.4.2, 2010/02/25 04:55:30
|
Line 1890 sub print_construction_sequence {
|
Line 1890 sub print_construction_sequence {
|
} |
} |
|
|
sub output_data { |
sub output_data { |
my ($r,$helper,$rparmhash) = @_; |
my ($r,$helper,$rparmhash,$is_custom) = @_; |
my %parmhash = %$rparmhash; |
my %parmhash = %$rparmhash; |
$ssi_error = 0; # This will be set nonzero by failing ssi's. |
$ssi_error = 0; # This will be set nonzero by failing ssi's. |
$resources_printed = ''; |
$resources_printed = ''; |
Line 1931 ENDPART
|
Line 1931 ENDPART
|
{'href' => '', |
{'href' => '', |
'text' => 'Preparing Printout'}]; |
'text' => 'Preparing Printout'}]; |
|
|
|
if ($is_custom) { |
|
$brcrum = [{'href' => '', |
|
'text' => 'Preparing Printout'}]; |
|
} |
|
|
my $start_page = &Apache::loncommon::start_page('Preparing Printout', |
my $start_page = &Apache::loncommon::start_page('Preparing Printout', |
$js, |
$js, |
{'bread_crumbs' => $brcrum,}); |
{'bread_crumbs' => $brcrum,}); |
Line 1992 ENDPART
|
Line 1997 ENDPART
|
&Apache::lonnet::delenv('construct.style'); |
&Apache::lonnet::delenv('construct.style'); |
} |
} |
|
|
|
|
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,$cleanURL); |
my ($currentURL,$cleanURL); |
Line 2938 sub handler {
|
Line 2942 sub handler {
|
|
|
&init_perm(); |
&init_perm(); |
|
|
|
my ($helper,$is_custom); |
|
if ((&Apache::loncommon::needs_gci_custom()) && |
|
($env{'request.role.domain'} eq 'gcitest')) { |
|
if ($r->header_only) { |
|
if ($env{'browser.mathml'}) { |
|
&Apache::loncommon::content_type($r,'text/xml'); |
|
} else { |
|
&Apache::loncommon::content_type($r,'text/html'); |
|
} |
|
$r->send_http_header; |
|
return OK; |
|
} |
|
# Send header, nocache |
|
if ($env{'browser.mathml'}) { |
|
&Apache::loncommon::content_type($r,'text/xml'); |
|
} else { |
|
&Apache::loncommon::content_type($r,'text/html'); |
|
} |
|
&Apache::loncommon::no_cache($r); |
|
$r->send_http_header; |
|
$r->rflush(); |
|
|
|
my ($navmap_error,$resources,@master_seq); |
my $helper = printHelper($r); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
if (!ref($helper)) { |
if (!defined($navmap)) { |
return $helper; |
my $brcrum = [{'href' => '', |
|
'text' => 'Preparing Printout'}]; |
|
|
|
my $start_page = |
|
&Apache::loncommon::start_page('Preparing Printout','', |
|
{'bread_crumbs' => $brcrum,}); |
|
my $endpage = &Apache::loncommon::end_page(); |
|
|
|
my $navmap_error = '<span class="LC_error">'.&mt('An error occurred retrieving information about the course.').'<br />'.&mt('It is recommended that you re-select the concept test by clicking on the "Review Questions" tab and then clicking on the "Manage Tests" tab again.').'</span>'; |
|
$r->print($start_page.$navmap_error.$endpage); |
|
return OK; |
|
} else { |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my @allres=$navmap->retrieveResources('/uploaded/'.$cdom.'/'.$cnum.'/default_1261144274.sequence'); |
|
foreach my $resource (@allres) { |
|
next if ($resource->is_map()); |
|
my $symb = $resource->symb(); |
|
push(@master_seq,$symb); |
|
} |
|
$resources = join('|||',@master_seq); |
|
my ($sequence,$middle_thingy,$urlp) = |
|
&Apache::lonnet::decode_symb($master_seq[0]); |
|
|
|
my $assignment = &Apache::lonxml::latex_special_symbols(&Apache::lonnet::gettitle($sequence),'header'); |
|
|
|
$helper = { |
|
VARS => { |
|
ANON_CODE_STORAGE_NAME => '', |
|
ANSWER_TYPE => 'yes', |
|
CODE_OPTION => '', |
|
EMPTY_PAGES => '', |
|
FINISHPAGE => '', |
|
FORMAT => 'P|1|letter|no', |
|
LATEX_TYPE => 'batchmode', |
|
NUMBER_TO_PRINT_TOTAL => '', |
|
PRINT_ANNOTATIONS => 'no', |
|
PRINT_DISCUSSIONS => 'no', |
|
PRINT_TYPE => 'map_problems', |
|
RESOURCES => $resources, |
|
REUSE_OLD_CODES => '', |
|
SEQUENCE => '', |
|
SINGLE_CODE => '', |
|
SPLIT_PDFS => '', |
|
STUDENTS => '', |
|
TABLE_CONTENTS => 'no', |
|
TABLE_INDEX => 'no', |
|
assignment => $assignment, |
|
construction => '', |
|
curseed => '', |
|
filename => '', |
|
fontsize => 'normalsize', |
|
pagesize => '', |
|
'pagesize.height' => '9.8', |
|
'pagesize.heightunit' => 'in', |
|
'pagesize.lmargin' => '-0.57', |
|
'pagesize.lmarginunit' => 'in', |
|
'pagesize.width' => '7.1', |
|
'pagesize.widthunit' => 'in', |
|
postdata => $urlp, |
|
probstatus => '', |
|
showallfoils => '', |
|
student_sort => '', |
|
style_file => '', |
|
symb => $master_seq[0], |
|
} |
|
}; |
|
$env{'form.assignment'} = $assignment; |
|
$is_custom = 1; |
|
} |
|
} else { |
|
$helper = printHelper($r); |
|
if (!ref($helper)) { |
|
return $helper; |
|
} |
} |
} |
|
|
|
|
%parmhash=&Apache::lonnet::coursedescription($env{'request.course.id'}); |
%parmhash=&Apache::lonnet::coursedescription($env{'request.course.id'}); |
|
|
|
|
|
|
|
|
# If a figure conversion queue file exists for this user.domain |
# If a figure conversion queue file exists for this user.domain |
Line 2957 sub handler {
|
Line 3053 sub handler {
|
|
|
my $conversion_queuefile = "/home/httpd/prtspool/$env{'user.name'}_$env{'user.domain'}_printout.dat"; |
my $conversion_queuefile = "/home/httpd/prtspool/$env{'user.name'}_$env{'user.domain'}_printout.dat"; |
if(-e $conversion_queuefile) { |
if(-e $conversion_queuefile) { |
unlink $conversion_queuefile; |
unlink $conversion_queuefile; |
} |
} |
|
|
|
|
&output_data($r,$helper,\%parmhash); |
|
|
&output_data($r,$helper,\%parmhash,$is_custom); |
return OK; |
return OK; |
} |
} |
|
|
use Apache::lonhelper; |
use Apache::lonhelper; |
|
|
Line 3381 ALL_PROBLEMS
|
Line 3477 ALL_PROBLEMS
|
'multichoice="1" addstatus="1" closeallpages="1"', |
'multichoice="1" addstatus="1" closeallpages="1"', |
'RESOURCES', |
'RESOURCES', |
'PRINT_FORMATTING', |
'PRINT_FORMATTING', |
'', |
$map, |
$isProblem, '', $symbFilter, |
$isProblem, '', $symbFilter, |
$start_new_option); |
$start_new_option); |
$resource_selector .= <<RESOURCE_SELECTOR; |
$resource_selector .= <<RESOURCE_SELECTOR; |