--- loncom/interface/lonprintout.pm 2016/08/09 23:43:48 1.649
+++ loncom/interface/lonprintout.pm 2018/01/15 00:51:42 1.661
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.649 2016/08/09 23:43:48 raeburn Exp $
+# $Id: lonprintout.pm,v 1.661 2018/01/15 00:51:42 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -157,7 +157,7 @@ sub create_incomplete_folder_selstud_hel
my $resource_chooser = &generate_resource_chooser('CHOOSE_INCOMPLETE_PEOPLE_SEQ',
'Select problem(s) to print',
- 'multichoice="1" toponly="1" addstatus="1" closeallpages="1"',
+ 'multichoice="1" toponly="1" addstatus="1" closeallpages="1" modallink="1"',
'RESOURCES',
'CHOOSE_STUDENTS_INCOMPLETE',
$map,
@@ -206,7 +206,7 @@ sub create_incomplete_course_helper {
my $resource_chooser = &generate_resource_chooser('INCOMPLETE_PROBLEMS_COURSE_RESOURCES',
'Select problem(s) to print',
- 'multichoice = "1" suppressEmptySequences="0" addstatus="1" closeallpagtes="1"',
+ 'multichoice = "1" suppressEmptySequences="0" addstatus="1" closeallpagtes="1" modallink="1"',
'RESOURCES',
'INCOMPLETE_PROBLEMS_COURSE_STUDENTS',
'',
@@ -252,7 +252,7 @@ sub create_incomplete_folder_helper {
my $resource_chooser = &generate_resource_chooser('CHOOSE_INCOMPLETE_SEQ',
'Select problem(s) to print',
- 'multichoice="1", toponly ="1", addstatus="1", closeallpages="1"',
+ 'multichoice="1", toponly ="1", addstatus="1", closeallpages="1" modallink="1"',
'RESOURCES',
'PAGESIZE',
$map,
@@ -306,7 +306,8 @@ CHOOSE_STUDENTS
# this_state - State name of the chooser.
# prompt_text - Text to use to prompt user.
# resource_options - Resource tag options e.g.
-# "multichoice='1', toponly='1', addstatus='1'"
+# "multichoice='1', toponly='1', addstatus='1',
+# modallink='1'"
# that control the selection and appearance of the
# resource selector.
# variable - Name of the variable to hold the choice
@@ -889,7 +890,7 @@ sub include_pdf {
my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'};
$file =~ s{(.*)/res/}{$londocroot/res/};
- open(FILE,">>$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);
@@ -1976,8 +1977,8 @@ sub latex_corrections {
if ($result =~ m/&(\w+|#\d+);/) {
$result = &character_chart($result);
}
- $result =~ s/(\\end{tabular})\s*\\vskip 0 mm/$1/g;
- $result =~ s/(\\begin{enumerate})\s*\\noindent/$1/g;
+ $result =~ s/(\\end\{tabular})\s*\\vskip 0 mm/$1/g;
+ $result =~ s/(\\begin\{enumerate})\s*\\noindent/$1/g;
return $result;
}
@@ -2586,7 +2587,7 @@ sub print_construction_sequence {
$result .= $texversion;
}
}
- if ($helper->{VARS}->{'construction'} eq '1') {$result=~s/(\\begin{document})/$1 \\fbox\{RANDOM SEED IS $rndseed\} /;}
+ if ($helper->{VARS}->{'construction'} eq '1') {$result=~s/(\\begin\{document})/$1 \\fbox\{RANDOM SEED IS $rndseed\} /;}
return $result;
}
@@ -2743,7 +2744,7 @@ ENDPART
$cleanURL=$currentURL;
}
$selectionmade = 1;
-
+
if ($cleanURL!~m|^/adm/|
&& $cleanURL=~/\.(problem|exam|quiz|assess|survey|form|library|xml|html|htm|xhtml|xhtm)$/) {
my $rndseed=time;
@@ -2847,9 +2848,10 @@ ENDPART
$result = &print_latex_header() . $result;
}
# End construction space sequence.
- } elsif ($cleanURL=~/\/(smppg|syllabus|aboutme|bulletinboard)$/) {
+ } elsif ($cleanURL=~/\/(smppg|syllabus|aboutme|bulletinboard|ext\.tool)$/) {
$form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'};
if ($currentURL=~/\/syllabus$/) {$currentURL=~s/\/res//;}
+ if ($currentURL=~/\/ext\.tool$/) {$currentURL=~s/^\/adm\/wrapper//;}
$resources_printed .= $currentURL.':';
my $texversion = &ssi_with_retries($currentURL, $ssi_retry_count, %form);
if ($helper->{'VARS'}->{'PRINT_ANNOTATIONS'} eq 'yes') {
@@ -2956,6 +2958,7 @@ ENDPART
my $texversion='';
if ($urlp!~m|^/adm/|
&& $urlp=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
+ my $extension = $1;
$resources_printed .= $urlp.':';
&Apache::lonxml::remember_problem_counter();
if ($flag_latex_header_remove eq 'NO') {
@@ -2964,7 +2967,7 @@ ENDPART
(($i==0) &&
(($urlp=~/\.page$/) ||
($print_type eq 'map_problems_in_page') ||
- ($print_type eq 'map_resources_in_page')))) {
+ (($print_type eq 'map_resources_in_page') && ($extension !~ /^x?html?$/))))) {
$flag_latex_header_remove = 'YES';
}
}
@@ -3045,9 +3048,10 @@ ENDPART
}
$result .= $texversion;
$flag_latex_header_remove = 'YES';
- } elsif ($urlp=~/\/(smppg|syllabus|aboutme|bulletinboard)$/) {
+ } elsif ($urlp=~/\/(smppg|syllabus|aboutme|bulletinboard|ext\.tool)$/) {
$form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'};
if ($urlp=~/\/syllabus$/) {$urlp=~s/\/res//;}
+ if ($urlp=~/\/ext\.tool$/) {$urlp=~s/^\/adm\/wrapper//;}
$resources_printed .= $urlp.':';
my $texversion = &ssi_with_retries($urlp, $ssi_retry_count, %form);
if ($helper->{'VARS'}->{'PRINT_ANNOTATIONS'} eq 'yes') {
@@ -3447,7 +3451,13 @@ ENDPART
$URLback=$helper->{'VARS'}->{'filename'};
} elsif ($helper->{VARS}{'symb'}) {
my ($map, $id, $url) = &Apache::lonnet::decode_symb($helper->{VARS}{'symb'});
- $URLback = &Apache::lonnet::clutter($url);
+ $url = &Apache::lonnet::clutter($url);
+ if ($env{'request.enc'}) {
+ $url = &Apache::lonenc::encrypted($url);
+ }
+ if ($url ne '') {
+ $URLback = $url.(($url =~ /\?/) ? '&':'?').'symb='.$helper->{VARS}{'symb'};
+ }
}
#
# Final adjustment of the font size:
@@ -3531,7 +3541,7 @@ ENDPART
'cgi.'.$identifier.'.role' => $perm{'pav'},
'cgi.'.$identifier.'.numberoffiles' => $#print_array,
'cgi.'.$identifier.'.studentnames' => $student_names,
- 'cgi.'.$identifier.'.backref' => $URLback,});
+ 'cgi.'.$identifier.'.backref' => &escape($URLback),});
&Apache::lonnet::appenv({"cgi.$identifier.user" => $env{'user.name'},
"cgi.$identifier.domain" => $env{'user.domain'},
"cgi.$identifier.courseid" => $cnum,
@@ -3714,7 +3724,7 @@ sub print_resources {
$rendered =~ s/\\end\{document}//;
}
$current_output .= $rendered;
- } elsif ($res_url=~/\/(smppg|syllabus|aboutme|bulletinboard)$/) {
+ } elsif ($res_url=~/\/(smppg|syllabus|aboutme|bulletinboard|ext\.tool)$/) {
if ($i == 1) {
$syllabus_first = 1;
}
@@ -4205,7 +4215,7 @@ sub printHelper {
}
my $helperFragment = &generate_resource_chooser('CHOOSE_PROBLEMS_PAGE',
'Select Problem(s) to print',
- "multichoice='1' toponly='1' addstatus='1' closeallpages='1'",
+ "multichoice='1' toponly='1' addstatus='1' closeallpages='1' modallink='1'",
'RESOURCES',
'PAGESIZE',
$url,
@@ -4215,7 +4225,7 @@ sub printHelper {
$helperFragment .= &generate_resource_chooser('CHOOSE_RESOURCES_PAGE',
'Select Resource(s) to print',
- 'multichoice="1" toponly="1" addstatus="1" closeallpages="1"',
+ 'multichoice="1" toponly="1" addstatus="1" closeallpages="1" modallink="1"',
'RESOURCES',
'PAGESIZE',
$url,
@@ -4280,7 +4290,7 @@ sub printHelper {
'CHOOSE_PROBLEMS_HTML'];
my $helperFragment = &generate_resource_chooser('CHOOSE_PROBLEMS',
'Select Problem(s) to print',
- 'multichoice="1" toponly="1" addstatus="1" closeallpages="1"',
+ 'multichoice="1" toponly="1" addstatus="1" closeallpages="1" modallink="1"',
'RESOURCES',
'PAGESIZE',
$map,
@@ -4289,7 +4299,7 @@ sub printHelper {
$start_new_option);
$helperFragment .= &generate_resource_chooser('CHOOSE_PROBLEMS_HTML',
'Select Resource(s) to print',
- 'multichoice="1" toponly="1" addstatus="1" closeallpages="1"',
+ 'multichoice="1" toponly="1" addstatus="1" closeallpages="1" modallink="1"',
'RESOURCES',
'PAGESIZE',
$map,
@@ -4337,7 +4347,7 @@ ALL_PROBLEMS
&Apache::lonxml::xmlparse($r, 'helper',
&generate_resource_chooser('ALL_PROBLEMS',
'Select Problem(s) to print',
- 'multichoice="1" suppressEmptySequences="0" addstatus="1" closeallpages="1"',
+ 'multichoice="1" suppressEmptySequences="0" addstatus="1" closeallpages="1" modallink="1"',
'RESOURCES',
'PAGESIZE',
'',
@@ -4346,7 +4356,7 @@ ALL_PROBLEMS
$start_new_option) .
&generate_resource_chooser('ALL_RESOURCES',
'Select Resource(s) to print',
- " toponly='0' multichoice='1' suppressEmptySequences='0' addstatus='1' closeallpages='1'",
+ " toponly='0' multichoice='1' suppressEmptySequences='0' addstatus='1' closeallpages='1' modallink='1'",
'RESOURCES',
'PAGESIZE',
'',
@@ -4354,7 +4364,7 @@ ALL_PROBLEMS
$start_new_option) .
&generate_resource_chooser('ALL_PROBLEMS_STUDENTS',
'Select Problem(s) to print',
- 'toponly="0" multichoice="1" suppressEmptySequences="0" addstatus="1" closeallpages="1"',
+ 'toponly="0" multichoice="1" suppressEmptySequences="0" addstatus="1" closeallpages="1" modallink="1"',
'RESOURCES',
'STUDENTS1',
'',
@@ -4398,7 +4408,7 @@ ALL_PROBLEMS
#
my $resource_selector= &generate_resource_chooser('SELECT_PROBLEMS',
'Select resources to print',
- 'multichoice="1" addstatus="1" closeallpages="1"',
+ 'multichoice="1" addstatus="1" closeallpages="1" modallink="1"',
'RESOURCES',
'PRINT_FORMATTING',
$map,
@@ -4409,7 +4419,7 @@ ALL_PROBLEMS
'PRINT_FORMATTING').
&generate_resource_chooser('CHOOSE_STUDENTS_PAGE',
'Select Problem(s) to print',
- "multichoice='1' addstatus='1' closeallpages ='1'",
+ "multichoice='1' addstatus='1' closeallpages ='1' modallink='1'",
'RESOURCES',
'PRINT_FORMATTING',
$url,
@@ -4508,7 +4518,7 @@ ALL_PROBLEMS
$namechoice) .
&generate_resource_chooser('SELECT_PROBLEMS_PAGE',
'Select Problem(s) to print',
- "multichoice='1' addstatus='1' closeallpages ='1'",
+ "multichoice='1' addstatus='1' closeallpages ='1' modallink='1'",
'RESOURCES',
'PRINT_FORMATTING',
$url,
@@ -4532,7 +4542,7 @@ ALL_PROBLEMS
PRINT_FORMATTING
Select resources for the assignment
+ closeallpages="1" modallink="1">
return $isNotMap;
$map
return $symbFilter;
@@ -4677,7 +4687,7 @@ CHOOSE_FROM_SUBDIR
(mark desired resources then click "next" button)
+ closeallpages="1" modallink="1">
PAGESIZE
return $isNotMap
return '$escapedSequenceName';