[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 02 Mar 2004 21:31:23 -0000


albertel		Tue Mar  2 16:31:23 2004 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - add access to the &Apache::lonxml::error funtion inside the safe space
  - clean up the error function a bit
  - the use strict in the new evaulate function looks to be uneccessary.
   (I had things backwards in my external test script that I was prototyping in)
  
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.304 loncom/xml/lonxml.pm:1.305
--- loncom/xml/lonxml.pm:1.304	Tue Mar  2 15:59:24 2004
+++ loncom/xml/lonxml.pm	Tue Mar  2 16:31:22 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.304 2004/03/02 20:59:24 matthew Exp $
+# $Id: lonxml.pm,v 1.305 2004/03/02 21:31:22 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -750,6 +750,7 @@
   $safehole->wrap(\&Math::Random::random_set_seed_from_phrase,$safeeval,'&random_set_seed_from_phrase');
   $safehole->wrap(\&Math::Random::random_get_seed,$safeeval,'&random_get_seed');
   $safehole->wrap(\&Math::Random::random_set_seed,$safeeval,'&random_set_seed');
+  $safehole->wrap(\&Apache::lonxml::error,$safeeval,'&LONCAPA_INTERNAL_ERROR');
 
 #need to inspect this class of ops
 # $safeeval->deny(":base_orig");
@@ -768,7 +769,7 @@
     my $__LC__msg;
     while(1){
 	{ 
-	    use strict;
+	    #use strict;
 	    if (eval(defined(eval($__LC__a.$__LC__b)))) {
 		return $__LC__msg.$__LC__prefix.eval($__LC__a.$__LC__b.$__LC__c);
 	    }
@@ -1332,7 +1333,7 @@
   if (($Apache::lonxml::debug eq 1) || ($ENV{'request.state'} eq 'construct') ) {
     # If printing in construction space, put the error inside <pre></pre>
       $request->print($Apache::lonxml::warnings_error_header.
-		      "<b>ERROR:</b>".join("\n",@_)."\n");
+		      "<b>ERROR:</b>".join("<br />\n",@_)."<br />\n");
       $Apache::lonxml::warnings_error_header='';
   } else {
     $request->print("<b>An Error occured while processing this resource. The instructor has been notified.</b> <br />");