--- loncom/xml/lonxml.pm 2006/03/10 23:49:35 1.401
+++ loncom/xml/lonxml.pm 2010/10/01 14:21:55 1.494.4.5
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.401 2006/03/10 23:49:35 albertel Exp $
+# $Id: lonxml.pm,v 1.494.4.5 2010/10/01 14:21:55 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -37,11 +37,31 @@
# to any other parties under any circumstances.
#
+=pod
+
+=head1 NAME
+
+Apache::lonxml
+
+=head1 SYNOPSIS
+
+XML Parsing Module
+
+This is part of the LearningOnline Network with CAPA project
+described at http://www.lon-capa.org.
+
+
+=head1 SUBROUTINES
+
+=cut
+
+
package Apache::lonxml;
use vars
-qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace $errorcount $warningcount @htmlareafields);
+qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace $errorcount $warningcount);
use strict;
+use LONCAPA;
use HTML::LCParser();
use HTML::TreeBuilder();
use HTML::Entities();
@@ -88,10 +108,14 @@ use Apache::loncommon();
use Apache::lonfeedback();
use Apache::lonmsg();
use Apache::loncacc();
+use Apache::lonmaxima();
+use Apache::lonr();
use Apache::lonlocal;
-#================================================== Main subroutine: xmlparse
+#==================================== Main subroutine: xmlparse
+
#debugging control, to turn on debugging modify the correct handler
+
$Apache::lonxml::debug=0;
# keeps count of the number of warnings and errors generated in a parse
@@ -123,8 +147,8 @@ $evaluate = 1;
# stores the list of active tag namespaces
@namespace=();
-# has the dynamic menu been updated to know about this resource
-$Apache::lonxml::registered=0;
+# stores all Scrit Vars displays for later showing
+my @script_var_displays=();
# a pointer the the Apache request object
$Apache::lonxml::request='';
@@ -133,6 +157,16 @@ $Apache::lonxml::request='';
$Apache::lonxml::counter=1;
$Apache::lonxml::counter_changed=0;
+# Part counter hash. In analysis mode, the
+# problems can use this to record which parts increment the counter
+# by how much. The counter subs will maintain this hash via
+# their optional part parameters. Note that the assumption is that
+# analysis is done in one request and therefore it is not necessary to
+# save this information request-to-request.
+
+
+%Apache::lonxml::counters_per_part = ();
+
#internal check on whether to look at style defs
$Apache::lonxml::usestyle=1;
@@ -162,28 +196,6 @@ sub disable_LaTeX_substitutions {
$Apache::lonxml::substitute_LaTeX_symbols = 0;
}
-sub xmlbegin {
- my ($style)=@_;
- my $output='';
- @htmlareafields=();
- if ($env{'browser.mathml'}) {
- $output=''
- #.''."\n"
-# .'] >'
- .''
- .'';
- } else {
- $output='';
- }
- if ($style eq 'encode') {
- $output=&HTML::Entities::encode($output,'<>&"');
- }
- return $output;
-}
-
sub xmlend {
my ($target,$parser)=@_;
my $mode='xml';
@@ -204,9 +216,9 @@ sub xmlend {
$discussion.='