'.$/;
}
@@ -2426,9 +2509,12 @@ CHOOSE_STUDENTS
$codechoice='Default';
}
&Apache::lonxml::xmlparse($r, 'helper', <
+
SELECT_PROBLEMS
- Number of anonymous assignments to print: |
+ Fill out one of the forms below
+
+ Generate new CODEd Assignments
+ Number of CODEd assignments to print: |
if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) < 1) &&
@@ -2450,9 +2536,10 @@ CHOOSE_STUDENTS
$codechoice
- |
|
- |
- Enter a CODE to print: |
+ | |
+ | |
+
Print a Specific CODE
+ Enter a CODE to print: |
if(!\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'} &&
@@ -2465,25 +2552,24 @@ CHOOSE_STUDENTS
}
- |
|
+ |
$code_selection
-
-
- Reprint a set of saved CODEs:
+ |
+
Reprint a Set of Saved CODEs
+ Select saved CODEs:
|
$namechoice
|
-
$resource_selector
CHOOSE_ANON1
if ($helper->{VARS}->{'assignment'}) {
- push @{$printChoices}, [&mt("Selected Resources from folder [_1] for selected students",$sequenceTitle), 'resources_for_students', 'CHOOSE_STUDENTS1'];
- push @{$printChoices}, [&mt("Selected Resources from folder [_1] for anonymous students",$sequenceTitle), 'resources_for_anon', 'CHOOSE_ANON2'];
+ push @{$printChoices}, [&mt("Selected Resources from folder [_1] for selected people",$sequenceTitle), 'resources_for_students', 'CHOOSE_STUDENTS1'];
+ push @{$printChoices}, [&mt("Selected Resources from folder [_1] for CODEd assignments",$sequenceTitle), 'resources_for_anon', 'CHOOSE_ANON2'];
}
@@ -2496,7 +2582,7 @@ CHOOSE_ANON1
return $isNotMap;
$map
return $symbFilter;
-
+ $start_new_option
@@ -2534,9 +2620,12 @@ RESOURCE_SELECTOR
CHOOSE_STUDENTS1
&Apache::lonxml::xmlparse($r, 'helper', <
+
SELECT_RESOURCES
- Number of anonymous assignments to print: |
+ Fill out one of the forms below
+
+ Generate new CODEd Assignments
+ Number of CODEd assignments to print: |
if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) < 1) &&
@@ -2558,9 +2647,9 @@ CHOOSE_STUDENTS1
$codechoice
- |
|
- |
- Enter a CODE to print: |
+ | |
+
Print a Specific CODE
+ Enter a CODE to print: |
if(!\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'} &&
@@ -2573,27 +2662,37 @@ CHOOSE_STUDENTS1
}
- |
|
+ |
$code_selection
- Reprint a set of saved CODEs:
+ |
+
Reprint a Set of Saved CODEs
+ Select saved CODEs:
|
$namechoice
|
-
$resource_selector
CHOOSE_ANON2
}
# 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)/)) or defined $helper->{'VARS'}->{'construction'}) and $perm{'pav'} and $subdir ne $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/') {
- push @{$printChoices}, [&mt("Selected Problems from current subdirectory [_1]",$subdir), 'problems_from_directory', 'CHOOSE_FROM_SUBDIR'];
+ if (($perm{'pav'}
+ && $subdir ne $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/'
+ && (defined($helper->{'VARS'}->{'construction'})
+ ||
+ (&Apache::lonnet::allowed('bre',$subdir) eq 'F'
+ &&
+ $helper->{VARS}->{'postdata'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)/)
+ ))
+ && $helper->{VARS}->{'assignment'} eq ""
+ ) {
- my $f = '$filename';
+ my $pretty_dir = &Apache::lonnet::hreflocation($subdir);
+ push @{$printChoices}, [&mt("Selected Problems from current subdirectory [_1]",$pretty_dir), 'problems_from_directory', 'CHOOSE_FROM_SUBDIR'];
my $xmlfrag = <
+
PAGESIZE
@@ -2614,7 +2713,7 @@ CHOOSE_FROM_SUBDIR
# Allow the user to select any sequence in the course, feed it to
# another resource selector for that sequence
- if (!$helper->{VARS}->{'construction'}) {
+ if (!$helper->{VARS}->{'construction'} && !$is_published) {
push @$printChoices, ["Selected Resources from selected folder in course",
'select_sequences', 'CHOOSE_SEQUENCE'];
my $escapedSequenceName = $helper->{VARS}->{'SEQUENCE'};
@@ -2637,10 +2736,10 @@ CHOOSE_FROM_SUBDIR
PAGESIZE
- return $isProblem
+ return $isNotMap
return '$escapedSequenceName';
return $symbFilter;
-
+ $start_new_option
CHOOSE_FROM_ANY_SEQUENCE
@@ -2969,6 +3068,7 @@ sub new {
$self->{NEXTSTATE} = shift;
bless($self);
+
return $self;
}
@@ -2978,8 +3078,10 @@ sub render {
my $result = '';
my $var = $self->{'variable'};
+
+
if (defined $self->{ERROR_MSG}) {
- $result .= ' ' . $self->{ERROR_MSG} . ' ';
+ $result .= ' ' . $self->{ERROR_MSG} . ' ';
}
my $format = $helper->{VARS}->{$self->{'formatvar'}};
@@ -2998,90 +3100,120 @@ sub render {
}
-
- my ($width_and_units,
- $height_and_units,
- $margin_and_units) =
- &Apache::lonprintout::page_format($papersize, $laystyle, $cols);
-
-
- my ($width, $wunits) = split(/ /, $width_and_units);
- my ($height, $hunits) = split(/ /, $height_and_units);
- my ($margin, $munits) = split(/ /, $margin_and_units);
-
-
-
- # This code is a bit ugly and not very scalable with additional units.
- # but I'm not sure my poor perlmanship knows a better way yet RF
-
- my ($wuoptions, $huoptions, $muoptions);
+ my %size;
+ ($size{'width_and_units'},
+ $size{'height_and_units'},
+ $size{'margin_and_units'})=
+ &Apache::lonprintout::page_format($papersize, $laystyle, $cols);
- if ($wunits eq 'cm') {
- $wuoptions = '';
- } else {
- $wuoptions = '';
- }
- if ($hunits eq 'cm') {
- $huoptions = '';
- } else {
- $huoptions = '';
- }
- if ($munits eq 'cm') {
- $muoptions = '';
- } else {
- $muoptions = '';
+ foreach my $dimension ('width','height','margin') {
+ ($size{$dimension},$size{$dimension.'_unit'}) =
+ split(/ +/, $size{$dimension.'_and_units'},2);
+
+ foreach my $unit ('cm','in') {
+ $size{$dimension.'_options'} .= ' |
|
|