--- loncom/homework/structuretags.pm 2002/01/17 12:23:31 1.76 +++ loncom/homework/structuretags.pm 2002/01/23 14:36:19 1.77 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.76 2002/01/17 12:23:31 harris41 Exp $ +# $Id: structuretags.pm,v 1.77 2002/01/23 14:36:19 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -34,7 +34,7 @@ package Apache::structuretags; use strict; use Apache::lonnet; -BEGIN { +sub BEGIN { &Apache::lonxml::register('Apache::structuretags',('block','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','startouttext','endouttext')); # &Apache::lonxml::register_insert('problem','',('part','postanswerdate','preduedate')) } @@ -273,6 +273,8 @@ sub start_problem { } elsif ($target eq 'modified') { $result=$token->[4]; $result.=&Apache::edit::handle_insert(); + } elsif ($target eq 'tex') { + $result .= '\begin{document}\noindent\textbf{Problem.}\newline'; } else { # page_start returned a starting result, delete it if we don't need it $result = ''; @@ -316,6 +318,8 @@ sub end_problem { } elsif ($target eq 'edit') { &Apache::lonxml::debug("in end_problem with $target, edit"); $result='
'; + } elsif ($target eq 'tex') { + $result .= '\end{document}'; } return $result; } @@ -584,7 +588,8 @@ sub end_startouttext { ." ". &Apache::edit::insertlist($target,$token). - &Apache::edit::end_row().&Apache::edit::start_spanning_row()."\n". + " +\n". &Apache::edit::editfield($token->[1],$text,"",50,4); } if ($target eq 'modified') {