--- loncom/homework/cleanxml/post_xml.pm 2015/12/18 22:07:42 1.4 +++ loncom/homework/cleanxml/post_xml.pm 2016/01/06 16:44:32 1.5 @@ -1,7 +1,7 @@ # The LearningOnline Network # Third step to clean a file. # -# $Id: post_xml.pm,v 1.4 2015/12/18 22:07:42 damieng Exp $ +# $Id: post_xml.pm,v 1.5 2016/01/06 16:44:32 damieng Exp $ # # Copyright Michigan State University Board of Trustees # @@ -150,7 +150,7 @@ sub fix_structure { # the root element has already been added in pre_xml my $root = $doc->documentElement; # inside the root, replace html, problem and library elements by their content - my @toreplace = ('html','problem','library'); + my @toreplace = ('html','problem','library','Task'); foreach my $name (@toreplace) { my @elements = $root->getElementsByTagName($name); foreach my $element (@elements) { @@ -1812,7 +1812,7 @@ sub remove_useless_notsolved { sub fix_paragraphs_inside { my ($node, $all_block) = @_; # blocks in which paragrahs will be added: - my @blocks_with_p = ('loncapa','library','problem','part','problemtype','window','block','while','postanswerdate','preduedate','solved','notsolved','languageblock','instructorcomment','togglebox','standalone','form'); + my @blocks_with_p = ('loncapa','library','problem','part','problemtype','window','block','while','postanswerdate','preduedate','solved','notsolved','languageblock','instructorcomment','togglebox','standalone','body','form'); my @fix_p_if_br_or_p = (@responses,'foil','item','text','label','hintgroup','hintpart','hint','web','windowlink','div','li','dd','td','th','blockquote'); if ((string_in_array(\@blocks_with_p, $node->nodeName) && paragraph_needed($node)) || (string_in_array(\@fix_p_if_br_or_p, $node->nodeName) && paragraph_inside($node))) {