+ '.$/;
+ }
+
+ 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 &&
+ $code_type =~/^(letter|number|-1)/) {
+ $codechoice.=''.$description.'';
+ }
+ }
+ if ($codechoice eq '') {
+ $codechoice='Default';
+ }
+ my $anon1 = &generate_code_selector($helper,
+ 'CHOOSE_ANON1',
+ 'SELECT_PROBLEMS',
+ $codechoice,
+ $code_selection,
+ $namechoice) . $resource_selector;
+
+ &Apache::lonxml::xmlparse($r, 'helper',$anon1);
+
+ my $anon_page = &generate_code_selector($helper,
+ 'CHOOSE_ANON1_PAGE',
+ 'SELECT_PROBLEMS_PAGE',
+ $codechoice,
+ $code_selection,
+ $namechoice) .
+ &generate_resource_chooser('SELECT_PROBLEMS_PAGE',
+ 'Select Problem(s) to print',
+ "multichoice='1' addstatus='1' closeallpages ='1' modallink='1'",
+ 'RESOURCES',
+ 'PRINT_FORMATTING',
+ $url,
+ $isProblem, '', $symbFilter,
+ $start_new_option);
+ &Apache::lonxml::xmlparse($r, 'helper', $anon_page);
+ return ($randomly_ordered_warning,$codechoice,$code_selection,$namechoice);
+}
+
# Returns the XML for choosing how assignments are to be formatted
# that text must still be parsed by the helper xml parser.
# Parameters: 3 (required)
@@ -457,7 +588,9 @@ sub generate_format_selector {
my $secpdfoption;
unless (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'problems_for_anon') ||
($helper->{'VARS'}->{'PRINT_TYPE'} eq 'problems_for_anon_page') ||
- ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'resources_for_anon') ) {
+ ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'resources_for_anon') ||
+ ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'select_sequences_problems_for_anon') ||
+ ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'select_sequences_resources_for_anon')) {
$secpdfoption = 'Each PDF contains exactly one section';
}
return <>$Apache::lonnet::perlvar{'lonPrtDir'}/$env{'user.name'}_$env{'user.domain'}_printout.dat");
+ open(FILE,">>","$Apache::lonnet::perlvar{'lonPrtDir'}/$env{'user.name'}_$env{'user.domain'}_printout.dat");
print FILE ("$file\n");
close (FILE);
@@ -1237,7 +1370,7 @@ sub is_valid_alpha_code {
sub is_code_valid {
my ($code_value, $code_option) = @_;
my ($code_type, $code_length) = ('letter', 6); # defaults.
- my @lines = &Apache::grades::get_scantronformat_file();
+ my @lines = &Apache::lonnet::get_scantronformat_file();
foreach my $line (@lines) {
next if (($line =~ /^\#/) || ($line eq ''));
my ($name, $type, $length) = (split(/:/, $line))[0,2,4];
@@ -1343,8 +1476,8 @@ sub latex_header_footer_remove {
# necessity is determined by the problem_split param.
#
sub encapsulate_minipage {
- my ($text) = @_;
- if (!($env{'form.problem.split'} =~ /yes/i)) {
+ my ($text,$problem_split) = @_;
+ if (!($problem_split =~ /yes/i)) {
$text = '\begin{minipage}{\textwidth}'.$text.'\end{minipage}';
}
return $text;
@@ -1961,7 +2094,7 @@ sub latex_corrections {
$result =~ s/(\\end\{document})/\\strut\\vspace\*{-4 mm}\\newline $copyright $end_of_student $1/;
}
$result =~ s/\$number_of_columns/$number_of_columns/g;
- $result =~ s/(\\end\{longtable}\s*)(\\strut\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill})/$2$1/g;
+ $result =~ s/(\\end\{longtable}\s*)(\\strut\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]\{\\hrulefill})/$2$1/g;
$result =~ s/(\\end\{longtable}\s*)\\strut\\newline/$1/g;
#-- LaTeX corrections
my $first_comment = index($result,' |