--- loncom/interface/lonprintout.pm 2005/12/23 08:34:43 1.408.2.1 +++ loncom/interface/lonprintout.pm 2006/01/26 19:54:15 1.408.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.408.2.1 2005/12/23 08:34:43 albertel Exp $ +# $Id: lonprintout.pm,v 1.408.2.2 2006/01/26 19:54:15 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -894,11 +894,14 @@ sub get_textwidth { sub unsupported { - my ($currentURL,$mode)=@_; + my ($currentURL,$mode,$symb)=@_; if ($mode ne '') {$mode='\\'.$mode} my $result.= &print_latex_header($mode); - if ($currentURL=~/\/ext\//) { - $result.=' \strut \\\\ THIS IS EXTERNAL RESOURCE WITH URL \strut \\\\ '.$currentURL.' '; + 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.' '; } else { $result.=$currentURL; } @@ -1077,7 +1080,8 @@ ENDPART $cleanURL=$currentURL; } $selectionmade = 1; - if ($cleanURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { + if ($cleanURL!~m|^/adm/| + && $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') { @@ -1146,7 +1150,8 @@ ENDPART if ($currentURL=~m/\.page\s*$/) { ($result,$number_of_columns) = &page_cleanup($result); } - } elsif ($currentURL=~/\.sequence$/ && $helper->{'VARS'}->{'construction'} eq '1') { + } elsif ($cleanURL!~m|^/adm/| + && $currentURL=~/\.sequence$/ && $helper->{'VARS'}->{'construction'} eq '1') { #printing content of sequence from the construction space my $flag_latex_header_remove = 'NO'; my $rndseed=time; @@ -1215,7 +1220,8 @@ ENDPART my $texversion=&Apache::lonnet::ssi($currentURL,%form); $result .= $texversion; } else { - $result.=&unsupported($currentURL,$helper->{'VARS'}->{'LATEX_TYPE'}); + $result.=&unsupported($currentURL,$helper->{'VARS'}->{'LATEX_TYPE'}, + $helper->{'VARS'}->{'symb'}); } } elsif (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems') or ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems_pages') or @@ -1264,7 +1270,8 @@ ENDPART if ($selectionmade==7) {$helper->{VARS}->{'assignment'}=$assignment;} if ($i==0) {$prevassignment=$assignment;} my $texversion=''; - if ($urlp=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { + if ($urlp!~m|^/adm/| + && $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); @@ -1331,7 +1338,8 @@ ENDPART $result .= $texversion; $flag_latex_header_remove = 'YES'; } else { - $texversion=&unsupported($urlp,$helper->{'VARS'}->{'LATEX_TYPE'}); + $texversion=&unsupported($urlp,$helper->{'VARS'}->{'LATEX_TYPE'}, + $master_seq[$i]); if ($flag_latex_header_remove ne 'NO') { $texversion = &latex_header_footer_remove($texversion); } else { @@ -1736,7 +1744,8 @@ 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=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { + if ($res_url!~m|^ext/| + && $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); @@ -1784,7 +1793,7 @@ sub print_resources { } $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'}); + my $rendered = &unsupported($res_url,$helper->{'VARS'}->{'LATEX_TYPE'},$curresline); if ($remove_latex_header ne 'NO') { $rendered = &latex_header_footer_remove($rendered); } else { @@ -2508,7 +2517,7 @@ CHOOSE_FROM_ANY_SEQUENCE Use style file: -   Select style file +   Select style file Show all foils?