--- loncom/homework/lonhomework.pm 2000/07/25 21:27:30 1.2 +++ loncom/homework/lonhomework.pm 2000/08/08 19:14:53 1.5 @@ -12,19 +12,35 @@ use Apache::structuretags; sub handler { my $request=shift; + my $target=&get_target(); $request->content_type('text/html'); $request->send_http_header; &Apache::lonhomework::send_header($request); my $file = "/home/httpd/html".$request->uri; my %mystyle; + my $result = ''; &Apache::inputtags::initialize_inputtags; - my $result = Apache::lonxml::xmlparse("web",'/home/httpd/html/res/103/albertel/default_homework'.&getfile($file),%mystyle); + if ($target eq "web") { + $result = Apache::lonxml::xmlparse($target,'/res/103/albertel/default_homework'.&setup_vars($target).&getfile($file),%mystyle); + } else { + $result = Apache::lonxml::xmlparse($target,&getfile($file),%mystyle); + } #$request->print("Result follows:"); $request->print($result); #$request->print(":Result ends"); &Apache::lonhomework::send_footer($request); } +sub get_target { + return "edit"; +} + +sub setup_vars { + my ($target) = @_; + $Apache::lonhomework::target=$target; + return ''; +} + sub send_header { my ($request)= @_; $request->print('');