--- loncom/xml/lonxml.pm	2004/10/12 22:25:40	1.343
+++ loncom/xml/lonxml.pm	2004/10/21 02:43:34	1.346
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.343 2004/10/12 22:25:40 albertel Exp $
+# $Id: lonxml.pm,v 1.346 2004/10/21 02:43:34 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -159,7 +159,8 @@ sub xmlbegin {
             .'<html xmlns:math="http://www.w3.org/1998/Math/MathML" ' 
 		.'xmlns="http://www.w3.org/TR/REC-html40">';
   } else {
-      $output='<html>';
+      $output='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>';
   }
   return $output;
 }
@@ -1029,6 +1030,7 @@ sub parstring {
       my $val=$token->[2]->{$_};
       $val =~ s/([\%\@\\\"\'])/\\$1/g;
       $val =~ s/(\$[^{a-zA-Z_])/\\$1/g;
+      $val =~ s/(\$)$/\\$1/;
       #if ($val =~ m/^[\%\@]/) { $val="\\".$val; }
       $temp .= "my \$$_=\"$val\";";
     }
@@ -1359,7 +1361,7 @@ sub debug {
 	my $request=$Apache::lonxml::request;
 	if (!$request) { $request=Apache->request; }
 	$request->print('<font size="-2"><pre>DEBUG:'.&HTML::Entities::encode($_[0],'<>&"')."</pre></font>\n");
-#	&Apache::lonnet::logthis($_[0]);
+	#&Apache::lonnet::logthis($_[0]);
     }
 }
 
@@ -1572,6 +1574,12 @@ sub whichuser {
   if (defined($ENV{'form.grade_symb'})) {
     my $tmp_courseid=$ENV{'form.grade_courseid'};
     my $allowed=&Apache::lonnet::allowed('vgr',$tmp_courseid);
+    if (!$allowed && 
+	exists($ENV{'request.course.sec'}) && 
+	$ENV{'request.course.sec'} !~ /^\s*$/) {
+	$allowed=&Apache::lonnet::allowed('vgr',$ENV{'form.grade_courseid'}.
+					  '/'.$ENV{'request.course.sec'});
+    }
     if ($allowed) {
       $symb=$ENV{'form.grade_symb'};
       $courseid=$ENV{'form.grade_courseid'};