# The LearningOnline Network with CAPA # Page Handler # # (TeX Content Handler # # 05/29/00,05/30 Gerd Kortemeyer) # 08/30 Gerd Kortemeyer package Apache::lonpage; use strict; use Apache::Constants qw(:common :http); use Apache::lonnet(); use GDBM_File; # ================================================================ Main Handler sub handler { my $r=shift; # ----------------------------------------------------------- Set document type if ($ENV{'browser.mathml'}) { $r->content_type('text/xml'); } else { $r->content_type('text/html'); } $r->send_http_header; return OK if $r->header_only; my $requrl=$r->uri; # ----------------------------------------------------------------- Tie db file if ($ENV{'request.course.fn'}) { my $fn=$ENV{'request.course.fn'}; if (-e "$fn.db") { my %hash; if (tie(%hash,'GDBM_File',"$fn.db",&GDBM_WRCREAT,0640)) { # ------------------------------------------------------------------- Hash tied my $firstres=$hash{'map_start_'.$requrl}; my $lastres=$hash{'map_finish_'.$requrl}; if (($firstres) && ($lastres)) { # ----------------------------------------------------------------- Render page $r->print("