--- loncom/homework/structuretags.pm 2012/05/28 13:09:22 1.506 +++ loncom/homework/structuretags.pm 2012/05/28 20:31:11 1.507 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.506 2012/05/28 13:09:22 raeburn Exp $ +# $Id: structuretags.pm,v 1.507 2012/05/28 20:31:11 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1497,7 +1497,13 @@ sub end_problem { $result.=""; } if ($target eq 'web') { - $result.= &Apache::loncommon::end_page({'discussion' => 1}); + # + # Closing not added by end_page(). + # Added separately at end of this routine, after added + # so document will be valid xhtml. + # + $result.= &Apache::loncommon::end_page({'discussion' => 1, + 'notbody' => 1}); } elsif ($target eq 'tex') { my $endminipage = ''; if (not $env{'form.problem_split'}=~/yes/) { @@ -1555,6 +1561,11 @@ sub end_problem { # if ($target eq 'web') { $result .= &Apache::lonhtmlcommon::set_compute_end_time(); + # + # Closing tags delayed so any tags + # not in head can appear inside body, for valid xhtml. + # + $result .= "\n"; } return $result; }