--- loncom/homework/lonhomework.pm 2001/02/19 14:53:54 1.38 +++ loncom/homework/lonhomework.pm 2001/06/12 22:42:55 1.46 @@ -15,6 +15,11 @@ use Apache::hint; use Apache::outputtags; use Apache::Constants qw(:common); + +sub BEGIN { + &Apache::lonxml::register_insert(); +} + sub get_target { if ( $ENV{'request.state'} eq "published") { if ( defined $ENV{'form.submitted'}) { @@ -30,9 +35,21 @@ sub get_target { return ('web'); } } else { - #return ('edit'); - #edit is currently broken - return ('web'); + 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 ('web'); + } } } return (); @@ -47,7 +64,6 @@ sub setup_vars { sub send_header { my ($request)= @_; $request->print(&Apache::lontexconvert::header()); - $ENV{'request.uri'}=$request->uri; # $request->print('