Diff for /loncom/homework/lonhomework.pm between versions 1.1 and 1.4

version 1.1, 2000/07/25 17:45:40 version 1.4, 2000/08/07 21:26:21
Line 5  package Apache::lonhomework; Line 5  package Apache::lonhomework;
 use strict;  use strict;
 use Apache::style;  use Apache::style;
 use Apache::lonxml;  use Apache::lonxml;
   use Apache::lonnet;
   use Apache::inputtags;
   use Apache::structuretags;
   
 sub handler {  sub handler {
   my $request=shift;    my $request=shift;
   
   my @parsecontents;  
   {  
     my $fh=Apache::File->new($request->filename);  
     @parsecontents=<$fh>;  
   }  
     
   my $parsestring=join('',@parsecontents);  
     
   $request->content_type('text/html');    $request->content_type('text/html');
   $request->send_http_header;    $request->send_http_header;
   $request->print('<html>    &Apache::lonhomework::send_header($request);
 <form method="post" action="'.$request->uri.'"<input type="hidden" name="TARGET" value="edit"><input type="submit" value="Submit">');    my $file = "/home/httpd/html".$request->uri;
     my %mystyle;
     &Apache::inputtags::initialize_inputtags;
     my $result = Apache::lonxml::xmlparse("web",'<scriptlib>/res/103/albertel/default_homework</scriptlib>'.&setup_vars.&getfile($file),%mystyle);
     #$request->print("Result follows:");
     $request->print($result);
     #$request->print(":Result ends");
     &Apache::lonhomework::send_footer($request);
   }
   
   sub setup_vars {
     $Apache::lonhomework::target="web";
     return '<script>$external::target=web;</script>';
   }
   
   sub send_header {
     my ($request)= @_;
     $request->print('<html>');
     $request->print('<form method="POST" action="'.$request->uri.'">');
   }
   
   sub send_footer {
     my ($request)= @_;
     $request->print('</form>');
     $request->print('</html>');
   }
   
   sub getfile {
     my ($filename) = @_;
     my $a="";
     &Apache::lonnet::repcopy($filename);
     {
       my $fh=Apache::File->new($filename);
   
       while (<$fh>) {
         $a .=$_;
       }
     }
     return $a
 }  }
   
 1;  1;

Removed from v.1.1  
changed lines
  Added in v.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.