version 1.131, 2003/04/22 19:54:39
|
version 1.136, 2003/04/30 19:25:47
|
Line 1378 sub printHelper {
|
Line 1378 sub printHelper {
|
my $isProblem = '$res->is_problem();'; |
my $isProblem = '$res->is_problem();'; |
my $isProblemOrMap = '$res->is_problem() || $res->is_map()'; |
my $isProblemOrMap = '$res->is_problem() || $res->is_map()'; |
my $isNotMap = '!$res->is_map();'; |
my $isNotMap = '!$res->is_map();'; |
|
my $symb = '$res->symb();'; |
my $helperFragment = <<HELPERFRAGMENT; |
my $helperFragment = <<HELPERFRAGMENT; |
<state name="CHOOSE_PROBLEMS" title="Select Problems"> |
<state name="CHOOSE_PROBLEMS" title="Select Problems"> |
<message>Select problems to print:</message> |
<message>Select problems to print:</message> |
Line 1386 sub printHelper {
|
Line 1387 sub printHelper {
|
<filterfunc>return $isProblemOrMap</filterfunc> |
<filterfunc>return $isProblemOrMap</filterfunc> |
<choicefunc>return $isProblem</choicefunc> |
<choicefunc>return $isProblem</choicefunc> |
<mapurl>$map</mapurl> |
<mapurl>$map</mapurl> |
|
<valuefunc>return $symb</valuefunc> |
</resource> |
</resource> |
</state> |
</state> |
|
|
Line 1395 sub printHelper {
|
Line 1397 sub printHelper {
|
<nextstate>FINAL</nextstate> |
<nextstate>FINAL</nextstate> |
<choicefunc>return $isNotMap;</choicefunc> |
<choicefunc>return $isNotMap;</choicefunc> |
<mapurl>$map</mapurl> |
<mapurl>$map</mapurl> |
|
<valuefunc>return $symb</valuefunc> |
</resource> |
</resource> |
</state> |
</state> |
HELPERFRAGMENT |
HELPERFRAGMENT |
Line 1405 HELPERFRAGMENT
|
Line 1408 HELPERFRAGMENT
|
# If the user is priviledged, allow them to print all |
# If the user is priviledged, allow them to print all |
# problems in the course, optionally for selected students |
# problems in the course, optionally for selected students |
if (($ENV{'request.role'}=~m/^cc\./ or $ENV{'request.role'}=~m/^in\./ or $ENV{'request.role'}=~m/^ta\./) and ($helper->{VARS}->{'postdata'}=~/\/res\//)) { |
if (($ENV{'request.role'}=~m/^cc\./ or $ENV{'request.role'}=~m/^in\./ or $ENV{'request.role'}=~m/^ta\./) and ($helper->{VARS}->{'postdata'}=~/\/res\//)) { |
push @{$printChoices}, ['<b>All problems</b> in course (may take a lot of time)', 'all_problems', 'FINAL']; |
push @{$printChoices}, ['<b>All problems</b> in course (may take a lot of time)', 'all_problems', 'ALL_PROBLEMS']; |
push @{$printChoices}, ["Problems from <b>$sequenceTitle</b> for selected students", 'problems_for_students', 'CHOOSE_STUDENTS']; |
push @{$printChoices}, ["Problems from <b>$sequenceTitle</b> for selected students", 'problems_for_students', 'CHOOSE_STUDENTS']; |
|
|
|
my $isProblem = '$res->is_problem();'; |
|
my $isProblemOrMap = '$res->is_problem() || $res->is_map()'; |
|
my $symb = '$res->symb();'; |
&Apache::lonxml::xmlparse($r, 'helper', <<CHOOSE_STUDENTS); |
&Apache::lonxml::xmlparse($r, 'helper', <<CHOOSE_STUDENTS); |
|
<state name="ALL_PROBLEMS" title="Select Problems"> |
|
<message>Select problems to print:</message> |
|
<resource variable="RESOURCES" multichoice="1"> |
|
<nextstate>FINAL</nextstate> |
|
<filterfunc>return $isProblemOrMap</filterfunc> |
|
<choicefunc>return $isProblem</choicefunc> |
|
<valuefunc>return $symb</valuefunc> |
|
</resource> |
|
</state> |
|
|
<state name="CHOOSE_STUDENTS" title="Choose Students"> |
<state name="CHOOSE_STUDENTS" title="Choose Students"> |
<message>Select the students you wish to print the problems for:</message> |
<message>Select the students you wish to print the problems for:</message> |
<student multichoice='1' variable="STUDENTS" nextstate="FINAL" /> |
<student multichoice='1' variable="STUDENTS" nextstate="FINAL" /> |
Line 1508 my @paperSize = ("Letter [8 1/2x11 in]",
|
Line 1524 my @paperSize = ("Letter [8 1/2x11 in]",
|
sub new { |
sub new { |
my $self = Apache::lonhelper::element->new(); |
my $self = Apache::lonhelper::element->new(); |
|
|
|
shift; |
|
|
$self->{'variable'} = shift; |
$self->{'variable'} = shift; |
|
my $helper = Apache::lonhelper::getHelper(); |
|
$helper->declareVar($self->{'variable'}); |
bless($self); |
bless($self); |
return $self; |
return $self; |
} |
} |
Line 1566 STATEHTML
|
Line 1586 STATEHTML
|
return $result; |
return $result; |
} |
} |
|
|
|
sub postprocess { |
|
my $self = shift; |
|
|
|
my $var = $self->{'variable'}; |
|
my $helper = Apache::lonhelper->getHelper(); |
|
$helper->{VARS}->{$var} = |
|
$ENV{"form.$var.layout"} . '|' . $ENV{"form.$var.cols"} . '|' . |
|
$ENV{"form.$var.paper"}; |
|
return 1; |
|
} |
|
|
1; |
1; |
|
|
__END__ |
__END__ |