--- loncom/interface/lonprintout.pm 2006/02/14 20:40:10 1.408.2.5 +++ loncom/interface/lonprintout.pm 2005/12/19 22:30:01 1.409 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.408.2.5 2006/02/14 20:40:10 albertel Exp $ +# $Id: lonprintout.pm,v 1.409 2005/12/19 22:30:01 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -816,7 +816,7 @@ sub IndexCreation { sub print_latex_header { my $mode=shift; - my $output='\documentclass[letterpaper]{article}'; + my $output='\documentclass[letterpaper,twoside]{article}'; if (($mode eq 'batchmode') || (!$perm{'pav'})) { $output.='\batchmode'; } @@ -894,14 +894,11 @@ sub get_textwidth { sub unsupported { - my ($currentURL,$mode,$symb)=@_; + my ($currentURL,$mode)=@_; if ($mode ne '') {$mode='\\'.$mode} my $result.= &print_latex_header($mode); - if ($currentURL=~m|^(/adm/wrapper/)?ext/|) { - $currentURL=~s|^(/adm/wrapper/)?ext/|http://|; - my $title=&Apache::lonnet::gettitle($symb); - $title = &Apache::lonxml::latex_special_symbols($title); - $result.=' \strut \\\\ '.$title.' \strut \\\\ '.$currentURL.' '; + if ($currentURL=~/\/ext\//) { + $result.=' \strut \\\\ THIS IS EXTERNAL RESOURCE WITH URL \strut \\\\ '.$currentURL.' '; } else { $result.=$currentURL; } @@ -1080,8 +1077,7 @@ ENDPART $cleanURL=$currentURL; } $selectionmade = 1; - if ($cleanURL!~m|^/adm/| - && $cleanURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { + if ($cleanURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { my $rndseed=time; my $texversion=''; if ($helper->{'VARS'}->{'ANSWER_TYPE'} ne 'only') { @@ -1150,8 +1146,7 @@ ENDPART if ($currentURL=~m/\.page\s*$/) { ($result,$number_of_columns) = &page_cleanup($result); } - } elsif ($cleanURL!~m|^/adm/| - && $currentURL=~/\.sequence$/ && $helper->{'VARS'}->{'construction'} eq '1') { + } elsif ($currentURL=~/\.sequence$/ && $helper->{'VARS'}->{'construction'} eq '1') { #printing content of sequence from the construction space my $flag_latex_header_remove = 'NO'; my $rndseed=time; @@ -1220,8 +1215,7 @@ ENDPART my $texversion=&Apache::lonnet::ssi($currentURL,%form); $result .= $texversion; } else { - $result.=&unsupported($currentURL,$helper->{'VARS'}->{'LATEX_TYPE'}, - $helper->{'VARS'}->{'symb'}); + $result.=&unsupported($currentURL,$helper->{'VARS'}->{'LATEX_TYPE'}); } } elsif (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems') or ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems_pages') or @@ -1270,8 +1264,7 @@ ENDPART if ($selectionmade==7) {$helper->{VARS}->{'assignment'}=$assignment;} if ($i==0) {$prevassignment=$assignment;} my $texversion=''; - if ($urlp!~m|^/adm/| - && $urlp=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { + if ($urlp=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { $resources_printed .= $urlp.':'; my $pre_counter=$env{'form.counter'}; $texversion.=&Apache::lonnet::ssi($urlp,%form); @@ -1338,8 +1331,7 @@ ENDPART $result .= $texversion; $flag_latex_header_remove = 'YES'; } else { - $texversion=&unsupported($urlp,$helper->{'VARS'}->{'LATEX_TYPE'}, - $master_seq[$i]); + $texversion=&unsupported($urlp,$helper->{'VARS'}->{'LATEX_TYPE'}); if ($flag_latex_header_remove ne 'NO') { $texversion = &latex_header_footer_remove($texversion); } else { @@ -1442,7 +1434,6 @@ ENDPART } my %moreenv = ('textwidth' => &get_textwidth($helper,$LaTeXwidth)); $moreenv{'problem_split'} = $parmhash{'problem_stream_switch'}; - $moreenv{'instructor_comments'}='hide'; my $seed=time+($$<<16)+($$); my @allcodes; if ($old_name) { @@ -1745,8 +1736,7 @@ sub print_resources { ($curresline!~ m/\.(problem|exam|quiz|assess|survey|form|library)$/)) ) { my ($map,$id,$res_url) = &Apache::lonnet::decode_symb($curresline); if (&Apache::lonnet::allowed('bre',$res_url)) { - if ($res_url!~m|^ext/| - && $res_url=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { + if ($res_url=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { $printed .= $curresline.':'; my $pre_counter=$env{'form.counter'}; my $rendered = &Apache::loncommon::get_student_view($curresline,$username,$userdomain,$env{'request.course.id'},'tex',$moreenv); @@ -1792,10 +1782,9 @@ sub print_resources { } else { $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 '; } else { - my $rendered = &unsupported($res_url,$helper->{'VARS'}->{'LATEX_TYPE'},$curresline); + my $rendered = &unsupported($res_url,$helper->{'VARS'}->{'LATEX_TYPE'}); if ($remove_latex_header ne 'NO') { $rendered = &latex_header_footer_remove($rendered); } else { @@ -1942,7 +1931,7 @@ sub printHelper { # But we only do this in the initial state so that they are allowed to change. # - # $helper->{VARS}->{FINISHPAGE} = ''; + $helper->{VARS}->{FINISHPAGE} = ''; &Apache::loncommon::restore_course_settings('print', {'pagebreaks' => 'scalar', @@ -2186,9 +2175,11 @@ CHOOSE_STUDENTS } + my %all_codes = &Apache::lonnet::get('CODEs', + \@names, $cdom,$cnum); my %code_values; my %codes_to_print; - foreach my $key (@names) { + foreach my $key (keys(%all_codes)) { %code_values = &Apache::grades::get_codes($key, $cdom, $cnum); foreach my $key (keys(%code_values)) { $codes_to_print{$key} = 1; @@ -2219,7 +2210,8 @@ CHOOSE_STUDENTS &Apache::lonxml::xmlparse($r, 'helper', < PAGESIZE -
Number of anonymous assignments to print: +
+
Number of anonymous assignments to print? if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) < 1) && @@ -2232,19 +2224,8 @@ CHOOSE_STUDENTS
- Names to store the CODEs under for later: - - -
- Bubble sheet type: - - - $codechoice - -

-
- Enter a CODE to print: - + Value of CODE to print? + if(!\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'} && !\$helper->{'VARS'}{'REUSE_OLD_CODES'} && @@ -2256,13 +2237,28 @@ CHOOSE_STUDENTS } -

- Reprint a set of saved CODEs: +
+ Choose single code from list + + $code_selection + +
+ Names to store the CODEs under for later: + + +
+ Bubble sheet type: + + + $codechoice + +
+
+ Reprint a set of saved CODEs: $namechoice -

$resource_selector @@ -2310,7 +2306,7 @@ CHOOSE_STUDENTS1 &Apache::lonxml::xmlparse($r, 'helper', < PAGESIZE -
Number of anonymous assignments to print: +
Number of anonymous assignments to print? if (((\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'}+0) < 1) && @@ -2323,19 +2319,8 @@ CHOOSE_STUDENTS1
- Names to store the CODEs under for later: - - -
- Bubble sheet type: - - - $codechoice - -

-
- Enter a CODE to print: - + Value of CODE to print? + if(!\$helper->{'VARS'}{'NUMBER_TO_PRINT_TOTAL'} && !\$helper->{'VARS'}{'REUSE_OLD_CODES'} && @@ -2347,13 +2332,28 @@ CHOOSE_STUDENTS1 } -

- Reprint a set of saved CODEs: +
+ Choose single code from list + + + $code_selection + +
+ Names to store the CODEs under for later: + + +
+ Bubble sheet type: + + $codechoice + +
+
+ Reprint a set of saved CODEs: $namechoice -

$resource_selector @@ -2519,7 +2519,7 @@ CHOOSE_FROM_ANY_SEQUENCE Use style file: -   Select style file +   Select style file Show all foils?