version 1.4, 2000/08/07 21:26:21
|
version 1.9, 2000/09/14 20:55:42
|
Line 8 use Apache::lonxml;
|
Line 8 use Apache::lonxml;
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::inputtags; |
use Apache::inputtags; |
use Apache::structuretags; |
use Apache::structuretags; |
|
use Apache::response; |
|
|
sub handler { |
sub handler { |
my $request=shift; |
my $request=shift; |
|
|
|
my $target=&get_target(); |
$request->content_type('text/html'); |
$request->content_type('text/html'); |
$request->send_http_header; |
$request->send_http_header; |
&Apache::lonhomework::send_header($request); |
&Apache::lonhomework::send_header($request); |
my $file = "/home/httpd/html".$request->uri; |
my $file = "/home/httpd/html".$request->uri; |
my %mystyle; |
my %mystyle; |
|
my $result = ''; |
&Apache::inputtags::initialize_inputtags; |
&Apache::inputtags::initialize_inputtags; |
my $result = Apache::lonxml::xmlparse("web",'<scriptlib>/res/103/albertel/default_homework</scriptlib>'.&setup_vars.&getfile($file),%mystyle); |
$result = Apache::lonxml::xmlparse($target, &getfile($file), |
|
&getfile('/home/httpd/html/res/103/albertel/default_homework').&setup_vars($target),%mystyle); |
#$request->print("Result follows:"); |
#$request->print("Result follows:"); |
$request->print($result); |
$request->print($result); |
#$request->print(":Result ends"); |
#$request->print(":Result ends"); |
&Apache::lonhomework::send_footer($request); |
&Apache::lonhomework::send_footer($request); |
} |
} |
|
|
|
sub get_target { |
|
return "web"; |
|
} |
|
|
sub setup_vars { |
sub setup_vars { |
$Apache::lonhomework::target="web"; |
my ($target) = @_; |
return '<script>$external::target=web;</script>'; |
return ';$external::target='.$target.';'; |
} |
} |
|
|
sub send_header { |
sub send_header { |
Line 45 sub send_footer {
|
Line 53 sub send_footer {
|
sub getfile { |
sub getfile { |
my ($filename) = @_; |
my ($filename) = @_; |
my $a=""; |
my $a=""; |
&Apache::lonnet::repcopy($filename); |
if (! -e $filename ) { |
|
&Apache::lonnet::subscribe($filename); |
|
&Apache::lonnet::repcopy($filename); |
|
} |
{ |
{ |
my $fh=Apache::File->new($filename); |
my $fh=Apache::File->new($filename); |
|
|