--- loncom/homework/lonhomework.pm 2001/04/26 21:28:33 1.41 +++ loncom/homework/lonhomework.pm 2001/07/18 18:45:37 1.49 @@ -14,6 +14,11 @@ use Apache::response; use Apache::hint; use Apache::outputtags; use Apache::Constants qw(:common); +#use Time::HiRes qw( gettimeofday tv_interval ); + +sub BEGIN { + &Apache::lonxml::register_insert(); +} sub get_target { if ( $ENV{'request.state'} eq "published") { @@ -30,11 +35,20 @@ sub get_target { return ('web'); } } else { - return ('grade','web'); - if ( $ENV{'form.submitted'} eq 'edit' ) { - return ('modified','edit'); + if ( $ENV{'form.problemmode'} eq 'View' ) { + if ( defined $ENV{'form.submitted'}) { + return ('grade', 'web'); + } else { + return ('web'); + } + } elsif ( $ENV{'form.problemmode'} eq 'Edit' ) { + if ( $ENV{'form.submitted'} eq 'edit' ) { + return ('modified','edit'); + } else { + return ('edit'); + } } else { - return ('edit'); + return ('web'); } } } @@ -50,7 +64,6 @@ sub setup_vars { sub send_header { my ($request)= @_; $request->print(&Apache::lontexconvert::header()); - $ENV{'request.uri'}=$request->uri; # $request->print('