version 1.152, 2003/05/06 13:50:23
|
version 1.153, 2003/05/06 19:23:49
|
Line 1377 ENDPART
|
Line 1377 ENDPART
|
$LaTeXwidth = $1*25.4; |
$LaTeXwidth = $1*25.4; |
} |
} |
$LaTeXwidth.=' mm'; |
$LaTeXwidth.=' mm'; |
|
|
|
|
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; |
my $currentURL; |
if (defined $helper->{'VARS'}->{'url'}) { |
if (not defined $helper->{'VARS'}->{'construction'}) { |
$currentURL=$helper->{'VARS'}->{'url'}; |
|
} else { |
|
$currentURL=$helper->{'VARS'}->{'postdata'}; |
$currentURL=$helper->{'VARS'}->{'postdata'}; |
|
} else { |
|
$currentURL=$helper->{'VARS'}->{'construction'}; |
} |
} |
$selectionmade = 1; |
$selectionmade = 1; |
if ($currentURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { |
if ($currentURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { |
Line 1599 sub handler {
|
Line 1599 sub handler {
|
return $result; |
return $result; |
} |
} |
$helper = $result; |
$helper = $result; |
|
|
|
|
# my $key; |
# my $key; |
# foreach $key (keys %{$helper->{'VARS'}}) { |
# foreach $key (keys %{$helper->{'VARS'}}) { |
# $r->print(' '.$key.'->'.$helper->{'VARS'}->{$key}.'<br />'); |
# $r->print(' '.$key.'->'.$helper->{'VARS'}->{$key}.'<br />'); |
# } |
# } |
# return OK; |
# return OK; |
|
|
|
|
Line 1712 sub printHelper {
|
Line 1712 sub printHelper {
|
# This will persistently load in the data we want from the |
# This will persistently load in the data we want from the |
# very first screen. |
# very first screen. |
if ($ENV{'form.postdata'}) { |
if ($ENV{'form.postdata'}) { |
|
if ($ENV{'form.postdata'}!~/\/res\//) {$helper->{VARS}->{'construction'} = $ENV{'form.postdata'};} |
$helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($ENV{'form.postdata'}); |
$helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($ENV{'form.postdata'}); |
} |
} |
if ($ENV{'form.symb'}) { |
if ($ENV{'form.symb'}) { |
Line 1719 sub printHelper {
|
Line 1720 sub printHelper {
|
} |
} |
if ($ENV{'form.url'}) { |
if ($ENV{'form.url'}) { |
$helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($helper->{VARS}->{'postdata'}); |
$helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($helper->{VARS}->{'postdata'}); |
|
|
} |
} |
|
|
|
|
Line 1741 sub printHelper {
|
Line 1743 sub printHelper {
|
|
|
# "Delete everything after the last slash." |
# "Delete everything after the last slash." |
$subdir =~ s|/[^/]+$||; |
$subdir =~ s|/[^/]+$||; |
$subdir = '/home/httpd/html/res'.$subdir; #needs additional work for the construction space |
if (not defined $helper->{VARS}->{'construction'}) { |
|
$subdir = '/home/httpd/html/res'.$subdir; |
|
} else { |
|
$helper->{VARS}->{'construction'}=~/^([^\/]+)\/\/([^\/]+)(.*)\/[^\/]*$/; |
|
$subdir = $3; |
|
$subdir=~/\/~([^\/]+)\/(.*)$/; |
|
$subdir = '/home/'.$1.'/public_html/'.$2; |
|
} |
|
#### $r->print('Dir: '.$subdir.' '); |
|
#### return OK; |
|
|
|
|
# What can be printed is a very dynamic decision based on |
# What can be printed is a very dynamic decision based on |
# lots of factors. So we need to dynamically build this list. |
# lots of factors. So we need to dynamically build this list. |
Line 1761 sub printHelper {
|
Line 1773 sub printHelper {
|
push @{$printChoices}, ["<b>$resourceTitle</b> (exactly what was on the screen)", 'current_document', 'PAGESIZE']; |
push @{$printChoices}, ["<b>$resourceTitle</b> (exactly what was on the screen)", 'current_document', 'PAGESIZE']; |
|
|
# If we're in a sequence... |
# If we're in a sequence... |
if ($helper->{VARS}->{'postdata'} =~ /\/res\//) { |
if (not defined $helper->{'VARS'}->{'construction'}) { |
# Allow problems from sequence |
# Allow problems from sequence |
push @{$printChoices}, ["Problems from <b>$sequenceTitle</b>", 'map_problems', 'CHOOSE_PROBLEMS']; |
push @{$printChoices}, ["Problems from <b>$sequenceTitle</b>", 'map_problems', 'CHOOSE_PROBLEMS']; |
# Allow all resources from sequence |
# Allow all resources from sequence |
Line 1826 HELPERFRAGMENT
|
Line 1838 HELPERFRAGMENT
|
</resource> |
</resource> |
<message>How should the results be printed?</message> |
<message>How should the results be printed?</message> |
<choices variable="EMPTY_PAGES"> |
<choices variable="EMPTY_PAGES"> |
<choice computer='0'>Print all problems with no blank space between them</choice> |
<choice computer='0'>Print students assignments without separations (as uniform flow)</choice> |
<choice computer='1'>Put each student's problems on a new page (add pagefeed after each student)</choice> <!-- ' --> |
<choice computer='1'>Start student assignment from new page (add pagefeed after each student)</choice> |
<choice computer='2'>Seperate each student's problems with a full blank page</choice> <!-- ' --> |
<choice computer='2'>Add one emty page after each student assignment</choice> |
<choice computer='3'>Seperate each student's problems with two full blank pages</choice> <!-- ' --> |
<choice computer='3'>Add two emty page after each student assignment</choice> |
</choices> |
</choices> |
</state> |
</state> |
CHOOSE_STUDENTS |
CHOOSE_STUDENTS |
} |
} |
|
|
# FIXME: That RE should come from a library somewhere. |
# FIXME: That RE should come from a library somewhere. |
if ((&Apache::lonnet::allowed('bre',$subdir) eq 'F') and ($helper->{VARS}->{'postdata'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)/)) { |
if (((&Apache::lonnet::allowed('bre',$subdir) eq 'F') and ($helper->{VARS}->{'postdata'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)/)) or defined $helper->{'VARS'}->{'construction'}) { |
push @{$printChoices}, ["Problems from <b>$subdir</b>", 'problems_from_directory', 'CHOOSE_FROM_SUBDIR']; |
push @{$printChoices}, ["Problems from <b>$subdir</b>", 'problems_from_directory', 'CHOOSE_FROM_SUBDIR']; |
|
|
my $f = '$filename'; |
my $f = '$filename'; |