version 1.627.2.30, 2020/03/05 18:33:35
|
version 1.627.2.32.2.2, 2023/01/17 16:12:24
|
Line 1344 sub latex_header_footer_remove {
|
Line 1344 sub latex_header_footer_remove {
|
# necessity is determined by the problem_split param. |
# necessity is determined by the problem_split param. |
# |
# |
sub encapsulate_minipage { |
sub encapsulate_minipage { |
my ($text) = @_; |
my ($text,$problem_split) = @_; |
if (!($env{'form.problem.split'} =~ /yes/i)) { |
if (!($problem.split =~ /yes/i)) { |
$text = '\begin{minipage}{\textwidth}'.$text.'\end{minipage}'; |
$text = '\begin{minipage}{\textwidth}'.$text.'\end{minipage}'; |
} |
} |
return $text; |
return $text; |
Line 2553 sub print_construction_sequence {
|
Line 2553 sub print_construction_sequence {
|
my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm '; |
my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm '; |
$body.=&path_to_problem($urlp,$LaTeXwidth); |
$body.=&path_to_problem($urlp,$LaTeXwidth); |
$body.='\vskip 1 mm '.$answer.'\end{document}'; |
$body.='\vskip 1 mm '.$answer.'\end{document}'; |
$body = &encapsulate_minipage($body); |
$body = &encapsulate_minipage($body,$answerform{'problem_split'}); |
$texversion.=$body; |
$texversion.=$body; |
} |
} |
} |
} |
Line 3017 ENDPART
|
Line 3017 ENDPART
|
my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm '; |
my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm '; |
$body .= &path_to_problem ($urlp,$LaTeXwidth); |
$body .= &path_to_problem ($urlp,$LaTeXwidth); |
$body .='\vskip 1 mm '.$answer; |
$body .='\vskip 1 mm '.$answer; |
$body = &encapsulate_minipage($body); |
$body = &encapsulate_minipage($body,$answerform{'problem_split'}); |
$texversion .= $body; |
$texversion .= $body; |
} else { |
} else { |
$texversion=''; |
$texversion=''; |
Line 3243 ENDPART
|
Line 3243 ENDPART
|
my @lines = &Apache::lonnet::get_scantronformat_file(); |
my @lines = &Apache::lonnet::get_scantronformat_file(); |
my ($code_type,$code_length,$bubbles_per_row)=('letter',6,10); |
my ($code_type,$code_length,$bubbles_per_row)=('letter',6,10); |
foreach my $line (@lines) { |
foreach my $line (@lines) { |
chomp($line); |
next if (($line =~ /^\#/) || ($line eq '')); |
my ($name,$type,$length,$bubbles_per_item) = |
my ($name,$type,$length,$bubbles_per_item) = |
(split(/:/,$line))[0,2,4,17]; |
(split(/:/,$line))[0,2,4,17]; |
if ($name eq $code_option) { |
if ($name eq $code_option) { |
Line 3255 ENDPART
|
Line 3255 ENDPART
|
} |
} |
} |
} |
} |
} |
my ($randomorder,$randompick,$map); |
my $map; |
if ($helper->{VARS}{'symb'}) { |
if ($helper->{VARS}{'symb'}) { |
($map, my $id, my $resource) = |
($map, my $id, my $resource) = |
&Apache::lonnet::decode_symb($helper->{VARS}{'symb'}); |
&Apache::lonnet::decode_symb($helper->{VARS}{'symb'}); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
if (defined($navmap)) { |
|
if ($map) { |
|
my $mapres = $navmap->getResourceByUrl($map); |
|
$randomorder = $mapres->randomorder(); |
|
$randompick = $mapres->randompick(); |
|
} |
|
} |
|
} |
} |
my %moreenv = ('textwidth' => &get_textwidth($helper,$LaTeXwidth)); |
my %moreenv = ('textwidth' => &get_textwidth($helper,$LaTeXwidth)); |
$moreenv{'problem_split'} = $parmhash{'problem_stream_switch'}; |
$moreenv{'problem_split'} = $parmhash{'problem_stream_switch'}; |
Line 3335 ENDPART
|
Line 3327 ENDPART
|
} else { |
} else { |
$moreenv{'CODE'}=&num_to_letters($code); |
$moreenv{'CODE'}=&num_to_letters($code); |
} |
} |
my $actual_seq = \@master_seq; |
$env{'form.CODE'} = $moreenv{'CODE'}; |
if ($randomorder || $randompick) { |
my $actual_seq = master_seq_to_person_seq($map, \@master_seq, |
$env{'form.CODE'} = $moreenv{'CODE'}; |
undef, |
$actual_seq = master_seq_to_person_seq($map, \@master_seq, |
$moreenv{'CODE'}, $nohidemap); |
undef, |
delete($env{'form.CODE'}); |
$moreenv{'CODE'}, $nohidemap); |
|
delete($env{'form.CODE'}); |
|
} |
|
my ($output,$fullname, $printed)= |
my ($output,$fullname, $printed)= |
&print_resources($r,$helper,'anonymous',$type,\%moreenv, |
&print_resources($r,$helper,'anonymous',$type,\%moreenv, |
$actual_seq,$flag_latex_header_remove, |
$actual_seq,$flag_latex_header_remove, |
Line 3466 ENDPART
|
Line 3455 ENDPART
|
if (($ENV{'SERVER_PORT'} == 443) && ($env{'request.course.id'}) && |
if (($ENV{'SERVER_PORT'} == 443) && ($env{'request.course.id'}) && |
(($url =~ m{^\Q/public/$cdom/$cnum/syllabus\E($|\?)}) || |
(($url =~ m{^\Q/public/$cdom/$cnum/syllabus\E($|\?)}) || |
($url =~ m{^\Q/adm/wrapper/ext/\E(?!https:)}))) { |
($url =~ m{^\Q/adm/wrapper/ext/\E(?!https:)}))) { |
unless (&Apache::lonnet::uses_sts()) { |
unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl())) { |
$usehttp = 1; |
$usehttp = 1; |
} |
} |
} |
} |
Line 3743 sub print_resources {
|
Line 3732 sub print_resources {
|
my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm '; |
my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm '; |
$body .=&path_to_problem($res_url,$LaTeXwidth); |
$body .=&path_to_problem($res_url,$LaTeXwidth); |
$body .='\vskip 1 mm '.$ansrendered; |
$body .='\vskip 1 mm '.$ansrendered; |
$body = &encapsulate_minipage($body); |
$body = &encapsulate_minipage($body,$answerenv{'problem_split'}); |
$rendered = $header.$body; |
$rendered = $header.$body; |
} |
} |
} |
} |
Line 3833 sub print_resources {
|
Line 3822 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"); |
$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 3894 sub handler {
|
Line 3883 sub handler {
|
if ($env{'request.course.id'}) { |
if ($env{'request.course.id'}) { |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
my ($blocked,$blocktext) = |
my ($blocked,$blocktext) = |
&Apache::loncommon::blocking_status('printout',$cnum,$cdom); |
&Apache::loncommon::blocking_status('printout',$clientip,$cnum,$cdom); |
if ($blocked) { |
if ($blocked) { |
my $checkrole = "cm./$cdom/$cnum"; |
my $checkrole = "cm./$cdom/$cnum"; |
if ($env{'request.course.sec'} ne '') { |
if ($env{'request.course.sec'} ne '') { |
Line 4082 sub printHelper {
|
Line 4072 sub printHelper {
|
$helper->{VARS}->{'symb'} = $env{'form.symb'}; |
$helper->{VARS}->{'symb'} = $env{'form.symb'}; |
} |
} |
if ($env{'form.url'}) { |
if ($env{'form.url'}) { |
$helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($helper->{VARS}->{'postdata'}); |
unless ($env{'form.url'} eq '/adm/navmaps') { |
|
$helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($helper->{VARS}->{'postdata'}); |
|
} |
} |
} |
|
|
} |
} |
|
|
if ($env{'form.symb'}) { |
|
$helper->{VARS}->{'symb'} = $env{'form.symb'}; |
|
} |
|
if ($env{'form.url'}) { |
|
$helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($helper->{VARS}->{'postdata'}); |
|
|
|
} |
|
if ($helper->{VARS}->{'symb'} ne '') { |
if ($helper->{VARS}->{'symb'} ne '') { |
$helper->{VARS}->{'symb'}= |
$helper->{VARS}->{'symb'}= |
&Apache::lonenc::check_encrypt($helper->{VARS}->{'symb'}); |
&Apache::lonenc::check_encrypt($helper->{VARS}->{'symb'}); |
Line 4368 sub printHelper {
|
Line 4352 sub printHelper {
|
# BZ 5209 - incomplete problems from entire course: |
# BZ 5209 - incomplete problems from entire course: |
|
|
push(@{$printChoices}, |
push(@{$printChoices}, |
[&mtn('Selected <b>Incomplete Problems</b> from <b>entire course</b> for selected people'), |
[&mt('Selected [_1]Incomplete Problems[_2] from [_3]entire course[_4] for [_5]selected people[_6]', |
|
'<b>','</b>','<b>','</b>','<b>','</b>'), |
'incomplete_problems_selpeople_course', 'INCOMPLETE_PROBLEMS_COURSE_RESOURCES']); |
'incomplete_problems_selpeople_course', 'INCOMPLETE_PROBLEMS_COURSE_RESOURCES']); |
my $helperFragment = &create_incomplete_course_helper($helper); # Create needed states. |
my $helperFragment = &create_incomplete_course_helper($helper); # Create needed states. |
|
|
Line 4376 sub printHelper {
|
Line 4361 sub printHelper {
|
|
|
# Selected problems/resources from entire course: |
# Selected problems/resources from entire course: |
|
|
push @{$printChoices}, [&mtn('Selected <b>Problems</b> from <b>entire course</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}, [&mtn('Selected <b>Resources</b> from <b>entire course</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}, [&mtn('Selected <b>Problems</b> from <b>entire course</b> for <b>selected people</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 4535 ALL_PROBLEMS
|
Line 4520 ALL_PROBLEMS
|
my @lines = &Apache::lonnet::get_scantronformat_file(); |
my @lines = &Apache::lonnet::get_scantronformat_file(); |
my $codechoice=''; |
my $codechoice=''; |
foreach my $line (@lines) { |
foreach my $line (@lines) { |
|
next if (($line =~ /^\#/) || ($line eq '')); |
my ($name,$description,$code_type,$code_length)= |
my ($name,$description,$code_type,$code_length)= |
(split(/:/,$line))[0,1,2,4]; |
(split(/:/,$line))[0,1,2,4]; |
if ($code_length > 0 && |
if ($code_length > 0 && |
Line 4712 CHOOSE_FROM_SUBDIR
|
Line 4698 CHOOSE_FROM_SUBDIR
|
# Allow the user to select any sequence in the course, feed it to |
# Allow the user to select any sequence in the course, feed it to |
# another resource selector for that sequence |
# another resource selector for that sequence |
if (!$helper->{VARS}->{'construction'} && !$is_published) { |
if (!$helper->{VARS}->{'construction'} && !$is_published) { |
push @$printChoices, [&mtn("Selected <b>Resources</b> from <b>selected folder</b> in course"), |
push(@$printChoices, [&mt('Selected [_1]Resources[_2] from [_3]selected folder[_4] in course', |
'select_sequences', 'CHOOSE_SEQUENCE']; |
'<b>','</b>','<b>','</b>'), |
|
'select_sequences', 'CHOOSE_SEQUENCE']); |
my $escapedSequenceName = $helper->{VARS}->{'SEQUENCE'}; |
my $escapedSequenceName = $helper->{VARS}->{'SEQUENCE'}; |
#Escape apostrophes and backslashes for Perl |
#Escape apostrophes and backslashes for Perl |
$escapedSequenceName =~ s/\\/\\\\/g; |
$escapedSequenceName =~ s/\\/\\\\/g; |
Line 4732 CHOOSE_FROM_SUBDIR
|
Line 4719 CHOOSE_FROM_SUBDIR
|
<state name="CHOOSE_FROM_ANY_SEQUENCE" title="Select Resources To Print"> |
<state name="CHOOSE_FROM_ANY_SEQUENCE" title="Select Resources To Print"> |
<message>(mark desired resources then click "next" button) <br /></message> |
<message>(mark desired resources then click "next" button) <br /></message> |
<resource variable="RESOURCES" multichoice="1" toponly='1' addstatus="1" |
<resource variable="RESOURCES" multichoice="1" toponly='1' addstatus="1" |
closeallpages="1" modallink="1"> |
closeallpages="1" modallink="1" suppressNavmap="1"> |
<nextstate>PAGESIZE</nextstate> |
<nextstate>PAGESIZE</nextstate> |
<filterfunc>return $isNotMap</filterfunc> |
<filterfunc>return $isNotMap</filterfunc> |
<mapurl evaluate='1'>return '$escapedSequenceName';</mapurl> |
<mapurl evaluate='1'>return '$escapedSequenceName';</mapurl> |