version 1.627.2.32.2.8, 2025/01/16 06:01:09
|
version 1.704, 2024/11/11 03:20:46
|
Line 812 sub map_print_dates {
|
Line 812 sub map_print_dates {
|
# Parameters: |
# Parameters: |
# $username - Name of user for whom we are checking. |
# $username - Name of user for whom we are checking. |
# $domain - Domain of user we are checking. |
# $domain - Domain of user we are checking. |
# $section - Section for user for whom we are checking. |
|
# $map - map name. |
# $map - map name. |
# Returns: |
# Returns: |
# 0 - map is not incomplete. |
# 0 - map is not incomplete. |
# 1 - map is incomplete. |
# 1 - map is incomplete. |
# |
# |
sub incomplete { |
sub incomplete { |
my ($username, $domain, $section, $map) = @_; |
my ($username, $domain, $map) = @_; |
|
|
|
|
my $navmap = Apache::lonnavmaps::navmap->new($username, $domain, $section); |
my $navmap = Apache::lonnavmaps::navmap->new($username, $domain); |
|
|
|
|
if (defined($navmap)) { |
if (defined($navmap)) { |
Line 879 sub master_seq_to_person_seq {
|
Line 878 sub master_seq_to_person_seq {
|
} |
} |
|
|
my $navmap = Apache::lonnavmaps::navmap->new($username, $userdomain, |
my $navmap = Apache::lonnavmaps::navmap->new($username, $userdomain, |
$usersection, $code, $unhidden); |
$code, $unhidden); |
my ($start,$finish); |
my ($start,$finish); |
|
|
if ($map) { |
if ($map) { |
Line 906 sub master_seq_to_person_seq {
|
Line 905 sub master_seq_to_person_seq {
|
# Only process resources..that are not removed by randomout... |
# Only process resources..that are not removed by randomout... |
# and are selected for printint as well. |
# and are selected for printint as well. |
# |
# |
|
|
if (ref($curres) && ! $curres->randomout()) { |
if (ref($curres) && ! $curres->randomout()) { |
my $currsymb = $curres->symb(); |
my $currsymb = $curres->symb(); |
if (exists($seq_hash{$currsymb})) { |
if (exists($seq_hash{$currsymb})) { |
Line 981 sub set_font_size {
|
Line 979 sub set_font_size {
|
if ($font_size ne '') { |
if ($font_size ne '') { |
|
|
$text =~ s/\\begin\{document}/\\begin{document}{\\$font_size/; |
$text =~ s/\\begin\{document}/\\begin{document}{\\$font_size/; |
$text =~ s/\\end\{document}/}\\end{document}/; |
$text =~ s/\\end\{document}/}\\end{document}/; |
|
|
} |
} |
return $text; |
return $text; |
|
|
Line 1198 sub format_page_header {
|
Line 1197 sub format_page_header {
|
|
|
|
|
$width = &recalcto_mm($width); # Get width in mm. |
$width = &recalcto_mm($width); # Get width in mm. |
my $chars_per_line = int($width/2); # Character/textline. |
my $chars_per_line = int($width/1.6); # Character/textline. |
|
|
# Default format? |
# Default format? |
|
|
Line 1214 sub format_page_header {
|
Line 1213 sub format_page_header {
|
# - Allow the assignment to be 2 lines (wrapped). |
# - Allow the assignment to be 2 lines (wrapped). |
# |
# |
|
|
my $firstline = "$student $course"; |
|
if (length($firstline) > $chars_per_line) { |
|
my $lastchar = $chars_per_line - length($student) - 1; |
|
if ($lastchar > 0) { |
|
$course = substr($course, 0, $lastchar); |
|
} else { # Nothing left of course: |
|
$course = ''; |
|
} |
|
} |
|
if (length($assignment) > $chars_per_line) { |
|
$assignment = substr($assignment, 0, $chars_per_line); |
|
} |
|
|
|
$format = "\\textbf{$student} $course \\hfill \\thepage \\\\ \\textit{$assignment}"; |
my $name_length = int($chars_per_line *3 /4); |
|
my $sec_length = int($chars_per_line / 5); |
|
|
|
$format = "%$name_length".'n'; |
|
|
|
if ($section) { |
|
$format .= ' - Sec: '."%$sec_length".'s'; |
|
} |
|
$format .= '\\hfill\\thepage'; |
|
|
|
$format .= '\\\\%c \\\\ %a'; |
|
|
} else { |
|
# An open question is how to handle long user formatted page headers... |
|
# A possible future is to support e.g. %na so that the user can control |
|
# the truncation of the elements that can appear in the header. |
|
# |
|
$format = &printf_style_subst("a", $format, $assignment); |
|
$format = &printf_style_subst("c", $format, $course); |
|
$format = &printf_style_subst("n", $format, $student); |
|
|
|
# If the user put %'s in the format string, they must be escaped |
|
# to \% else LaTeX will think they are comments and terminate |
|
# the line.. which is bad!!! |
|
|
|
} |
} |
|
# An open question is how to handle long user formatted page headers... |
|
# A possible future is to support e.g. %na so that the user can control |
|
# the truncation of the elements that can appear in the header. |
|
# |
|
$format = &printf_style_subst("a", $format, $assignment); |
|
$format = &printf_style_subst("c", $format, $course); |
|
$format = &printf_style_subst("n", $format, $student); |
|
$format = &printf_style_subst("s", $format, $section); |
|
|
|
|
|
# If the user put %'s in the format string, they must be escaped |
|
# to \% else LaTeX will think they are comments and terminate |
|
# the line.. which is bad!!! |
|
|
# If the user has role author, $course and $assignment are empty so |
# If the user has role author, $course and $assignment are empty so |
# there is '\\ \\ ' in the page header. That's cause a error in LaTeX |
# there is '\\ \\ ' in the page header. That's cause a error in LaTeX |
Line 1251 sub format_page_header {
|
Line 1250 sub format_page_header {
|
my $testPrintout = '\\\\'.&mt('Authoring Space').' \\\\'.&mt('Test-Printout '); |
my $testPrintout = '\\\\'.&mt('Authoring Space').' \\\\'.&mt('Test-Printout '); |
$format =~ s/\\\\\s\\\\\s/$testPrintout/; |
$format =~ s/\\\\\s\\\\\s/$testPrintout/; |
} |
} |
|
|
return $format; |
|
|
|
# |
# |
# We're going to trust LaTeX to break lines appropriately, but |
# We're going to trust LaTeX to break lines appropriately, but |
# we'll truncate anything that's more than 3 lines worth of |
# we'll truncate anything that's more than 3 lines worth of |
Line 1982 sub get_course {
|
Line 1978 sub get_course {
|
my $courseidinfo; |
my $courseidinfo; |
if (defined($env{'request.course.id'})) { |
if (defined($env{'request.course.id'})) { |
$courseidinfo = &Apache::lonxml::latex_special_symbols(&unescape($env{'course.'.$env{'request.course.id'}.'.description'}),'header'); |
$courseidinfo = &Apache::lonxml::latex_special_symbols(&unescape($env{'course.'.$env{'request.course.id'}.'.description'}),'header'); |
|
my $sec = $env{'request.course.sec'}; |
|
|
} |
} |
return $courseidinfo; |
return $courseidinfo; |
} |
} |
Line 2002 sub page_format_transformation {
|
Line 2000 sub page_format_transformation {
|
} |
} |
($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin) = &page_format($papersize,$layout,$numberofcolumns,$topmargin); |
($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin) = &page_format($papersize,$layout,$numberofcolumns,$topmargin); |
|
|
|
|
my $name; |
my $name; |
if ($mostrecent ne '') { |
if ($mostrecent ne '') { |
$name = $mostrecent; |
$name = $mostrecent; |
Line 2010 sub page_format_transformation {
|
Line 2007 sub page_format_transformation {
|
$name = &get_name(); |
$name = &get_name(); |
} |
} |
my $courseidinfo = &get_course(); |
my $courseidinfo = &get_course(); |
if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo } |
|
my $header_text = $parmhash{'print_header_format'}; |
my $header_text = $parmhash{'print_header_format'}; |
$header_text = &format_page_header($textwidth, $header_text, $assignment, |
$header_text = &format_page_header($textwidth, $header_text, $assignment, |
$courseidinfo, $name); |
$courseidinfo, $name); |
Line 2019 sub page_format_transformation {
|
Line 2015 sub page_format_transformation {
|
my $fancypagestatement=''; |
my $fancypagestatement=''; |
if ($numberofcolumns eq '2') { |
if ($numberofcolumns eq '2') { |
$fancypagestatement="\\fancyhead{}\\fancyhead[LO]{$header_text}"; |
$fancypagestatement="\\fancyhead{}\\fancyhead[LO]{$header_text}"; |
if ($parmhash{'print_header_format'} eq '') { |
if ($parmhash{'print_header_format'} eq '') { |
$fancypagestatement .= "\\fancyhead[RE]{\\thepage \\\\}"; |
$fancypagestatement .= "\\fancyhead[RE]{\\thepage \\\\[\\baselineskip]}"; |
} |
} |
} else { |
} else { |
$fancypagestatement="\\rhead{}\\chead{}\\lhead{$header_text}"; |
$fancypagestatement="\\rhead{}\\chead{}\\lhead{$header_text}"; |
} |
} |
Line 2348 sub print_page_in_course {
|
Line 2344 sub print_page_in_course {
|
|
|
$form{'grade_target'} = 'tex'; |
$form{'grade_target'} = 'tex'; |
$form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); |
$form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); |
$form{'pdfFormFields'} = 'no'; # |
$form{'pdfFormFields'} = $pdfFormFields; # |
$form{'showallfoils'} = $helper->{'VARS'}->{'showallfoils'}; |
$form{'showallfoils'} = $helper->{'VARS'}->{'showallfoils'}; |
|
|
$form{'problem_split'}=$parmhash{'problem_stream_switch'}; |
$form{'problem_split'}=$parmhash{'problem_stream_switch'}; |
Line 2405 sub print_page_in_course {
|
Line 2401 sub print_page_in_course {
|
$texversion.=&path_to_problem($urlp,$LaTeXwidth); |
$texversion.=&path_to_problem($urlp,$LaTeXwidth); |
} |
} |
$texversion.='\vskip 1 mm '.$answer.'\end{document}'; |
$texversion.='\vskip 1 mm '.$answer.'\end{document}'; |
} |
} |
} |
} |
# Print annotations. |
# Print annotations. |
|
|
|
|
Line 2880 ENDPART
|
Line 2876 ENDPART
|
my %form; |
my %form; |
$form{'grade_target'} = 'tex'; |
$form{'grade_target'} = 'tex'; |
$form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); |
$form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); |
$form{'pdfFormFields'} = 'no'; |
$form{'pdfFormFields'} = $pdfFormFields; |
|
|
# If form.showallfoils is set, then request all foils be shown: |
# If form.showallfoils is set, then request all foils be shown: |
# privilege will be enforced both by not allowing the |
# privilege will be enforced both by not allowing the |
Line 2986 ENDPART
|
Line 2982 ENDPART
|
} |
} |
|
|
|
|
|
|
|
|
|
|
} |
} |
Line 3204 ENDPART
|
Line 3200 ENDPART
|
if (($selectionmade == 4) and ($assignment ne $prevassignment)) { |
if (($selectionmade == 4) and ($assignment ne $prevassignment)) { |
my $name = &get_name(); |
my $name = &get_name(); |
my $courseidinfo = &get_course(); |
my $courseidinfo = &get_course(); |
if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo } |
|
$prevassignment=$assignment; |
$prevassignment=$assignment; |
my $header_text = $parmhash{'print_header_format'}; |
my $header_text = $parmhash{'print_header_format'}; |
$header_text = &format_page_header($textwidth, $header_text, |
$header_text = &format_page_header($textwidth, $header_text, |
Line 3857 sub print_resources {
|
Line 3852 sub print_resources {
|
my $assignment; |
my $assignment; |
my $courseidinfo = &get_course(); |
my $courseidinfo = &get_course(); |
my $possprint = scalar(@{$master_seq}); |
my $possprint = scalar(@{$master_seq}); |
if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo } |
|
if ($usersection ne '') {$courseidinfo.=' - Sec. '.$usersection} |
|
|
|
foreach my $curresline (@{$master_seq}) { |
foreach my $curresline (@{$master_seq}) { |
if (defined $page_breaks{$curresline}) { |
if (defined $page_breaks{$curresline}) { |
Line 3874 sub print_resources {
|
Line 3867 sub print_resources {
|
|
|
if ( !($type eq 'problems' && |
if ( !($type eq 'problems' && |
($curresline!~ m/$LONCAPA::assess_page_re/)) ) { |
($curresline!~ m/$LONCAPA::assess_page_re/)) ) { |
if ($print_incomplete && !&incomplete($username, $userdomain, $usersection, $res_url)) { |
if ($print_incomplete && !&incomplete($username, $userdomain, $res_url)) { |
next; |
next; |
} |
} |
$actually_printed++; # we're going to print one. |
$actually_printed++; # we're going to print one. |
Line 3892 sub print_resources {
|
Line 3885 sub print_resources {
|
$rendered = &print_latex_header().$rendered; |
$rendered = &print_latex_header().$rendered; |
} |
} |
} |
} |
|
; |
if ($remove_latex_header eq 'YES') { |
if ($remove_latex_header eq 'YES') { |
$rendered = &latex_header_footer_remove($rendered); |
$rendered = &latex_header_footer_remove($rendered); |
} else { |
} else { |
Line 3906 sub print_resources {
|
Line 3900 sub print_resources {
|
|
|
|
|
$answerenv{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; |
$answerenv{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; |
|
|
&Apache::lonxml::restore_problem_counter(); |
&Apache::lonxml::restore_problem_counter(); |
|
|
my $ansrendered = &Apache::loncommon::get_student_answers($curresline,$username,$userdomain,$env{'request.course.id'},%answerenv); |
my $ansrendered = &Apache::loncommon::get_student_answers($curresline,$username,$userdomain,$env{'request.course.id'},%answerenv); |
Line 4013 sub print_resources {
|
Line 4007 sub print_resources {
|
$message = &mt('No incomplete resources'); |
$message = &mt('No incomplete resources'); |
} |
} |
if ($message) { |
if ($message) { |
$current_output = &encapsulate_minipage("\\vskip -10mm \n$message\n \\vskip 100 mm { }\n",$moreenv->{'problem_split'}); |
$current_output = &encapsulate_minipage("\\vskip -10mm \n$message\n \\vskip 100 mm { }\n",$moreenv->{'problem_split'}); |
} |
} |
if ($remove_latex_header eq "NO") { |
if ($remove_latex_header eq "NO") { |
$current_output = &print_latex_header() . $current_output; |
$current_output = &print_latex_header() . $current_output; |
Line 4027 sub print_resources {
|
Line 4021 sub print_resources {
|
} |
} |
my $currentassignment=&Apache::lonxml::latex_special_symbols($helper->{VARS}->{'assignment'},'header'); |
my $currentassignment=&Apache::lonxml::latex_special_symbols($helper->{VARS}->{'assignment'},'header'); |
my $header_line = |
my $header_line = |
&format_page_header($LaTeXwidth, $parmhash{'print_header_format'}, |
&format_page_header($LaTeXwidth, $parmhash{'print_header_format'}, |
$currentassignment, $courseidinfo, $fullname, $usersection); |
$currentassignment, $courseidinfo, $fullname, $usersection); |
my $header_start = ($columns_in_format == 1) ? '\lhead' : '\fancyhead[LO]'; |
my $header_start = ($columns_in_format == 1) ? '\lhead' : '\fancyhead[LO]'; |
my $newheader = $header_start.'{'.$header_line.'}'; |
my $newheader = $header_start.'{'.$header_line.'}'; |
|
|
if ($current_output=~/\\documentclass/) { |
if ($current_output=~/\\documentclass/) { |
$current_output =~ s/\\begin\{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent$newheader$namepostfix}\\vskip 5 mm /; |
$current_output =~ s/\\begin\{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent$newheader$namepostfix}\\vskip 5 mm /; |
|
|
} else { |
} else { |
my $blankpages = |
my $blankpages = |
'\clearpage\strut\clearpage'x$helper->{'VARS'}->{'EMPTY_PAGES'}; |
'\clearpage\strut\clearpage'x$helper->{'VARS'}->{'EMPTY_PAGES'}; |
Line 4042 sub print_resources {
|
Line 4036 sub print_resources {
|
©right_line().' \newpage '.$blankpages.$end_of_student. |
©right_line().' \newpage '.$blankpages.$end_of_student. |
'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent'. |
'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent'. |
$newheader.$namepostfix. '} \vskip 5 mm '.$current_output; |
$newheader.$namepostfix. '} \vskip 5 mm '.$current_output; |
|
|
} |
} |
# |
# |
# Close the student bracketing. |
# Close the student bracketing. |
Line 4108 sub handler {
|
Line 4103 sub handler {
|
unlink $conversion_queuefile; |
unlink $conversion_queuefile; |
} |
} |
|
|
|
|
&output_data($r,$helper,\%parmhash); |
&output_data($r,$helper,\%parmhash); |
return OK; |
return OK; |
} |
} |
Line 4242 sub printHelper {
|
Line 4236 sub printHelper {
|
|
|
} |
} |
} |
} |
|
|
} |
} |
|
|
# Detect whether we're coming from construction space |
# Detect whether we're coming from construction space |
Line 4299 sub printHelper {
|
Line 4294 sub printHelper {
|
} |
} |
if ($sequenceTitle ne '') {$helper->{VARS}->{'assignment'}=$sequenceTitle;} |
if ($sequenceTitle ne '') {$helper->{VARS}->{'assignment'}=$sequenceTitle;} |
|
|
|
|
# Extract map |
# Extract map |
my $symb = $helper->{VARS}->{'symb'}; |
my $symb = $helper->{VARS}->{'symb'}; |
my ($map, $id, $url); |
my ($map, $id, $url); |
Line 4342 sub printHelper {
|
Line 4336 sub printHelper {
|
if (ref($navmap)) { |
if (ref($navmap)) { |
my $res; |
my $res; |
if ($symb ne '') { |
if ($symb ne '') { |
$res = $navmap->getBySymb($symb); |
$res = $navmap->getBySymb($symb); |
} elsif ($map ne '') { |
} elsif ($map ne '') { |
$res = $navmap->getResourceByUrl($map); |
$res = $navmap->getResourceByUrl($map); |
} |
} |
Line 4410 sub printHelper {
|
Line 4404 sub printHelper {
|
# Give that as a choice. |
# Give that as a choice. |
|
|
if ($resourceTitle && $res_printable) { |
if ($resourceTitle && $res_printable) { |
push(@{$printChoices}, ["<b><i>$resourceTitle</i></b> (".&mt('the resource you just saw on the screen').")", 'current_document', 'PAGESIZE']); |
push @{$printChoices}, ["<b><i>$resourceTitle</i></b> (".&mt('the resource you just saw on the screen').")", 'current_document', 'PAGESIZE']; |
} |
} |
|
|
# Useful filter strings |
# Useful filter strings |
Line 4464 sub printHelper {
|
Line 4458 sub printHelper {
|
my $resourcesymb = $page_resources[0]->symb(); |
my $resourcesymb = $page_resources[0]->symb(); |
my ($pagemap, $pageid, $pageurl) = &Apache::lonnet::decode_symb($symb); |
my ($pagemap, $pageid, $pageurl) = &Apache::lonnet::decode_symb($symb); |
if ($page_ispage) { |
if ($page_ispage) { |
push(@{$printChoices}, |
push @{$printChoices}, |
[&mt('Selected [_1]Problems[_2] from page [_3]', '<b>', '</b>', '<b><i>'.$page_title.'</i></b>'), |
[&mt('Selected [_1]Problems[_2] from page [_3]', '<b>', '</b>', '<b><i>'.$page_title.'</i></b>'), |
'map_problems_in_page', |
'map_problems_in_page', |
'CHOOSE_PROBLEMS_PAGE']); |
'CHOOSE_PROBLEMS_PAGE']; |
push(@{$printChoices}, |
push @{$printChoices}, |
[&mt('Selected [_1]Resources[_2] from page [_3]', '<b>', '</b>', '<b><i>'.$page_title.'</i></b>'), |
[&mt('Selected [_1]Resources[_2] from page [_3]', '<b>', '</b>', '<b><i>'.$page_title.'</i></b>'), |
'map_resources_in_page', |
'map_resources_in_page', |
'CHOOSE_RESOURCES_PAGE']); |
'CHOOSE_RESOURCES_PAGE']; |
} |
} |
my $helperFragment = &generate_resource_chooser('CHOOSE_PROBLEMS_PAGE', |
my $helperFragment = &generate_resource_chooser('CHOOSE_PROBLEMS_PAGE', |
'Select Problem(s) to print', |
'Select Problem(s) to print', |
Line 4555 sub printHelper {
|
Line 4549 sub printHelper {
|
} else { |
} else { |
$optionText = &mt('Selected [_1]Problems[_2] from folder [_3]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>'); |
$optionText = &mt('Selected [_1]Problems[_2] from folder [_3]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>'); |
} |
} |
push(@{$printChoices}, |
push @{$printChoices}, |
[$optionText, |
[$optionText, |
'map_problems', |
'map_problems', |
'CHOOSE_PROBLEMS']); |
'CHOOSE_PROBLEMS']; |
# Allow all resources from sequence |
# Allow all resources from sequence |
if ($helper->{VARS}->{'postdata'} eq '/adm/navmaps') { |
if ($helper->{VARS}->{'postdata'} eq '/adm/navmaps') { |
$optionText = &mt('Selected [_1]Resources[_2] [_3]not in a folder[_4]','<b>','</b>','<i>','</i>'); |
$optionText = &mt('Selected [_1]Resources[_2] [_3]not in a folder[_4]','<b>','</b>','<i>','</i>'); |
} else { |
} else { |
$optionText = &mt('Selected [_1]Resources[_2] from folder [_3]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>'); |
$optionText = &mt('Selected [_1]Resources[_2] from folder [_3]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>'); |
} |
} |
push(@{$printChoices}, [$optionText, |
push @{$printChoices}, [$optionText, |
'map_problems_pages', |
'map_problems_pages', |
'CHOOSE_PROBLEMS_HTML']); |
'CHOOSE_PROBLEMS_HTML']; |
my $helperFragment = &generate_resource_chooser('CHOOSE_PROBLEMS', |
my $helperFragment = &generate_resource_chooser('CHOOSE_PROBLEMS', |
'Select Problem(s) to print', |
'Select Problem(s) to print', |
'multichoice="1" toponly="1" addstatus="1" closeallpages="1" modallink="1" nocurrloc="'.$nocurrloc.'"', |
'multichoice="1" toponly="1" addstatus="1" closeallpages="1" modallink="1" nocurrloc="'.$nocurrloc.'"', |
Line 4611 sub printHelper {
|
Line 4605 sub printHelper {
|
|
|
# Selected problems/resources from entire course: |
# Selected problems/resources from entire course: |
|
|
push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from [_3]entire course[_4]','<b>','</b>','<b>','</b>'), 'all_problems', 'ALL_PROBLEMS']); |
push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from [_3]entire course[_4]','<b>','</b>','<b>','</b>'), 'all_problems', 'ALL_PROBLEMS']; |
push(@{$printChoices}, [&mt('Selected [_1]Resources[_2] from [_3]entire course[_4]','<b>','</b>','<b>','</b>'), 'all_resources', 'ALL_RESOURCES']); |
push @{$printChoices}, [&mt('Selected [_1]Resources[_2] from [_3]entire course[_4]','<b>','</b>','<b>','</b>'), 'all_resources', 'ALL_RESOURCES']; |
push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from [_3]entire course[_4] for [_5]selected people[_6]','<b>','</b>','<b>','</b>','<b>','</b>'), 'all_problems_students', 'ALL_PROBLEMS_STUDENTS']); |
push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from [_3]entire course[_4] for [_5]selected people[_6]','<b>','</b>','<b>','</b>','<b>','</b>'), 'all_problems_students', 'ALL_PROBLEMS_STUDENTS']; |
my $suffixXml = <<ALL_PROBLEMS; |
my $suffixXml = <<ALL_PROBLEMS; |
<state name="STUDENTS1" title="Select People"> |
<state name="STUDENTS1" title="Select People"> |
<message><b>Select sorting order of printout</b> </message> |
<message><b>Select sorting order of printout</b> </message> |
Line 4660 ALL_PROBLEMS
|
Line 4654 ALL_PROBLEMS
|
# either for selected students or for coded assignments. |
# either for selected students or for coded assignments. |
|
|
if ($page_ispage) { |
if ($page_ispage) { |
push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3] for [_4]selected people[_5]', |
push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3] for [_4]selected people[_5]', |
'<b>', '</b>', '<b><i>'.$page_title.'</i></b>', '<b>', '</b>'), |
'<b>', '</b>', '<b><i>'.$page_title.'</i></b>', '<b>', '</b>'), |
'problems_for_students_from_page', 'CHOOSE_TGT_STUDENTS_PAGE']); |
'problems_for_students_from_page', 'CHOOSE_TGT_STUDENTS_PAGE']; |
push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3] for [_4]CODEd assignments[_5]', |
push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3] for [_4]CODEd assignments[_5]', |
'<b>', '</b>', '<b><i>'.$page_title.'</i></b>', '<b>', '</b>'), |
'<b>', '</b>', '<b><i>'.$page_title.'</i></b>', '<b>', '</b>'), |
'problems_for_anon_page', 'CHOOSE_ANON1_PAGE']); |
'problems_for_anon_page', 'CHOOSE_ANON1_PAGE']; |
} |
} |
push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]selected people[_5]', |
push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]selected people[_5]', |
'<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'), |
'<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'), |
'problems_for_students', 'CHOOSE_STUDENTS']); |
'problems_for_students', 'CHOOSE_STUDENTS']; |
push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]CODEd assignments[_5]', |
push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]CODEd assignments[_5]', |
'<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'), |
'<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'), |
'problems_for_anon', 'CHOOSE_ANON1']); |
'problems_for_anon', 'CHOOSE_ANON1']; |
} |
} |
|
|
my ($randomly_ordered_warning,$codechoice,$code_selection,$namechoice) = |
my ($randomly_ordered_warning,$codechoice,$code_selection,$namechoice) = |
Line 4682 ALL_PROBLEMS
|
Line 4676 ALL_PROBLEMS
|
|
|
# Assignment printing: |
# Assignment printing: |
|
|
push(@{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3] for [_4]selected people[_5]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'), 'resources_for_students', 'CHOOSE_STUDENTS1']); |
push @{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3] for [_4]selected people[_5]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'), 'resources_for_students', 'CHOOSE_STUDENTS1']; |
push(@{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3] for [_4]CODEd assignments[_5]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'), 'resources_for_anon', 'CHOOSE_ANON2']); |
push @{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3] for [_4]CODEd assignments[_5]','<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'), 'resources_for_anon', 'CHOOSE_ANON2']; |
} |
} |
|
|
# resource_selector will hold a few states that: |
# resource_selector will hold a few states that: |
Line 4792 CHOOSE_ANON2
|
Line 4786 CHOOSE_ANON2
|
} |
} |
|
|
# FIXME: That RE should come from a library somewhere. |
# FIXME: That RE should come from a library somewhere. |
if (($perm{'pav'} |
if (($perm{'pav'} |
&& ($subdir ne '') |
&& ($subdir ne '') |
&& $subdir ne $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/' |
&& $subdir ne $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/' |
&& (defined($helper->{'VARS'}->{'construction'}) |
&& (defined($helper->{'VARS'}->{'construction'}) |
|| |
|| |
(&Apache::lonnet::allowed('bre',$subdir) eq 'F' |
(&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}->{'postdata'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)/) |
)) |
)) |
&& $helper->{VARS}->{'assignment'} eq "" |
&& $helper->{VARS}->{'assignment'} eq "" |
) { |
) { |
my $pretty_dir = &Apache::lonnet::hreflocation($subdir); |
my $pretty_dir = &Apache::lonnet::hreflocation($subdir); |
push(@{$printChoices}, [&mt('Selected [_1]Problems[_2] from current subdirectory [_3]','<b>','</b>','<b><i>'.$pretty_dir.'</i></b>','<b>','</b>'), 'problems_from_directory', 'CHOOSE_FROM_SUBDIR']); |
push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from current subdirectory [_3]','<b>','</b>','<b><i>'.$pretty_dir.'</i></b>','<b>','</b>'), 'problems_from_directory', 'CHOOSE_FROM_SUBDIR']; |
my $xmlfrag = <<CHOOSE_FROM_SUBDIR; |
my $xmlfrag = <<CHOOSE_FROM_SUBDIR; |
<state name="CHOOSE_FROM_SUBDIR" title="Select File(s) from <b><small>$pretty_dir</small></b> to print"> |
<state name="CHOOSE_FROM_SUBDIR" title="Select File(s) from <b><small>$pretty_dir</small></b> to print"> |
|
|
Line 5038 CHOOSE_FROM_ANY_SEQUENCE
|
Line 5032 CHOOSE_FROM_ANY_SEQUENCE
|
|
|
if ($noprintmsg) { |
if ($noprintmsg) { |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash->{MESSAGE_TEXT} = |
$paramHash->{MESSAGE_TEXT} = |
'<p class="LC_info">'.$noprintmsg.'</p>'; |
'<p class="LC_info">'.$noprintmsg.'</p>'; |
Apache::lonhelper::message->new(); |
Apache::lonhelper::message->new(); |
} |
} |
} |
} |
$paramHash = Apache::lonhelper::getParamHash(); |
$paramHash = Apache::lonhelper::getParamHash(); |
Line 5055 CHOOSE_FROM_ANY_SEQUENCE
|
Line 5049 CHOOSE_FROM_ANY_SEQUENCE
|
my $startedTable = 0; # have we started an HTML table yet? (need |
my $startedTable = 0; # have we started an HTML table yet? (need |
# to close it later) |
# to close it later) |
|
|
if (($perm{'pav'} and $perm{'vgr'}) or |
if (($perm{'pav'} and $perm{'vgr'}) or |
($helper->{VARS}->{'construction'} eq '1')) { |
($helper->{VARS}->{'construction'} eq '1')) { |
&addMessage('<br />' |
&addMessage('<br />' |
.'<h3>'.&mt('Print Options').'</h3>' |
.'<h3>'.&mt('Print Options').'</h3>' |
Line 5265 FONT_SELECTION
|
Line 5259 FONT_SELECTION
|
return "$helper->{VARS}->{'probstatus'}"; |
return "$helper->{VARS}->{'probstatus'}"; |
</defaultvalue> |
</defaultvalue> |
<choice computer="problem">Homework Problem</choice> |
<choice computer="problem">Homework Problem</choice> |
<choice computer="exam">Exam Problem</choice> |
<choice computer="exam">Bubblesheet Exam Problem</choice> |
<choice computer="survey">Survey question</choice> |
<choice computer="survey">Survey question</choice> |
,choice computer="anonsurvey"Anonymous survey question</choice> |
,choice computer="anonsurvey"Anonymous survey question</choice> |
</dropdown> |
</dropdown> |
Line 5383 sub render {
|
Line 5377 sub render {
|
my $PaperType=&mt('Paper type'); |
my $PaperType=&mt('Paper type'); |
my $landscape=&mt('Landscape'); |
my $landscape=&mt('Landscape'); |
my $portrait=&mt('Portrait'); |
my $portrait=&mt('Portrait'); |
|
my $pdfFormLabel=&mt('PDF Form Fields'); |
|
my $with=&mt('with Form Fields'); |
|
my $without=&mt('without Form Fields'); |
|
|
|
|
$result.='<h3>'.&mt('Layout Options').'</h3>' |
$result.='<h3>'.&mt('Layout Options').'</h3>' |
Line 5391 sub render {
|
Line 5388 sub render {
|
.'<th>'.$PageLayout.'</th>' |
.'<th>'.$PageLayout.'</th>' |
.'<th>'.$NumberOfColumns.'</th>' |
.'<th>'.$NumberOfColumns.'</th>' |
.'<th>'.$PaperType.'</th>' |
.'<th>'.$PaperType.'</th>' |
|
.'<th>'.$pdfFormLabel.'</th>' |
.&Apache::loncommon::end_data_table_header_row() |
.&Apache::loncommon::end_data_table_header_row() |
.&Apache::loncommon::start_data_table_row() |
.&Apache::loncommon::start_data_table_row() |
.'<td>' |
.'<td>' |
Line 5431 sub render {
|
Line 5429 sub render {
|
$result .= <<HTML; |
$result .= <<HTML; |
</select> |
</select> |
</td> |
</td> |
|
<td align='center'> |
|
<select name='${var}.pdfFormFields'> |
|
<option selected="selected" value="no">$without</option> |
|
<option value="yes">$with</option> |
|
</select> |
|
</td> |
HTML |
HTML |
$result.=&Apache::loncommon::end_data_table_row() |
$result.=&Apache::loncommon::end_data_table_row() |
.&Apache::loncommon::end_data_table(); |
.&Apache::loncommon::end_data_table(); |