version 1.285, 2004/03/23 16:17:48
|
version 1.287, 2004/03/24 22:22:04
|
Line 663 sub recalcto_mm {
|
Line 663 sub recalcto_mm {
|
|
|
sub get_textwidth { |
sub get_textwidth { |
my ($helper,$LaTeXwidth)=@_; |
my ($helper,$LaTeXwidth)=@_; |
|
my $textwidth=$LaTeXwidth; |
if ($helper->{'VARS'}->{'pagesize.width'}=~/\d+/ && |
if ($helper->{'VARS'}->{'pagesize.width'}=~/\d+/ && |
$helper->{'VARS'}->{'pagesize.widthunit'}=~/\w+/) { |
$helper->{'VARS'}->{'pagesize.widthunit'}=~/\w+/) { |
$moreenv{'textwidth'}=&recalcto_mm($helper->{'VARS'}->{'pagesize.width'}.' '.$helper->{'VARS'}->{'pagesize.widthunit'}); |
$textwidth=&recalcto_mm($helper->{'VARS'}->{'pagesize.width'}.' '. |
} else { |
$helper->{'VARS'}->{'pagesize.widthunit'}); |
$moreenv{'textwidth'}=$LaTeXwidth; |
|
} |
} |
|
return $textwidth; |
} |
} |
|
|
sub output_data { |
sub output_data { |
Line 1414 sub printHelper {
|
Line 1415 sub printHelper {
|
# $r->print($helper->{VARS}->{'postdata'}); |
# $r->print($helper->{VARS}->{'postdata'}); |
|
|
# Useful filter strings |
# Useful filter strings |
my $isProblem = '$res->is_problem()'; |
my $isProblem = '($res->is_problem()||$res->contains_problem) '; |
$isProblem .= ' && !$res->randomout()' if !$userCanSeeHidden; |
$isProblem .= ' && !$res->randomout()' if !$userCanSeeHidden; |
my $isProblemOrMap = '$res->is_problem() || $res->is_map()'; |
my $isProblemOrMap = '$res->is_problem() || $res->contains_problem() || $res->is_sequence()'; |
my $isNotMap = '!$res->is_map()'; |
my $isNotMap = '!$res->is_sequence()'; |
$isNotMap .= ' && !$res->randomout()' if !$userCanSeeHidden; |
$isNotMap .= ' && !$res->randomout()' if !$userCanSeeHidden; |
my $isMap = '$res->is_map()'; |
my $isMap = '$res->is_map()'; |
my $symbFilter = '$res->symb()'; |
my $symbFilter = '$res->symb()'; |
Line 1441 sub printHelper {
|
Line 1442 sub printHelper {
|
my $helperFragment = <<HELPERFRAGMENT; |
my $helperFragment = <<HELPERFRAGMENT; |
<state name="CHOOSE_PROBLEMS" title="Select Problem(s) to print"> |
<state name="CHOOSE_PROBLEMS" title="Select Problem(s) to print"> |
<message>(mark them then click "next" button) <br /></message> |
<message>(mark them then click "next" button) <br /></message> |
<resource variable="RESOURCES" multichoice="1" toponly='1' addstatus="1"> |
<resource variable="RESOURCES" multichoice="1" toponly='1' addstatus="1" |
|
closeallpages="1"> |
<nextstate>PAGESIZE</nextstate> |
<nextstate>PAGESIZE</nextstate> |
<filterfunc>return $isProblem;</filterfunc> |
<filterfunc>return $isProblem;</filterfunc> |
<mapurl>$map</mapurl> |
<mapurl>$map</mapurl> |
Line 1451 sub printHelper {
|
Line 1453 sub printHelper {
|
|
|
<state name="CHOOSE_PROBLEMS_HTML" title="Select Resource(s) to print"> |
<state name="CHOOSE_PROBLEMS_HTML" title="Select Resource(s) to print"> |
<message>(mark them then click "next" button) <br /></message> |
<message>(mark them then click "next" button) <br /></message> |
<resource variable="RESOURCES" multichoice="1" toponly='1' addstatus="1"> |
<resource variable="RESOURCES" multichoice="1" toponly='1' addstatus="1" |
|
closeallpages="1"> |
<nextstate>PAGESIZE</nextstate> |
<nextstate>PAGESIZE</nextstate> |
<filterfunc>return $isNotMap;</filterfunc> |
<filterfunc>return $isNotMap;</filterfunc> |
<mapurl>$map</mapurl> |
<mapurl>$map</mapurl> |
Line 1470 HELPERFRAGMENT
|
Line 1473 HELPERFRAGMENT
|
&Apache::lonxml::xmlparse($r, 'helper', <<ALL_PROBLEMS); |
&Apache::lonxml::xmlparse($r, 'helper', <<ALL_PROBLEMS); |
<state name="ALL_PROBLEMS" title="Select Problem(s) to print"> |
<state name="ALL_PROBLEMS" title="Select Problem(s) to print"> |
<message>(mark them then click "next" button) <br /></message> |
<message>(mark them then click "next" button) <br /></message> |
<resource variable="RESOURCES" multichoice="1" |
<resource variable="RESOURCES" toponly='0' multichoice="1" |
suppressEmptySequences='1' addstatus="1"> |
suppressEmptySequences='0' addstatus="1" closeallpages="1"> |
<nextstate>PAGESIZE</nextstate> |
<nextstate>PAGESIZE</nextstate> |
<filterfunc>return $isProblemOrMap;</filterfunc> |
<filterfunc>return $isProblemOrMap;</filterfunc> |
<choicefunc>return $isProblem;</choicefunc> |
<choicefunc>return $isNotMap;</choicefunc> |
<valuefunc>return $symbFilter;</valuefunc> |
<valuefunc>return $symbFilter;</valuefunc> |
</resource> |
</resource> |
</state> |
</state> |
Line 1486 ALL_PROBLEMS
|
Line 1489 ALL_PROBLEMS
|
} |
} |
my $resource_selector=<<RESOURCE_SELECTOR; |
my $resource_selector=<<RESOURCE_SELECTOR; |
<message><br /><big><i><b>Select resources for the assignment</b></i></big><br /></message> |
<message><br /><big><i><b>Select resources for the assignment</b></i></big><br /></message> |
<resource variable="RESOURCES" multichoice="1" addstatus="1"> |
<resource variable="RESOURCES" multichoice="1" addstatus="1" |
|
closeallpages="1"> |
<filterfunc>return $isProblem;</filterfunc> |
<filterfunc>return $isProblem;</filterfunc> |
<mapurl>$map</mapurl> |
<mapurl>$map</mapurl> |
<valuefunc>return $symbFilter;</valuefunc> |
<valuefunc>return $symbFilter;</valuefunc> |
Line 1510 RESOURCE_SELECTOR
|
Line 1514 RESOURCE_SELECTOR
|
CHOOSE_STUDENTS |
CHOOSE_STUDENTS |
&Apache::lonxml::xmlparse($r, 'helper', <<CHOOSE_ANON1); |
&Apache::lonxml::xmlparse($r, 'helper', <<CHOOSE_ANON1); |
<state name="CHOOSE_ANON1" title="Select Students and Resources"> |
<state name="CHOOSE_ANON1" title="Select Students and Resources"> |
<message><hr width='33%' /><b>How many Anonymous exams to print?</b></message> |
<message><hr width='33%' /><b>Number of anonymous assignments to print?</b></message> |
<string variable="NUMBER_TO_PRINT_TOTAL" maxlength="5" size="5"></string> |
<string variable="NUMBER_TO_PRINT_TOTAL" maxlength="5" size="5"></string> |
|
|
<message><hr width='33%' /></message> |
<message><hr width='33%' /></message> |
$resource_selector |
$resource_selector |
</state> |
</state> |
Line 1526 CHOOSE_ANON1
|
Line 1531 CHOOSE_ANON1
|
|
|
$resource_selector=<<RESOURCE_SELECTOR; |
$resource_selector=<<RESOURCE_SELECTOR; |
<message><br /><big><i><b>Select resources for the assignment</b></i></big><br /></message> |
<message><br /><big><i><b>Select resources for the assignment</b></i></big><br /></message> |
<resource variable="RESOURCES" multichoice="1" addstatus="1"> |
<resource variable="RESOURCES" multichoice="1" addstatus="1" |
|
closeallpages="1"> |
<filterfunc>return $isNotMap;</filterfunc> |
<filterfunc>return $isNotMap;</filterfunc> |
<mapurl>$map</mapurl> |
<mapurl>$map</mapurl> |
<valuefunc>return $symbFilter;</valuefunc> |
<valuefunc>return $symbFilter;</valuefunc> |
Line 1604 CHOOSE_FROM_SUBDIR
|
Line 1610 CHOOSE_FROM_SUBDIR
|
</state> |
</state> |
<state name="CHOOSE_FROM_ANY_SEQUENCE" title="Select Resources To Print"> |
<state name="CHOOSE_FROM_ANY_SEQUENCE" title="Select Resources To Print"> |
<message>(mark desired resources then click "next" button) <br /></message> |
<message>(mark desired resources then click "next" button) <br /></message> |
<resource variable="RESOURCES" multichoice="1" toponly='1' addstatus="1"> |
<resource variable="RESOURCES" multichoice="1" toponly='1' addstatus="1" |
|
closeallpages="1"> |
<nextstate>PAGESIZE</nextstate> |
<nextstate>PAGESIZE</nextstate> |
<filterfunc>return $isProblem</filterfunc> |
<filterfunc>return $isProblem</filterfunc> |
<mapurl evaluate='1'>return '$escapedSequenceName';</mapurl> |
<mapurl evaluate='1'>return '$escapedSequenceName';</mapurl> |