version 1.478, 2006/08/14 10:52:04
|
version 1.481, 2006/08/22 14:43:49
|
Line 1110 sub print_construction_sequence {
|
Line 1110 sub print_construction_sequence {
|
$answerform{'answer_output_mode'}='tex'; |
$answerform{'answer_output_mode'}='tex'; |
$answerform{'rndseed'}=$rndseed; |
$answerform{'rndseed'}=$rndseed; |
$answerform{'problem_split'}=$parmhash{'problem_stream_switch'}; |
$answerform{'problem_split'}=$parmhash{'problem_stream_switch'}; |
if ($urlp=~/\/res\//) { |
if ($urlp=~/\/res\//) {$env{'request.state'}='published';} |
$env{'request.state'}='published'; |
|
} |
|
|
|
$resources_printed .= $urlp.':'; |
$resources_printed .= $urlp.':'; |
my $answer=&Apache::lonnet::ssi($urlp,%answerform); |
my $answer=&Apache::lonnet::ssi($urlp,%answerform); |
if ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') { |
if ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') { |
Line 1201 ENDPART
|
Line 1198 ENDPART
|
my $start_page = &Apache::loncommon::start_page('Preparing Printout',$js); |
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 ...'); |
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"); |
$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 |
Line 1254 ENDPART
|
Line 1249 ENDPART
|
} |
} |
|
|
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 2162 sub printHelper {
|
Line 2156 sub printHelper {
|
if ($env{'form.postdata'}=~/^(?:http:\/\/[^\/]+\/|\/|)\~([^\/]+)\/(.*)$/) { |
if ($env{'form.postdata'}=~/^(?:http:\/\/[^\/]+\/|\/|)\~([^\/]+)\/(.*)$/) { |
$helper->{VARS}->{'filename'} = "~$1/$2"; |
$helper->{VARS}->{'filename'} = "~$1/$2"; |
$helper->{VARS}->{'construction'} = 1; |
$helper->{VARS}->{'construction'} = 1; |
} elsif ($env{'form.postdata'}) { |
} else { |
if ($env{'form.postdata'}) { |
if ($env{'form.postdata'}) { |
$helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($env{'form.postdata'}); |
$helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($env{'form.postdata'}); |
} |
} |
Line 2174 sub printHelper {
|
Line 2168 sub printHelper {
|
} |
} |
|
|
} |
} |
|
|
if ($env{'form.symb'}) { |
if ($env{'form.symb'}) { |
$helper->{VARS}->{'symb'} = $env{'form.symb'}; |
$helper->{VARS}->{'symb'} = $env{'form.symb'}; |
} |
} |
Line 2185 sub printHelper {
|
Line 2180 sub printHelper {
|
&Apache::lonenc::check_encrypt($helper->{VARS}->{'symb'}); |
&Apache::lonenc::check_encrypt($helper->{VARS}->{'symb'}); |
my ($resourceTitle,$sequenceTitle,$mapTitle) = &details_for_menu($helper); |
my ($resourceTitle,$sequenceTitle,$mapTitle) = &details_for_menu($helper); |
if ($sequenceTitle ne '') {$helper->{VARS}->{'assignment'}=$sequenceTitle;} |
if ($sequenceTitle ne '') {$helper->{VARS}->{'assignment'}=$sequenceTitle;} |
|
|
|
|
# Extract map |
# Extract map |
my $symb = $helper->{VARS}->{'symb'}; |
my $symb = $helper->{VARS}->{'symb'}; |
Line 2192 sub printHelper {
|
Line 2188 sub printHelper {
|
my $subdir; |
my $subdir; |
|
|
# Get the resource name from construction space |
# Get the resource name from construction space |
|
|
if ($helper->{VARS}->{'construction'}) { |
if ($helper->{VARS}->{'construction'}) { |
$resourceTitle = substr($helper->{VARS}->{'filename'}, |
$resourceTitle = substr($helper->{VARS}->{'filename'}, |
rindex($helper->{VARS}->{'filename'}, '/')+1); |
rindex($helper->{VARS}->{'filename'}, '/')+1); |
$subdir = substr($helper->{VARS}->{'filename'}, |
$subdir = substr($helper->{VARS}->{'filename'}, |
0, rindex($helper->{VARS}->{'filename'}, '/') + 1); |
0, rindex($helper->{VARS}->{'filename'}, '/') + 1); |
} elsif ($env{'form.postdata'} =~ /^\/res\//) { # Get resource name from res space. |
} else { |
$helper->{VARS}->{'postdata'} = $env{'form.postdata'}; |
|
|
|
} elsif (!$helper->{VARS}->{'postdata'}) { |
|
($map, $id, $url) = &Apache::lonnet::decode_symb($symb); |
($map, $id, $url) = &Apache::lonnet::decode_symb($symb); |
$helper->{VARS}->{'postdata'} = |
$helper->{VARS}->{'postdata'} = |
&Apache::lonenc::check_encrypt(&Apache::lonnet::clutter($url)); |
&Apache::lonenc::check_encrypt(&Apache::lonnet::clutter($url)); |
|
|
if (!$resourceTitle) { # if the resource doesn't have a title, use the filename |
if (!$resourceTitle) { # if the resource doesn't have a title, use the filename |
my $postdata = $helper->{VARS}->{'postdata'}; |
my $postdata = $helper->{VARS}->{'postdata'}; |
$resourceTitle = substr($postdata, rindex($postdata, '/') + 1); |
$resourceTitle = substr($postdata, rindex($postdata, '/') + 1); |