[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm /xml londefdef.pm scripttag.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 29 Mar 2006 22:41:40 -0000


This is a MIME encoded message

--albertel1143672100
Content-Type: text/plain

albertel		Wed Mar 29 17:41:40 2006 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
    /loncom/xml	scripttag.pm londefdef.pm 
  Log:
  - adding webgrade to most tags
  
  
  
--albertel1143672100
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20060329174140.txt"

Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.338 loncom/homework/structuretags.pm:1.339
--- loncom/homework/structuretags.pm:1.338	Thu Mar  2 17:04:04 2006
+++ loncom/homework/structuretags.pm	Wed Mar 29 17:41:32 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.338 2006/03/02 22:04:04 albertel Exp $
+# $Id: structuretags.pm,v 1.339 2006/03/29 22:41:32 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -45,7 +45,7 @@
 sub start_web {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $bodytext=&Apache::lonxml::get_all_text("/web",$parser,$style);
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	return $bodytext;
     }
     return '';
@@ -999,8 +999,8 @@
 
     my $result;
 
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
-	$target eq 'tex' || $target eq 'analyze') {
+    if ($target eq 'web' || $target eq 'grade'   || $target eq 'answer'  ||
+	$target eq 'tex' || $target eq 'analyze' || $target eq 'webgrade') {
 	my $code = $token->[2]->{'condition'};
 	if (defined($code)) {
 	    if (!$Apache::lonxml::default_homework_loaded) {
@@ -1043,8 +1043,8 @@
 
     my $result;
 
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
-	$target eq 'tex' || $target eq 'analyze') {
+    if ($target eq 'web' || $target eq 'grade'   || $target eq 'answer' ||
+	$target eq 'tex' || $target eq 'analyze' || $target eq 'webgrade') {
 	my $include = $token->[2]->{'include'};
 	my $exclude = $token->[2]->{'exclude'};
         my %languages=&Apache::loncommon::display_languages();
@@ -1096,8 +1096,8 @@
 
     my $result;
 
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
-	$target eq 'tex' || $target eq 'analyze') {
+    if ($target eq 'web' || $target eq 'grade'   || $target eq 'answer' ||
+	$target eq 'tex' || $target eq 'analyze' || $target eq 'webgrade') {
         $result=($env{'request.role'}=~/^(in|cc|au|ca|li)/);
 	if ( (! $result) or ($env{'form.instructor_comments'} eq 'hide')) {
 	    my $skip=&Apache::lonxml::get_all_text("/instructorcomment",
@@ -1125,8 +1125,8 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
 
     my $result;
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
-	$target eq 'tex' || $target eq 'analyze') {
+    if ($target eq 'web' || $target eq 'grade'   || $target eq 'answer' ||
+	$target eq 'tex' || $target eq 'analyze' || $target eq 'webgrade') {
 	my $code = $token->[2]->{'condition'};
 
 	push( @Apache::structuretags::whileconds, $code);
@@ -1158,8 +1158,8 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     my $result;
 
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
-	$target eq 'tex' || $target eq 'analyze') {
+    if ($target eq 'web' || $target eq 'grade'   || $target eq 'answer' ||
+	$target eq 'tex' || $target eq 'analyze' || $target eq 'webgrade') {
 	my $code = pop(@Apache::structuretags::whileconds);
 	my $bodytext = pop(@Apache::structuretags::whilebody);
 	my $line = pop(@Apache::structuretags::whileline);
@@ -1192,8 +1192,8 @@
 sub start_randomlist {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result;
-    if ($target eq 'answer' || $target eq 'grade' || $target eq 'web' ||
-	$target eq 'tex' || $target eq 'analyze') {
+    if ($target eq 'answer' || $target eq 'grade'   || $target eq 'web' ||
+	$target eq 'tex'    || $target eq 'analyze' || $target eq 'webgrade') {
 	my $body= &Apache::lonxml::get_all_text("/randomlist",$parser);
 	my $b_parser= HTML::LCParser->new(\$body);
 	$b_parser->xml_mode(1);
@@ -1433,7 +1433,8 @@
 
 sub start_preduedate {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') {
+    if ($target eq 'web' || $target eq 'grade'    || $target eq 'answer' ||
+	$target eq 'tex' || $target eq 'webgrade') {
 	&Apache::lonxml::debug("State in preduedate is ". $Apache::inputtags::status['-1']);
 	if (!$Apache::lonhomework::scantronmode &&
 	    $Apache::inputtags::status['-1'] ne 'CAN_ANSWER' &&
@@ -1451,7 +1452,7 @@
 
 sub start_postanswerdate {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-    if ($target eq 'web' || $target eq 'grade') {
+    if ($target eq 'web' || $target eq 'grade' || $target eq 'webgrade') {
 	if ($Apache::lonhomework::scantronmode ||
 	    $Apache::inputtags::status['-1'] ne 'SHOW_ANSWER') {
 	    &Apache::lonxml::get_all_text("/postanswerdate",$parser,$style);
@@ -1469,7 +1470,7 @@
 sub start_notsolved {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
-	$target eq 'tex') {
+	$target eq 'tex' || $target eq 'webgrade') {
 	my $gradestatus=$Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"};
 	&Apache::lonxml::debug("not solved has :$gradestatus:");
 	if ($gradestatus =~ /^correct/ &&
@@ -1505,8 +1506,8 @@
 sub start_problemtype {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result;
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
-	$target eq 'tex' || $target eq 'analyze') {
+    if ($target eq 'web' || $target eq 'grade'   || $target eq 'answer' ||
+	$target eq 'tex' || $target eq 'analyze' || $target eq 'webgrade') {
 	my $mode=lc(&Apache::lonxml::get_param('mode',$parstack,$safeeval));
 	if (!defined($mode)) { $mode='show'; }
 	my $for=&Apache::lonxml::get_param('for',$parstack,$safeeval);
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.136 loncom/xml/scripttag.pm:1.137
--- loncom/xml/scripttag.pm:1.136	Fri Mar 24 16:45:51 2006
+++ loncom/xml/scripttag.pm	Wed Mar 29 17:41:39 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # <script> definiton
 #
-# $Id: scripttag.pm,v 1.136 2006/03/24 21:45:51 albertel Exp $
+# $Id: scripttag.pm,v 1.137 2006/03/29 22:41:39 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -82,7 +82,7 @@
 
 sub start_LONCAPA_INTERNAL_LONHTTPD_PORT {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'};
 	if (!defined($lonhttpdPort)) { $lonhttpdPort='8080'; }
 	return '<script type="text/javascript">var lonhttpdport=\''.
@@ -222,7 +222,7 @@
 
   if ($target eq 'web' || $target eq 'tex' || $target eq 'grade' ||
       $target eq 'meta' || $target eq 'edit' || $target eq 'answer' ||
-      $target eq 'analyze') {
+      $target eq 'analyze' || $target eq 'webgrade') {
     $bodytext=$$parser[$#$parser]->get_text("/scriptlib");
     $bodytext=&Apache::run::evaluate($bodytext,$safeeval,
 				     $$parstack[$#$parstack]);
@@ -268,7 +268,7 @@
   my $error='';
   if ($target eq 'web' || $target eq 'tex' || $target eq 'grade' ||
       $target eq 'meta' || $target eq 'edit' || $target eq 'answer' ||
-      $target eq 'analyze') {
+      $target eq 'analyze' || $target eq 'webgrade') {
     $bodytext=$$parser[$#$parser]->get_text("/parserlib");
     $bodytext=&Apache::run::evaluate($bodytext,$safeeval,
 				     $$parstack[$#$parstack]);
@@ -309,7 +309,7 @@
 sub start_window {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	&Apache::lonxml::startredirection;
     } elsif ($target eq 'tex') {
 	$result = '\unskip\footnote{';
@@ -331,7 +331,7 @@
 sub end_window {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   my $result;
-  if ($target eq 'web') {
+  if ($target eq 'web' || $target eq 'webgrade') {
     my $output=&Apache::lonxml::endredirection;
     $output =~ s/[\n\r]/ /g;
 #    $output = &HTML::Entities::encode($output,'<>&"\'');
@@ -464,7 +464,7 @@
 sub start_standalone {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   my $result='';
-  if ($target eq 'web' ) {
+  if ($target eq 'web' || $target eq 'webgrade') {
     if ( $env{'request.course.id'} ) {
       my $inside = &Apache::lonxml::get_all_text("/standalone",$parser,$style);
     } else {
@@ -477,7 +477,7 @@
 sub end_standalone {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   my $result='';
-  if ($target eq 'web' ) {
+  if ($target eq 'web' || $target eq 'webgrade' ) {
     if ( $env{'request.course.id'} ) {
     } else {
       $result='</td></tr></table>';
@@ -495,8 +495,9 @@
     $result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,4)
   } elsif ( $target eq 'modified') {
     $result=$token->[4].&Apache::edit::modifiedfield("/comment",$parser);
-  } elsif ( $target eq 'web' || $target eq 'tex' || $target eq 'grade' ||
-	    $target eq 'answer' || $target eq 'meta' || $target eq 'analyze') {
+  } elsif ( $target eq 'web'    || $target eq 'tex'  || $target eq 'grade'   ||
+	    $target eq 'answer' || $target eq 'meta' || $target eq 'analyze' ||
+	    $target eq 'webgrade') {
     #normally throw away comments
     my $bodytext=&Apache::lonxml::get_all_text("/comment",$parser,$style);
   }
@@ -538,7 +539,7 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_;
     my $result = '';
     my $inside = &Apache::lonxml::get_all_text_unbalanced("/num",$parser);
-    if ($target eq 'tex' || $target eq 'web') {
+    if ($target eq 'tex' || $target eq 'web' || $target eq 'webgrade') {
 	$inside=&Apache::run::evaluate($inside,$safeeval,$$parstack[-1]);
 	if (!$Apache::lonxml::default_homework_loaded) {
 	    &Apache::lonxml::default_homework_load($safeeval);
@@ -559,9 +560,9 @@
 sub start_parse {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_;
     my $result = '';
-    if ( $target eq 'web' || $target eq 'tex' ||
-	 $target eq 'grade' || $target eq 'answer' ||
-	 $target eq 'analyze') {
+    if ( $target eq 'web'    || $target eq 'tex'    ||
+	 $target eq 'grade'  || $target eq 'answer' ||
+	 $target eq 'analyze'|| $target eq 'webgrade') {
 	my $inside = &Apache::lonxml::get_all_text_unbalanced("/parse",$parser);
 	$inside=&Apache::run::evaluate($inside,$safeeval,$$parstack[-1]);
 	if (!$Apache::lonxml::default_homework_loaded) {
@@ -589,9 +590,9 @@
 sub start_algebra {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_;
     my $result = '';
-    if ( $target eq 'web' || $target eq 'tex' ||
-	 $target eq 'grade' || $target eq 'answer' ||
-	 $target eq 'analyze') {
+    if ( $target eq 'web'     || $target eq 'tex'    ||
+	 $target eq 'grade'   || $target eq 'answer' ||
+	 $target eq 'analyze' || $target eq 'webgrade') {
 	my $inside = &Apache::lonxml::get_all_text_unbalanced("/algebra",$parser);
 	$inside = &Apache::run::evaluate($inside,$safeeval,$$parstack[-1]);
 	if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.324 loncom/xml/londefdef.pm:1.325
--- loncom/xml/londefdef.pm:1.324	Thu Mar 23 18:47:12 2006
+++ loncom/xml/londefdef.pm	Wed Mar 29 17:41:39 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.324 2006/03/23 23:47:12 albertel Exp $
+# $Id: londefdef.pm,v 1.325 2006/03/29 22:41:39 albertel Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -155,7 +155,7 @@
 sub start_tthoption {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_;
     my $result;
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	my $inside = &Apache::lonxml::get_all_text("/tthoption",$parser,
 						   $style);
 	$inside=~s/^\s*//;
@@ -242,7 +242,7 @@
 sub start_map {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -251,7 +251,7 @@
 sub end_map {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -261,7 +261,7 @@
 sub start_select {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     }  elsif ($target eq 'tex') {
 	$Apache::londefdef::select=0;
@@ -272,7 +272,7 @@
 sub end_select {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -282,7 +282,7 @@
 sub start_option {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	$Apache::londefdef::select++;
@@ -298,7 +298,7 @@
 sub end_option {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     }  elsif ($target eq 'tex') {
 	$currentstring='}';
@@ -310,7 +310,7 @@
 sub start_input {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -319,7 +319,7 @@
 sub end_input {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -329,7 +329,7 @@
 sub start_textarea {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -338,7 +338,7 @@
 sub end_textarea {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -348,7 +348,7 @@
 sub start_form {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -357,7 +357,7 @@
 sub end_form {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -398,7 +398,7 @@
 sub start_meta {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	my $args='';
 	if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
 	if ($args eq '') {
@@ -447,7 +447,7 @@
 sub end_meta {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	my $args='';
 	if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
 	if ($args ne '') {
@@ -612,7 +612,7 @@
 sub start_center {
     my ($target,$token,$tagstack) = @_;
     my $currentstring = &end_p();	# Close off any prior para.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];     
     } elsif ($target eq 'tex') {
 	if (&is_inside_of($tagstack, "table")) {
@@ -626,7 +626,7 @@
 sub end_center {
     my ($target,$token,$tagstack) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];     
     } elsif ($target eq 'tex') {
 	$currentstring = '\end{center}';  
@@ -639,7 +639,7 @@
 sub start_b {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	&disable_para();
@@ -651,7 +651,7 @@
 sub end_b {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];     
     } elsif ($target eq 'tex') {
 	&enable_para();
@@ -665,7 +665,7 @@
 sub start_strong {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	&disable_para();
@@ -677,7 +677,7 @@
 sub end_strong {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {	
+    if ($target eq 'web' || $target eq 'webgrade') {	
 	$currentstring = $token->[2];     
     } elsif ($target eq 'tex') {
 	&enable_para();
@@ -690,7 +690,7 @@
 sub start_h1 {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p();	# Close off any prior para.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	my $pre;
@@ -715,7 +715,7 @@
 sub end_h1 {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	my $post='\vskip 0 mm ';
@@ -739,7 +739,7 @@
 sub start_h2 {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p();	# Close off any prior para.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	my $pre;
@@ -761,7 +761,7 @@
 sub end_h2 {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	my $post='\vskip 0 mm ';
@@ -782,7 +782,7 @@
 sub start_h3 {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p();	# Close off any prior para.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	my $pre;
@@ -804,7 +804,7 @@
 sub end_h3 {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	my $post='\vskip 0 mm ';
@@ -825,7 +825,7 @@
 sub start_h4 {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p();	# Close off any prior para.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	my $pre;
@@ -847,7 +847,7 @@
 sub end_h4 {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	my $post='\vskip 0 mm ';
@@ -868,7 +868,7 @@
 sub start_h5 {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p();	# Close off any prior paras.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	my $pre;
@@ -890,7 +890,7 @@
 sub end_h5 {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	my $post='\vskip 0 mm ';
@@ -911,7 +911,7 @@
 sub start_h6 {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p();	# Close off any prior paras.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	my $pre;
@@ -933,7 +933,7 @@
 sub end_h6 {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	my $post='\vskip 0 mm ';
@@ -954,7 +954,7 @@
 sub start_cite {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\textit{';
@@ -965,7 +965,7 @@
 sub end_cite {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '}';
@@ -977,7 +977,7 @@
 sub start_i {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\textit{';
@@ -988,7 +988,7 @@
 sub end_i {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '}';
@@ -1000,7 +1000,7 @@
 sub start_address {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\textit{';
@@ -1011,7 +1011,7 @@
 sub end_address {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '}';
@@ -1023,7 +1023,7 @@
 sub start_dfn {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\textit{';
@@ -1034,7 +1034,7 @@
 sub end_dfn {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '}';
@@ -1046,7 +1046,7 @@
 sub start_tt {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\texttt{';
@@ -1057,7 +1057,7 @@
 sub end_tt {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '}';
@@ -1069,7 +1069,7 @@
 sub start_kbd {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\texttt{';
@@ -1080,7 +1080,7 @@
 sub end_kbd {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '}';
@@ -1092,7 +1092,7 @@
 sub start_code {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\texttt{';
@@ -1103,7 +1103,7 @@
 sub end_code {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '}';
@@ -1115,7 +1115,7 @@
 sub start_em {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\emph{';
@@ -1126,7 +1126,7 @@
 sub end_em {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '}';
@@ -1138,7 +1138,7 @@
 sub start_q {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\emph{';
@@ -1149,7 +1149,7 @@
 sub end_q {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '}';
@@ -1188,7 +1188,7 @@
 sub start_p {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= &end_p();	# close off prior para if in progress.
 	$currentstring .= $token->[4];
 	if (! ($currentstring =~ /\//)) {
@@ -1245,7 +1245,7 @@
 sub start_br {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	my @tempo=@$tagstack;
@@ -1273,7 +1273,7 @@
 sub end_br {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     }
     return $currentstring;
@@ -1283,7 +1283,7 @@
 sub start_big {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '{\large ';
@@ -1294,7 +1294,7 @@
 sub end_big {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '}';
@@ -1306,7 +1306,7 @@
 sub start_small {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '{\footnotesize ';
@@ -1317,7 +1317,7 @@
 sub end_small {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '}';
@@ -1329,7 +1329,7 @@
 sub start_basefont {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	my $basesize=&Apache::lonxml::get_param('TeXsize',$parstack,$safeeval);
@@ -1343,7 +1343,7 @@
 sub end_basefont {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	my $basesize=&Apache::lonxml::get_param('TeXsize',$parstack,$safeeval);
@@ -1358,7 +1358,7 @@
 sub start_font {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	my $face=&Apache::lonxml::get_param('face',$parstack,$safeeval);
 	if ($face!~/symbol/i) {
 	    if (($env{'browser.fontenhance'} eq 'on') || 
@@ -1377,7 +1377,7 @@
 sub end_font {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     }  elsif ($target eq 'tex') {
 	my $fontsize=&Apache::lonxml::get_param('TeXsize',$parstack,$safeeval);
@@ -1392,7 +1392,7 @@
 sub start_strike {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	&Apache::lonxml::startredirection();
@@ -1403,7 +1403,7 @@
 sub end_strike {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring=&Apache::lonxml::endredirection();
@@ -1418,7 +1418,7 @@
 sub start_s {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	&Apache::lonxml::startredirection();
@@ -1429,7 +1429,7 @@
 sub end_s {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring=&Apache::lonxml::endredirection();
@@ -1444,7 +1444,7 @@
 sub start_sub {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\ensuremath{_{';
@@ -1455,7 +1455,7 @@
 sub end_sub {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '}}';
@@ -1467,7 +1467,7 @@
 sub start_sup {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\ensuremath{^{';
@@ -1478,7 +1478,7 @@
 sub end_sup {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '}}';
@@ -1490,7 +1490,7 @@
 sub start_hr {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p();	# End enclosing para.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	my $LaTeXwidth = &Apache::lonxml::get_param('TeXwidth',$parstack,$safeeval,undef,0);
@@ -1520,7 +1520,7 @@
 sub end_hr {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     }
     return $currentstring;
@@ -1538,7 +1538,7 @@
 sub start_div {
     my ($target,$token, $tagstack, $parstack, $parser, $safeeval) = @_;
     my $currentstring = &end_p();	# Close enclosing para.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } 
     if ($target eq 'tex') {
@@ -1574,7 +1574,7 @@
 sub end_div {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     }
     if ($target eq 'tex') {
@@ -1589,7 +1589,7 @@
 sub start_a {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	my $href=&Apache::lonxml::get_param('href',$parstack,$safeeval,
 					    undef,1);
 	$currentstring=&Apache::lonenc::encrypt_ref($token,{'href'=>$href});
@@ -1611,7 +1611,7 @@
 sub end_a {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     }
     return $currentstring;
@@ -1621,7 +1621,7 @@
 sub start_li {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	my $type=&Apache::lonxml::get_param('type',$parstack,$safeeval,undef,0);
@@ -1652,7 +1652,7 @@
 sub end_li {
     my ($target,$token) = @_;
     my $currentstring = &end_p();	# In case there's a <p> in the <li>
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];     
     } 
     return $currentstring;
@@ -1662,7 +1662,7 @@
 sub start_u {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	&Apache::lonxml::startredirection();
@@ -1673,7 +1673,7 @@
 sub end_u {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring=&Apache::lonxml::endredirection();
@@ -1688,7 +1688,7 @@
 sub start_ul {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p();	# Close off enclosing list.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];     
     } elsif ($target eq 'tex') {
 	my $TeXtype=&Apache::lonxml::get_param('type',$parstack,$safeeval,undef,0);
@@ -1717,7 +1717,7 @@
 sub end_ul {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];     
     } elsif ($target eq 'tex') {
 	$currentstring = '\end{itemize} \renewcommand{\labelitemi}{$\bullet$}'.
@@ -1732,7 +1732,7 @@
 sub start_menu {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	$currentstring = " \\begin{itemize} ";  
@@ -1743,7 +1743,7 @@
 sub end_menu {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];     
     } elsif ($target eq 'tex') {
 	$currentstring = " \\end{itemize}";  
@@ -1755,7 +1755,7 @@
 sub start_dir {
     my ($target,$token) = @_;
     my $currentstring = &end_p();	# In case there's a <p> prior to the list.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];     
     } elsif ($target eq 'tex') {
 	$currentstring .= " \\begin{itemize} ";  
@@ -1766,7 +1766,7 @@
 sub end_dir {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];     
     } elsif ($target eq 'tex') {
 	$currentstring = " \\end{itemize}";  
@@ -1778,7 +1778,7 @@
 sub start_ol {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p();	# In case there's a <p> prior to the list.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];     
     } elsif ($target eq 'tex') {
 	$Apache::londefdef::list_index=0;
@@ -1817,7 +1817,7 @@
 sub end_ol {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];     
     } elsif ($target eq 'tex') {
 	$currentstring = '\end{enumerate}\renewcommand{\labelenumi}{\arabic{enumi}.}'.
@@ -1832,7 +1832,7 @@
 sub start_dl {
     my ($target,$token) = @_;
     my $currentstring = &end_p();	# In case there's a <p> unclosed prior to the list.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];     
     } elsif ($target eq 'tex') {
 	$currentstring .= '\begin{description}';
@@ -1848,7 +1848,7 @@
 sub end_dl {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];     
     } elsif ($target eq 'tex') {
 	if ($Apache::londefdef::DT[-1]) { &end_dt(@_); }
@@ -1870,7 +1870,7 @@
 sub start_dt {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring='';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	if ($Apache::londefdef::DT[-1]) { &end_dt(@_); }
@@ -1885,7 +1885,7 @@
 sub end_dt {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } elsif ($target eq 'tex') {
 	if ($Apache::londefdef::DT[-1]) {
@@ -1908,7 +1908,7 @@
 sub start_dd {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	if ($Apache::londefdef::DT[-1]) { &end_dt(@_); }
@@ -1927,7 +1927,7 @@
 sub end_dd {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     }  elsif ($target eq 'tex') {
 	$Apache::londefdef::description[-1]->[-1].=
@@ -1948,7 +1948,7 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $textwidth = '';
     my $currentstring = &end_p();
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];     
     } elsif ($target eq 'tex') {
 	my $aa = {};
@@ -2036,7 +2036,7 @@
 sub end_table {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];     
     } elsif ($target eq 'tex') {
 	my $inmemory = '';
@@ -2349,7 +2349,7 @@
 sub start_tr {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	$Apache::londefdef::table[-1]{'row_number'}++;
@@ -2377,7 +2377,7 @@
 sub end_tr {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p();	# Close any pending <p> in the row.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];     
     } elsif ($target eq 'tex') {
 	if ($Apache::londefdef::TD_redirection) {
@@ -2399,7 +2399,7 @@
 sub start_td {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	$Apache::londefdef::TD_redirection = 1;
@@ -2608,7 +2608,7 @@
 sub end_td {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];     
     } elsif ($target eq 'tex') {
         $Apache::londefdef::TD_redirection =0;
@@ -2621,7 +2621,7 @@
 sub start_th {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	$Apache::londefdef::TD_redirection = 1;
@@ -2737,7 +2737,7 @@
 sub end_th {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p();	# Close any open <p> in the row.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];     
     } elsif ($target eq 'tex') {
         $Apache::londefdef::TD_redirection =0;
@@ -2761,7 +2761,9 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_;
     my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval,
 					 undef,1);
-    if (not $src and ($target eq 'web' or $target eq 'tex')) { 
+    if (! $src && 
+	($target eq 'web' || $target eq 'webgrade' || $target eq 'tex')
+	) { 
 	my $inside = &Apache::lonxml::get_all_text("/img",$parser,$style);
 	return '';
     }
@@ -2771,7 +2773,7 @@
 
    # Render unto browsers that which are the browser's...
 
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	if ($env{'browser.imagesuppress'} ne 'on') {
 	    my $enc = ('yes' eq 
 		       lc(&Apache::lonxml::get_param('encrypturl',$parstack,
@@ -2971,7 +2973,7 @@
 sub end_img {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring = '';
@@ -2989,7 +2991,7 @@
 					   undef,1);
     &Apache::lonxml::extlink($archive);
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	if ($env{'browser.appletsuppress'} ne 'on') {
 	    $currentstring = &Apache::lonenc::encrypt_ref($token,
 							  {'code'=>$code,
@@ -3022,7 +3024,7 @@
 sub end_applet {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];
     } elsif ($target eq 'tex') {
     } 
@@ -3035,7 +3037,7 @@
     my $src=&Apache::lonxml::get_param('src',$parstack,$safeeval,undef,1);
     &Apache::lonxml::extlink($src);
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	if ($env{'browser.embedsuppress'} ne 'on') {
 	    $currentstring=&Apache::lonenc::encrypt_ref($token,{'src'=>$src});
 	} else {
@@ -3054,7 +3056,7 @@
 sub end_embed {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];     
     } elsif ($target eq 'tex') {  
     } 
@@ -3074,7 +3076,7 @@
     my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval,undef,1);
     &Apache::lonxml::extlink($src);
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	my %toconvert;
 	my $src=&Apache::lonxml::get_param('src',$parstack,$safeeval,undef,1);
 	if ($src) { $toconvert{'src'}= $src; }
@@ -3093,7 +3095,7 @@
 sub end_param {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];     
     } elsif ($target eq 'tex') {
     } 
@@ -3131,7 +3133,7 @@
 sub start_frameset {
     my ($target,$token) = @_;
     my $currentstring = '';	# Close any pending para.
-    if ($target eq 'web') { 
+    if ($target eq 'web' || $target eq 'webgrade') { 
 	if (!$Apache::lonxml::registered &&
 	    $env{'request.state'} eq 'published') {
 	    $currentstring.='<head>'.
@@ -3167,7 +3169,7 @@
 sub end_frameset {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];
     }
     return $currentstring;
@@ -3177,7 +3179,7 @@
 sub start_xmp {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\begin{verbatim}';
@@ -3188,7 +3190,7 @@
 sub end_xmp {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\end{verbatim}';
@@ -3200,7 +3202,7 @@
 sub start_pre {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p();	# close off pending <p>
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\begin{verbatim}';
@@ -3212,7 +3214,7 @@
 sub end_pre {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring .= '\end{verbatim}';
@@ -3225,7 +3227,7 @@
 sub start_insert {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	my $display = &Apache::lonxml::get_param('display',$parstack,$safeeval,undef,1);
 	$currentstring .= '<b>'.$display.'</b>';;
     }
@@ -3235,7 +3237,7 @@
 sub end_insert {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= '';
     }
     return $currentstring;
@@ -3245,7 +3247,7 @@
 sub start_externallink {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	my $display = &Apache::lonxml::get_param('display',$parstack,$safeeval,undef,1);
 	$currentstring .= '<b>'.$display.'</b>';;
     }
@@ -3255,7 +3257,7 @@
 sub end_externallink {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= '';
     }
     return $currentstring;
@@ -3285,7 +3287,7 @@
 sub start_abbr {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3294,7 +3296,7 @@
 sub end_abbr {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3304,7 +3306,7 @@
 sub start_acronym {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3313,7 +3315,7 @@
 sub end_acronym {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3323,7 +3325,7 @@
 sub start_area {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3332,7 +3334,7 @@
 sub end_area {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3342,7 +3344,7 @@
 sub start_base {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     }
     return $currentstring;
@@ -3351,7 +3353,7 @@
 sub end_base {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3361,7 +3363,7 @@
 sub start_bdo {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3370,7 +3372,7 @@
 sub end_bdo {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3380,7 +3382,7 @@
 sub start_bgsound {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3389,7 +3391,7 @@
 sub end_bgsound {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3399,7 +3401,7 @@
 sub start_blink {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3408,7 +3410,7 @@
 sub end_blink {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3418,7 +3420,7 @@
 sub start_blockquote {
     my ($target,$token) = @_;
     my $currentstring = &end_p();	# Close any unclosed <p>
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];     
     } 
     return $currentstring;
@@ -3427,7 +3429,7 @@
 sub end_blockquote {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3437,7 +3439,7 @@
 sub start_button {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3446,7 +3448,7 @@
 sub end_button {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3456,7 +3458,7 @@
 sub start_caption {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3465,7 +3467,7 @@
 sub end_caption {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3475,7 +3477,7 @@
 sub start_col {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3484,7 +3486,7 @@
 sub end_col {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3494,7 +3496,7 @@
 sub start_colgroup {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3503,7 +3505,7 @@
 sub end_colgroup {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3513,7 +3515,7 @@
 sub start_del {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3522,7 +3524,7 @@
 sub end_del {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3532,7 +3534,7 @@
 sub start_fieldset {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3541,7 +3543,7 @@
 sub end_fieldset {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3551,7 +3553,7 @@
 sub start_frame {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3560,7 +3562,7 @@
 sub end_frame {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3570,7 +3572,7 @@
 sub start_iframe {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3579,7 +3581,7 @@
 sub end_iframe {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3589,7 +3591,7 @@
 sub start_ins {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3598,7 +3600,7 @@
 sub end_ins {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3608,7 +3610,7 @@
 sub start_isindex {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3617,7 +3619,7 @@
 sub end_isindex {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3627,7 +3629,7 @@
 sub start_keygen {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3636,7 +3638,7 @@
 sub end_keygen {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3646,7 +3648,7 @@
 sub start_label {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3655,7 +3657,7 @@
 sub end_label {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3665,7 +3667,7 @@
 sub start_layer {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3674,7 +3676,7 @@
 sub end_layer {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3684,7 +3686,7 @@
 sub start_legend {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3693,7 +3695,7 @@
 sub end_legend {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3715,7 +3717,7 @@
 sub end_link {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3725,7 +3727,7 @@
 sub start_marquee {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3734,7 +3736,7 @@
 sub end_marquee {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3744,7 +3746,7 @@
 sub start_multicol {
     my ($target,$token) = @_;
     my $currentstring = &end_p();	# Close any pending <p>
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];     
     } 
     return $currentstring;
@@ -3753,7 +3755,7 @@
 sub end_multicol {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3763,7 +3765,7 @@
 sub start_nobr {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     }  elsif ($target eq 'tex') {
 	$currentstring='\mbox{';
@@ -3774,7 +3776,7 @@
 sub end_nobr {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     }   elsif ($target eq 'tex') {
 	$currentstring='}';
@@ -3786,7 +3788,7 @@
 sub start_noembed {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3795,7 +3797,7 @@
 sub end_noembed {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3805,7 +3807,7 @@
 sub start_noframes {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3814,7 +3816,7 @@
 sub end_noframes {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3824,7 +3826,7 @@
 sub start_nolayer {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3833,7 +3835,7 @@
 sub end_nolayer {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3843,7 +3845,7 @@
 sub start_noscript {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3852,7 +3854,7 @@
 sub end_noscript {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3862,7 +3864,7 @@
 sub start_object {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3871,7 +3873,7 @@
 sub end_object {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3881,7 +3883,7 @@
 sub start_optgroup {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3890,7 +3892,7 @@
 sub end_optgroup {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3900,7 +3902,7 @@
 sub start_samp {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	$currentstring='\texttt{';
@@ -3911,7 +3913,7 @@
 sub end_samp {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } elsif ($target eq 'tex') {
 	$currentstring='}';
@@ -3923,7 +3925,7 @@
 sub start_server {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3932,7 +3934,7 @@
 sub end_server {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3942,7 +3944,7 @@
 sub start_spacer {
     my ($target,$token) = @_;
     my $currentstring = &end_p();	# Close off any open <p> tag.
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[4];     
     } 
     return $currentstring;
@@ -3951,7 +3953,7 @@
 sub end_spacer {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3961,7 +3963,7 @@
 sub start_span {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3970,7 +3972,7 @@
 sub end_span {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3980,7 +3982,7 @@
 sub start_tbody {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -3989,7 +3991,7 @@
 sub end_tbody {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -3999,7 +4001,7 @@
 sub start_tfoot {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -4008,7 +4010,7 @@
 sub end_tfoot {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -4018,7 +4020,7 @@
 sub start_thead {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -4027,7 +4029,7 @@
 sub end_thead {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -4037,7 +4039,7 @@
 sub start_var {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	$currentstring = '\textit{'; 
@@ -4048,7 +4050,7 @@
 sub end_var {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];
     } elsif ($target eq 'tex') {
 	$currentstring = '}'; 
@@ -4060,7 +4062,7 @@
 sub start_wbr {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } 
     return $currentstring;
@@ -4069,7 +4071,7 @@
 sub end_wbr {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } 
     return $currentstring;
@@ -4078,7 +4080,7 @@
 #-- <hideweboutput> tag
 sub start_hideweboutput {
     my ($target,$token) = @_;
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	&Apache::lonxml::startredirection();     
     } 
     return '';
@@ -4087,7 +4089,7 @@
 sub end_hideweboutput {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = &Apache::lonxml::endredirection();    
     } 
     return '';

--albertel1143672100--