version 1.688, 2023/04/15 17:53:07
|
version 1.697, 2024/10/29 22:00:23
|
Line 755 sub get_print_dates {
|
Line 755 sub get_print_dates {
|
# get_print_dates but namvaps::course_print_dates are gotten...and not converted |
# get_print_dates but namvaps::course_print_dates are gotten...and not converted |
# to times either. |
# to times either. |
# |
# |
# @param $res - Reference to a resource has from lonnvampas::resource. |
# @param $res - Reference to a resource hash from lonnavmaps::resource. |
# |
# |
# @return (opendate, closedate) |
# @return (opendate, closedate) |
# |
# |
Line 897 sub master_seq_to_person_seq {
|
Line 897 sub master_seq_to_person_seq {
|
|
|
# Iterate on the resource..select the items that are randomly selected |
# Iterate on the resource..select the items that are randomly selected |
# and that are in the seq_hash. Presumably the iterator will take care |
# and that are in the seq_hash. Presumably the iterator will take care |
# of the random ordering part of the deal. |
# of the random ordering part of the deal. |
# |
# |
my $curres; |
my $curres; |
while ($curres = $iterator->next()) { |
while ($curres = $iterator->next()) { |
Line 1155 sub printf_style_subst {
|
Line 1155 sub printf_style_subst {
|
if ($size ne "") { |
if ($size ne "") { |
$subst = substr($subst, 0, $size); |
$subst = substr($subst, 0, $size); |
|
|
# Here's a nice edge case.. suppose the end of the |
# Here's a nice edge case ... suppose the end of the |
# substring is a \. In that case may have just |
# substring is a \. In that case may have just |
# chopped off a TeX escape... in that case, we append |
# chopped off a TeX escape... in that case, we append |
# " " for the trailing character, and let the field |
# " " for the trailing character, and let the field |
Line 2532 sub load_skips {
|
Line 2532 sub load_skips {
|
|
|
my ($helper) = @_; |
my ($helper) = @_; |
|
|
# If this is the first time, unwrap the resources and extra spaces: |
# If this is the first time, unwrap the resources and extra spaces: |
|
|
if (!$skips_loaded) { |
if (!$skips_loaded) { |
@extraspace = (split(/\|\|\|/, $helper->{'VARS'}->{'EXTRASPACE'})); |
@extraspace = (split(/\|\|\|/, $helper->{'VARS'}->{'EXTRASPACE'})); |
Line 3310 ENDPART
|
Line 3310 ENDPART
|
($map, my $id, my $resource) = |
($map, my $id, my $resource) = |
&Apache::lonnet::decode_symb($helper->{VARS}->{'symb'}); |
&Apache::lonnet::decode_symb($helper->{VARS}->{'symb'}); |
} |
} |
|
} elsif (($helper->{'VARS'}->{'postdata'} eq '/adm/navmaps') && ($perm{'pfo'})) { |
|
$map = $helper->{'VARS'}->{'SEQUENCE'}; |
} |
} |
|
|
#loop over students |
#loop over students |
Line 3399 ENDPART
|
Line 3401 ENDPART
|
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'}); |
|
} elsif (($helper->{'VARS'}->{'postdata'} eq '/adm/navmaps') && ($perm{'pfo'})) { |
|
$map = $helper->{'VARS'}->{'SEQUENCE'}; |
} |
} |
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'}; |
|
$moreenv{'suppress_tries'} = $parmhash{'suppress_tries'}; |
$moreenv{'instructor_comments'}='hide'; |
$moreenv{'instructor_comments'}='hide'; |
$moreenv{'bubbles_per_row'} = $bubbles_per_row; |
$moreenv{'bubbles_per_row'} = $bubbles_per_row; |
my $seed=time+($$<<16)+($$); |
my $seed=time+($$<<16)+($$); |
Line 3797 sub print_resources {
|
Line 3802 sub print_resources {
|
# nice to put the special in as a postscript comment |
# nice to put the special in as a postscript comment |
# e.g. \special{ps:\ENDOFSTUDENTSTAMP} unfortunately, |
# e.g. \special{ps:\ENDOFSTUDENTSTAMP} unfortunately, |
# The special gets passed the \ and dvips puts it in the output file |
# The special gets passed the \ and dvips puts it in the output file |
# so we will just rely on printout.pl to strip ENDOFSTUDENTSTAMP from the |
# so we will just rely on printout.pl to strip ENDOFSTUDENTSTAMP from the |
# postscript. Each ENDOFSTUDENTSTAMP will go on a line by itself. |
# postscript. Each ENDOFSTUDENTSTAMP will go on a line by itself. |
# |
# |
|
|
Line 3906 sub print_resources {
|
Line 3911 sub print_resources {
|
$rendered =~ s/\\end\{document}//; |
$rendered =~ s/\\end\{document}//; |
} |
} |
$current_output .= $rendered.'\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}\strut \vskip 0 mm \strut '; |
$current_output .= $rendered.'\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}\strut \vskip 0 mm \strut '; |
} elsif($res_url = ~/\.pdf$/) { |
} elsif($res_url =~ /\.pdf$/) { |
my $url = &Apache::lonnet::clutter($res_url); |
my $url = &Apache::lonnet::clutter($res_url); |
my $rendered = &include_pdf($url); |
my $rendered = &include_pdf($url); |
if ($remove_latex_header ne 'NO') { |
if ($remove_latex_header ne 'NO') { |
Line 4821 CHOOSE_FROM_SUBDIR
|
Line 4826 CHOOSE_FROM_SUBDIR
|
'<b>','</b>','<b>','</b>','<b>','</b>'), |
'<b>','</b>','<b>','</b>','<b>','</b>'), |
'select_sequences_resources_for_anon','CHOOSE_SEQUENCE_ANON2']); |
'select_sequences_resources_for_anon','CHOOSE_SEQUENCE_ANON2']); |
if ($escapedSequenceName) { |
if ($escapedSequenceName) { |
&generate_common_choosers($r,$helper,$escapedSequenceName,$escapedSequenceName,$isProblem,$symbFilter,$start_new_option); |
my ($randomly_ordered_warning,$codechoice,$code_selection,$namechoice) = |
|
&generate_common_choosers($r,$helper,$escapedSequenceName,$escapedSequenceName, |
|
$isProblem,$symbFilter,$start_new_option); |
|
|
|
my $resource_selector = <<RESOURCE_SELECTOR; |
|
<state name="CHOOSE_STUDENTS2" title="Select Students and Resources"> |
|
<choices variable='student_sort'> |
|
<choice computer='0'>Sort by section then student</choice> |
|
<choice computer='1'>Sort by students across sections.</choice> |
|
</choices> |
|
<message><br /><hr /><br /></message> |
|
<student multichoice='1' variable="STUDENTS" nextstate="SELECT_RESOURCES" coursepersonnel="1" /> |
|
|
|
</state> |
|
<state name="SELECT_RESOURCES" title="Select Resources"> |
|
$randomly_ordered_warning |
|
<nextstate>PRINT_FORMATTING</nextstate> |
|
<message>(mark desired resources then click "next" button) <br /></message> |
|
<resource variable="RESOURCES" multichoice="1" addstatus="1" |
|
closeallpages="1" modallink="1" suppressNavmap="1" $nocurrloc> |
|
<filterfunc>return $isNotMap;</filterfunc> |
|
<mapurl>$escapedSequenceName</mapurl> |
|
<valuefunc>return $symbFilter;</valuefunc> |
|
$start_new_option |
|
</resource> |
|
</state> |
|
RESOURCE_SELECTOR |
|
|
|
my $anon3 = &generate_code_selector($helper, |
|
'CHOOSE_ANON3', |
|
'SELECT_RESOURCES', |
|
$codechoice, |
|
$code_selection, |
|
$namechoice) . $resource_selector; |
|
|
|
&Apache::lonxml::xmlparse($r, 'helper',$anon3); |
} |
} |
} |
} |
} |
} |
if (($subdir eq '') && ($url eq '/adm/navmaps') && ($perm{'pfo'})) { |
if (($subdir eq '') && ($url eq '/adm/navmaps') && ($perm{'pfo'})) { |
&Apache::lonxml::xmlparse($r, 'helper', <<CHOOSE_FROM_ANY_SEQUENCE); |
&Apache::lonxml::xmlparse($r, 'helper', <<CHOOSE_FROM_ANY_SEQUENCE); |
<state name="CHOOSE_SEQUENCE" title="Select Sequence To Print From"> |
<state name="CHOOSE_SEQUENCE" title="Select Sequence To Print From"> |
<message>Select the sequence to print resources from:</message> |
<message>Select the sequence to print resources from:</message> |
<resource variable="SEQUENCE"> |
<resource variable="SEQUENCE"> |
Line 4860 CHOOSE_FROM_SUBDIR
|
Line 4900 CHOOSE_FROM_SUBDIR
|
<state name="CHOOSE_SEQUENCE_STUDENTS1" title="Select Sequence To Print From"> |
<state name="CHOOSE_SEQUENCE_STUDENTS1" title="Select Sequence To Print From"> |
<message>Select the sequence to print resources from:</message> |
<message>Select the sequence to print resources from:</message> |
<resource variable="SEQUENCE"> |
<resource variable="SEQUENCE"> |
<nextstate>CHOOSE_STUDENTS</nextstate> |
<nextstate>CHOOSE_STUDENTS2</nextstate> |
<filterfunc>return &Apache::lonprintout::printable_sequence(\$res);</filterfunc> |
<filterfunc>return &Apache::lonprintout::printable_sequence(\$res);</filterfunc> |
<valuefunc>return $urlValue;</valuefunc> |
<valuefunc>return $urlValue;</valuefunc> |
<choicefunc>return \$res->hasResource(\$res,sub { return !\$_[0]->is_sequence() },0,0); |
<choicefunc>return \$res->hasResource(\$res,sub { return !\$_[0]->is_sequence() },0,0); |
Line 4870 CHOOSE_FROM_SUBDIR
|
Line 4910 CHOOSE_FROM_SUBDIR
|
<state name="CHOOSE_SEQUENCE_ANON2" title="Select Sequence To Print From"> |
<state name="CHOOSE_SEQUENCE_ANON2" title="Select Sequence To Print From"> |
<message>Select the sequence to print resources from:</message> |
<message>Select the sequence to print resources from:</message> |
<resource variable="SEQUENCE"> |
<resource variable="SEQUENCE"> |
<nextstate>CHOOSE_ANON1</nextstate> |
<nextstate>CHOOSE_ANON3</nextstate> |
<filterfunc>return &Apache::lonprintout::printable_sequence(\$res);</filterfunc> |
<filterfunc>return &Apache::lonprintout::printable_sequence(\$res);</filterfunc> |
<valuefunc>return $urlValue;</valuefunc> |
<valuefunc>return $urlValue;</valuefunc> |
<choicefunc>return \$res->hasResource(\$res,sub { return !\$_[0]->is_sequence() },0,0); |
<choicefunc>return \$res->hasResource(\$res,sub { return !\$_[0]->is_sequence() },0,0); |