[LON-CAPA-cvs] cvs: loncom(version_2_1_X) /xml londefdef.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 29 Mar 2006 23:00:53 -0000


albertel		Wed Mar 29 18:00:53 2006 EDT

  Modified files:              (Branch: version_2_1_X)
    /loncom/xml	londefdef.pm 
  Log:
  - backport 1.324
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.302.2.4 loncom/xml/londefdef.pm:1.302.2.5
--- loncom/xml/londefdef.pm:1.302.2.4	Wed Mar 29 17:54:10 2006
+++ loncom/xml/londefdef.pm	Wed Mar 29 18:00:51 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.302.2.4 2006/03/29 22:54:10 albertel Exp $
+# $Id: londefdef.pm,v 1.302.2.5 2006/03/29 23:00:51 albertel Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -201,7 +201,7 @@
 sub end_html {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = '</html>';
     }
     return $currentstring;
@@ -211,7 +211,7 @@
 sub start_head {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4].&Apache::lonxml::fontsettings();
     } 
     return $currentstring;
@@ -220,7 +220,8 @@
 sub end_head {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web' && $env{'request.state'} eq 'published') {
+    if (($target eq 'web'      && $env{'request.state'} eq 'published') ||
+	($target eq 'webgrade' && $env{'request.state'} eq 'published')) {
 	$currentstring = &Apache::lonmenu::registerurl(undef,$target).
 	    $token->[2];    
     } 
@@ -356,7 +357,7 @@
 sub start_title {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	$currentstring .= '\keephidden{Title of the document:  ' 
@@ -371,7 +372,7 @@
 sub end_title {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[2];    
     } elsif ($target eq 'tex') {
 	$currentstring .= '}';
@@ -502,7 +503,7 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
 
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	if ($Apache::lonhomework::parsing_a_problem) {
 	    &Apache::lonxml::warning("<body> tag found inside of <problem> tag this can cause problems.");
 	    return '';
@@ -586,7 +587,7 @@
 sub end_body {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = &end_p();	# Close off unclosed <p>
-    if ($target eq 'web') {
+    if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= &Apache::lonxml::xmlend($target,$parser);
     } elsif ($target eq 'tex') {
 	$currentstring .= '\strut\newline\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}\newline\noindent \end{document}';  
@@ -3550,7 +3551,7 @@
 sub start_link {
     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);
 	&Apache::lonxml::extlink($href);