Select sorting order of printout
@@ -4501,9 +4523,10 @@ ALL_PROBLEMS
}
- my @lines = &Apache::grades::get_scantronformat_file();
+ my @lines = &Apache::lonnet::get_scantronformat_file();
my $codechoice='';
foreach my $line (@lines) {
+ next if (($line =~ /^\#/) || ($line eq ''));
my ($name,$description,$code_type,$code_length)=
(split(/:/,$line))[0,1,2,4];
if ($code_length > 0 &&
@@ -4681,8 +4704,9 @@ 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'} && !$is_published) {
- push @$printChoices, [&mtn("Selected Resources from selected folder in course"),
- 'select_sequences', 'CHOOSE_SEQUENCE'];
+ push(@$printChoices, [&mt('Selected [_1]Resources[_2] from [_3]selected folder[_4] in course',
+ '','','',''),
+ 'select_sequences', 'CHOOSE_SEQUENCE']);
my $escapedSequenceName = $helper->{VARS}->{'SEQUENCE'};
#Escape apostrophes and backslashes for Perl
$escapedSequenceName =~ s/\\/\\\\/g;
@@ -4712,6 +4736,21 @@ CHOOSE_FROM_SUBDIR
CHOOSE_FROM_ANY_SEQUENCE
}
+ my $numchoices = 0;
+ if (ref($printChoices) eq 'ARRAY') {
+ $numchoices = @{$printChoices};
+ }
+ # Early out if nothing to print
+ if (!$numchoices) {
+ $r->print(&Apache::loncommon::start_page('Printing Helper').
+ ''.&mt('Unable to determine print context').'
'.
+ ''.&mt('Please display a resource, and then click the "Print" button/icon').'
');
+ my $prtspool=$r->dir_config('lonPrtDir');
+ my $footer = &recently_generated($prtspool);
+ $r->print($footer.&Apache::loncommon::end_page());
+ return OK;
+ }
+
# Generate the first state, to select which resources get printed.
Apache::lonhelper::state->new("START", "Select Printing Options:");
if (!$res_printable) {
@@ -4791,7 +4830,7 @@ CHOOSE_FROM_ANY_SEQUENCE
my $xmlfrag = << "FONT_SELECTION";
-
+
return 'normalsize';