--- loncom/xml/lonxml.pm	2002/10/20 18:42:53	1.205
+++ loncom/xml/lonxml.pm	2002/10/21 20:31:06	1.207
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.205 2002/10/20 18:42:53 www Exp $
+# $Id: lonxml.pm,v 1.207 2002/10/21 20:31:06 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -106,6 +106,10 @@ use Apache::lonmsg();
 #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
+$warningcount=0;
+$errorcount=0;
+
 #path to the directory containing the file currently being processed
 @pwd=();
 
@@ -854,6 +858,7 @@ sub setup_globals {
   $Apache::lonxml::registered = 0;
   $errorcount=0;
   $warningcount=0;
+  $Apache::lonxml::default_homework_loaded=0;
   &init_counter();
   @Apache::lonxml::pwd=();
   @Apache::lonxml::extlinks=();
@@ -955,6 +960,18 @@ sub init_safespace {
   &Apache::run::run($safeinit,$safeeval);
 }
 
+sub default_homework_load {
+    my ($safeeval)=@_;
+    &Apache::lonxml::debug('Loading default_homework');
+    my $default=&Apache::lonnet::getfile('/home/httpd/html/res/adm/includes/default_homework.lcpm');
+    if ($default == -1) {
+	&Apache::lonxml::error("<b>Unable to find <i>default_homework.lcpm</i></b>");
+    } else {
+	&Apache::run::run($default,$safeeval);
+	$Apache::lonxml::default_homework_loaded=1;
+    }
+}
+
 sub startredirection {
   $Apache::lonxml::redirection++;
   push (@Apache::lonxml::outputstack, '');