--- loncom/xml/lonxml.pm 2001/06/16 16:09:09 1.95 +++ loncom/xml/lonxml.pm 2001/06/16 18:34:31 1.96 @@ -225,27 +225,8 @@ sub printalltags { sub xmlparse { my ($target,$content_file_string,$safeinit,%style_for_target) = @_; - if ($target eq 'meta') { - $Apache::lonxml::redirection = 0; - $Apache::lonxml::metamode = 1; - $Apache::lonxml::evaluate = 1; - $Apache::lonxml::import = 0; - } elsif ($target eq 'grade') { - &startredirection; - $Apache::lonxml::metamode = 0; - $Apache::lonxml::evaluate = 1; - $Apache::lonxml::import = 1; - } elsif ($target eq 'modified') { - $Apache::lonxml::redirection = 0; - $Apache::lonxml::metamode = 0; - $Apache::lonxml::evaluate = 0; - $Apache::lonxml::import = 0; - } else { - $Apache::lonxml::redirection = 0; - $Apache::lonxml::metamode = 0; - $Apache::lonxml::evaluate = 1; - $Apache::lonxml::import = 1; - } + + &setup_globals($target); #&printalltags(); my @pars = (); @Apache::lonxml::pwd=(); @@ -472,6 +453,36 @@ sub callsub { return $currentstring; } +sub setup_globals { + my ($target)=@_; + if ($target eq 'meta') { + $Apache::lonxml::redirection = 0; + $Apache::lonxml::metamode = 1; + $Apache::lonxml::evaluate = 1; + $Apache::lonxml::import = 0; + } elsif ($target eq 'grade') { + &startredirection; + $Apache::lonxml::metamode = 0; + $Apache::lonxml::evaluate = 1; + $Apache::lonxml::import = 1; + } elsif ($target eq 'modified') { + $Apache::lonxml::redirection = 0; + $Apache::lonxml::metamode = 0; + $Apache::lonxml::evaluate = 0; + $Apache::lonxml::import = 0; + } elsif ($target eq 'edit') { + $Apache::lonxml::redirection = 0; + $Apache::lonxml::metamode = 0; + $Apache::lonxml::evaluate = 0; + $Apache::lonxml::import = 0; + } else { + $Apache::lonxml::redirection = 0; + $Apache::lonxml::metamode = 0; + $Apache::lonxml::evaluate = 1; + $Apache::lonxml::import = 1; + } +} + sub init_safespace { my ($target,$safeeval,$safehole,$safeinit) = @_; $safeeval->permit("entereval"); @@ -809,7 +820,7 @@ ENDNOTFOUND sub debug { if ($Apache::lonxml::debug eq 1) { - print "DEBUG:".$_[0]."
\n"; + print("DEBUG:".$_[0]."
\n"); } }