--- loncom/homework/structuretags.pm 2011/12/27 19:48:31 1.497.2.6 +++ loncom/homework/structuretags.pm 2013/01/28 18:17:31 1.511 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.497.2.6 2011/12/27 19:48:31 foxr Exp $ +# $Id: structuretags.pm,v 1.511 2013/01/28 18:17:31 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -453,7 +453,6 @@ sub page_start { } $form_tag_start.='>'."\n"; - my $symb=&Apache::lonnet::symbread(); if ($symb =~ /\S/) { $symb= &HTML::Entities::encode(&Apache::lonenc::check_encrypt($symb)); @@ -711,7 +710,7 @@ sub problem_web_to_edit_header { ".&mt("Problem Type:")." '; # create a page header and exit @@ -1465,7 +1511,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/) { @@ -1516,6 +1568,19 @@ sub end_problem { &reset_problem_globals('problem'); + # + # This shouild be just above the return so that the + # time put in the javascript is as late as possible in the + # computation: + # + 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; } @@ -1824,7 +1889,9 @@ sub end_languageblock { $result = &select_hyphenation($which); } $result .= $available_texts{$which}; - $result .= &select_metadata_hyphenation(); # Restore original language. + if ($target eq 'tex') { + $result .= &select_metadata_hyphenation(); # Restore original language. + } } undef(%available_texts); &Apache::lonxml::deregister('Apache::structuretags',('lang')); @@ -2429,7 +2496,7 @@ sub start_problemtype { ['hide','Hide']] ,$token); $result .=&Apache::edit::checked_arg('When used as type(s):','for', - [ ['exam','Exam/Quiz Problem'], + [ ['exam','Bubblesheet Exam/Quiz Problem'], ['survey','Survey'], ['surveycred','Survey (with credit)'], ['anonsurvey','Anonymous Survey'],