--- loncom/homework/structuretags.pm 2004/05/14 22:11:05 1.248 +++ loncom/homework/structuretags.pm 2004/05/20 23:11:12 1.249 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.248 2004/05/14 22:11:05 albertel Exp $ +# $Id: structuretags.pm,v 1.249 2004/05/20 23:11:12 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -593,10 +593,14 @@ sub end_problem { my $status=$Apache::inputtags::status['-1']; if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex') { - if ( $target eq 'grade' && $Apache::inputtags::part eq '0' && - ($status eq 'CAN_ANSWER' || $Apache::lonhomework::scantronmode)) { + if ( $target eq 'grade' && $Apache::inputtags::part eq '0') { # if part is zero, no s existed, so we need to the grading - &Apache::inputtags::grade; + if ($status eq 'CAN_ANSWER' ||$Apache::lonhomework::scantronmode) { + &Apache::inputtags::grade; + } else { + # move any submission data to .hidden + &Apache::inputtags::hidealldata($Apache::inputtags::part); + } } elsif ( ($target eq 'web' || $target eq 'tex') && $Apache::inputtags::part eq '0' && $status ne 'UNCHECKEDOUT') { @@ -1093,10 +1097,14 @@ sub end_part { my $result=''; if ( $target eq 'meta' ) { $result=''; - } elsif ($target eq 'grade' && - ($status eq 'CAN_ANSWER' || $Apache::lonhomework::scantronmode) && - !$hidden) { - $result=&Apache::inputtags::grade; + } elsif ($target eq 'grade') { + if (($status eq 'CAN_ANSWER' || $Apache::lonhomework::scantronmode) && + !$hidden) { + $result=&Apache::inputtags::grade; + } else { + # move any submission data to .hidden + &Apache::inputtags::hidealldata($Apache::inputtags::part); + } } elsif (($target eq 'web' || $target eq 'tex') && !$hidden ) { my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part, $target);