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

raeburn raeburn at source.lon-capa.org
Thu Nov 10 21:55:38 EST 2011


raeburn		Fri Nov 11 02:55:38 2011 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - Use values from perlvar in place of hardcoded strings.
  - Update POD for &increment_counter().
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.521 loncom/xml/lonxml.pm:1.522
--- loncom/xml/lonxml.pm:1.521	Fri Oct 14 00:40:32 2011
+++ loncom/xml/lonxml.pm	Fri Nov 11 02:55:37 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.521 2011/10/14 00:40:32 www Exp $
+# $Id: lonxml.pm,v 1.522 2011/11/11 02:55:37 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -844,7 +844,8 @@
 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');
+    my $default=&Apache::lonnet::getfile($Apache::lonnet::perlvar{'lonIncludes'}.
+                                         '/default_homework.lcpm');
     if ($default eq -1) {
 	&Apache::lonxml::error("<b>Unable to find <i>default_homework.lcpm</i></b>");
     } else {
@@ -1014,7 +1015,7 @@
 The value of it is stored in $Apache:lonxml::counter when live and
 stored back to env after done.
 
-=item &increment_counter($increment);
+=item &increment_counter($increment, $part_response);
 
 Increments the internal counter environment variable a specified amount
 
@@ -1847,8 +1848,9 @@
 }
 
 sub show_error_warn_msg {
-    if ($env{'request.filename'} eq '/home/httpd/html/res/lib/templates/simpleproblem.problem' &&
-	&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
+    if (($env{'request.filename'} eq 
+         $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/lib/templates/simpleproblem.problem') &&
+        (&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) {
 	return 1;
     }
     return (($Apache::lonxml::debug eq 1) ||




More information about the LON-CAPA-cvs mailing list