--- rat/lonpage.pm 2002/03/28 21:47:48 1.36 +++ rat/lonpage.pm 2002/05/20 19:05:11 1.37 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Page Handler # -# $Id: lonpage.pm,v 1.36 2002/03/28 21:47:48 www Exp $ +# $Id: lonpage.pm,v 1.37 2002/05/20 19:05:11 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -152,7 +152,8 @@ sub handler { return OK; } - my $requrl=$r->uri; + my $requrl=$r->uri; + my $target = $ENV{'form.grade_target'}; # ----------------------------------------------------------------- Tie db file if ($ENV{'request.course.fn'}) { my $fn=$ENV{'request.course.fn'}; @@ -331,43 +332,45 @@ sub handler { # ------------------------------------------------------------------ Build page # ---------------------------------------------------------------- Send headers - if ($isxml) { - $r->content_type('text/xml'); - $r->send_http_header; - $r->print($xmlheader); - } else { - $r->content_type('text/html'); - $r->send_http_header; - $r->print(''); - } + unless ($target eq 'tex') { + if ($isxml) { + $r->content_type('text/xml'); + $r->send_http_header; + $r->print($xmlheader); + } else { + $r->content_type('text/html'); + $r->send_http_header; + $r->print(''); + } # ------------------------------------------------------------------------ Head - $r->print("\n\n".$allmeta); - $allscript=~ - s/\/\/ BEGIN LON\-CAPA Internal.+\/\/ END LON\-CAPA Internal\s//gs; - if ($allscript) { - $r->print("\n\n"); - } - $r->print(&Apache::lonxml::registerurl(1,undef)); - $r->print("\n\n"); + $r->print("\n\n".$allmeta); + $allscript=~ + s/\/\/ BEGIN LON\-CAPA Internal.+\/\/ END LON\-CAPA Internal\s//gs; + if ($allscript) { + $r->print("\n\n"); + } + $r->print(&Apache::lonxml::registerurl(1,undef)); + $r->print("\n\n"); # ------------------------------------------------------------------ Start body - if ($isxml) { - $r->print($xmlbody); - } else { - $r->print( - ''); - } + if ($isxml) { + $r->print($xmlbody); + } else { + $r->print(''); + } # ------------------------------------------------------------------ Start form - if ($nforms) { - $r->print('
'); - } + if ($nforms) { + $r->print(''); + } # ----------------------------------------------------------------- Start table - $r->print(''); + $r->print('
'); + } for ($i=0;$i<=$#rows;$i++) { if ($rows[$i]) { - $r->print("\n"); + unless ($target eq 'tex') { + $r->print("\n"); + } my @colcont=split(/\&/,$rows[$i]); my $avespan=$lcm/($#colcont+1); for ($j=0;$j<=$#colcont;$j++) { @@ -403,40 +406,54 @@ sub handler { ''; } $metainfo.='

'; - $r->print(''); + unless ($target eq 'tex') { + $r->print(''); + } } - $r->print(''); + unless ($target eq 'tex') { + $r->print(''); + } } } - $r->print("\n
print('print(' bgcolor="'. - $ssibgcolor{$rid}.'"'); - } - $r->print('>'.$metainfo.'print(' text="'.$ssitext{$rid}.'"'); - } - if ($ssilink{$rid}) { - $r->print(' link="'.$ssilink{$rid}.'"'); - } - if ($ssitext{$rid}) { - $r->print(' vlink="'.$ssivlink{$rid}.'"'); - } - if ($ssialink{$rid}) { - $r->print(' alink="'.$ssialink{$rid}.'"'); - } - - $r->print('>'.$ssibody{$rid}.''); - } elsif ($cellemb{$rid} eq 'img') { + unless ($target eq 'tex') { + if ($ssibgcolor{$rid}) { + $r->print(' bgcolor="'. + $ssibgcolor{$rid}.'"'); + } + $r->print('>'.$metainfo.'print(' text="'.$ssitext{$rid}.'"'); + } + if ($ssilink{$rid}) { + $r->print(' link="'.$ssilink{$rid}.'"'); + } + if ($ssitext{$rid}) { + $r->print(' vlink="'.$ssivlink{$rid}.'"'); + } + if ($ssialink{$rid}) { + $r->print(' alink="'.$ssialink{$rid}.'"'); + } + $r->print('>'); + } + $r->print($ssibody{$rid}); + unless ($target eq 'tex') { + $r->print(''); + } + } elsif ($cellemb{$rid} eq 'img') { $r->print('>'.$metainfo.''); } elsif ($cellemb{$rid} eq 'emb') { $r->print('>'.$metainfo.''); } - $r->print('
"); + unless ($target eq 'tex') { + $r->print("\n"); + } # ---------------------------------------------------------------- Submit, etc. if ($nforms) { $r->print(