--- loncom/xml/lonxml.pm 2004/10/12 22:25:40 1.343 +++ loncom/xml/lonxml.pm 2004/11/29 22:45:51 1.347 @@ -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.347 2004/11/29 22:45:51 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -159,7 +159,8 @@ sub xmlbegin { .''; } else { - $output=''; + $output=' +'; } 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\";"; } @@ -1155,7 +1157,10 @@ sub inserteditinfo { if ($filetype eq 'html') { my $addbuttons=&Apache::lonhtmlcommon::htmlareaaddbuttons(); $initialize=&Apache::lonhtmlcommon::htmlareaheaders(). - &Apache::lonhtmlcommon::spellheader().(< $addbuttons @@ -1168,6 +1173,15 @@ $addbuttons } FULLPAGE + } else { + $initialize.=(< +$addbuttons + function initDocument() { + } + +FULLPAGE + } $result=~s/\]*)\>/\/i; $xml_help=&Apache::loncommon::helpLatexCheatsheet(); } @@ -1359,7 +1373,7 @@ sub debug { my $request=$Apache::lonxml::request; if (!$request) { $request=Apache->request; } $request->print('
DEBUG:'.&HTML::Entities::encode($_[0],'<>&"')."
\n"); -# &Apache::lonnet::logthis($_[0]); + #&Apache::lonnet::logthis($_[0]); } } @@ -1572,6 +1586,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'};