--- loncom/homework/lonhomework.pm 2005/06/04 07:47:51 1.210 +++ loncom/homework/lonhomework.pm 2005/08/16 16:31:14 1.216 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.210 2005/06/04 07:47:51 albertel Exp $ +# $Id: lonhomework.pm,v 1.216 2005/08/16 16:31:14 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -94,9 +94,9 @@ sub get_target { if ( defined($env{'form.submitted'}) && ( !defined($env{'form.resetdata'})) && ( !defined($env{'form.newrandomization'}))) { - return ('grade', 'web'); + return ('grade', 'web','answer'); } else { - return ('web'); + return ('web','answer'); } } elsif ($env{'request.state'} eq "construct") { if ( defined($env{'form.grade_target'}) ) { @@ -124,10 +124,10 @@ sub get_target { if ( $env{'form.submit'} eq &mt('Submit Changes and View') ) { return ('modified','web','answer'); } else { - return ('modified','edit'); + return ('modified','no_output_web','edit'); } } else { - return ('edit'); + return ('no_output_web','edit'); } } else { return ('web'); @@ -320,6 +320,9 @@ sub check_access { &Apache::lonxml::debug("checking for part :$id:"); &Apache::lonxml::debug("time:".time); + my ($symb)=&Apache::lonxml::whichuser(); + &Apache::lonxml::debug("symb:".$symb); + #if ($env{'request.state'} ne "construct" && $symb ne '') { if ($env{'request.state'} ne "construct") { my $allowed=&check_ip_acc(&Apache::lonnet::EXT("resource.$id.acc")); if (!$allowed && ($Apache::lonhomework::browse ne 'F')) { @@ -372,7 +375,8 @@ sub check_access { $datemsg = &mt("was due on")." $lastdate".&mt(", and answers will be available on")." $date"; } } - if ($status eq 'CAN_ANSWER') { + if ($status eq 'CAN_ANSWER' || + (($Apache::lonhomework::browse eq 'F') && ($status eq 'CLOSED'))) { #check #tries, and if correct. my $tries = $Apache::lonhomework::history{"resource.$id.tries"}; my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries"); @@ -664,7 +668,7 @@ sub analyze { } } if (scalar(keys(%allparts)) == 0 ) { - $request->print('
'.&mt('Found no analyzable respones in this problem, currently only Numerical, Formula and String response styles are supported.').'
'); + $request->print(''.&mt('Found no analyzable responses in this problem, currently only Numerical, Formula and String response styles are supported.').'
'); } &Apache::lonhtmlcommon::Close_PrgWin($request,\%prog_state); &analyze_footer($request); @@ -707,7 +711,9 @@ sub editxmlmode { $bodytag=&Apache::loncommon::bodytag(); } my $html=&Apache::lonxml::xmlbegin(); - $result.=$html.$bodytag.&Apache::lonxml::message_location().' + $result.=$html.$bodytag. + &renderpage($request,$file,['no_output_web'],1). + &Apache::lonxml::message_location().'