--- rat/lonpage.pm 2004/09/14 01:21:49 1.60 +++ rat/lonpage.pm 2004/12/17 22:34:53 1.66 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Page Handler # -# $Id: lonpage.pm,v 1.60 2004/09/14 01:21:49 raeburn Exp $ +# $Id: lonpage.pm,v 1.66 2004/12/17 22:34:53 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -232,13 +232,21 @@ sub handler { $lcm*=($#colcont+1)/euclid($lcm,($#colcont+1)); foreach (@colcont) { my $src=$hash{'src_'.$_}; - $src=~/\.(\w+)$/; + my ($extension)=($src=~/\.(\w+)$/); + if ($hash{'encrypted_'.$_}) { + $src=&Apache::lonenc::encrypted($src); + } $metalink{$_}=$src.'.meta'; - $cellemb{$_}=Apache::loncommon::fileembstyle($1); + $cellemb{$_}= + &Apache::loncommon::fileembstyle($extension); if ($cellemb{$_} eq 'ssi') { # --------------------------------------------------------- This is an SSI cell + my ($mapid,$resid)=split(/\./,$_); + my $symb=&Apache::lonnet::encode_symb($hash{'map_id_'.$mapid},$resid,$src); + my $prefix=$_.'_'; - my %posthash=('request.prefix' => $prefix); + my %posthash=('request.prefix' => $prefix, + 'symb' => $symb); if ($ENV{'form.grade_target'} eq 'tex') { $posthash{'grade_target'}=$ENV{'form.grade_target'}; $posthash{'textwidth'}=$ENV{'form.textwidth'}; @@ -257,8 +265,7 @@ sub handler { } } my $output=Apache::lonnet::ssi($src,%posthash); - $output=~ - s/\/\/ BEGIN LON\-CAPA Internal.+\/\/ END LON\-CAPA Internal\s//gs; + $output=~s|//(\s*)?\s||gs; if ($target eq 'tex') { $output =~ s/^([^&]+)\\begin{document}//; $output =~ s/\\end{document}//; @@ -397,7 +404,8 @@ sub handler { # ------------------------------------------------------------------ Start form if ($nforms) { $r->print('