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

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


albertel		Wed Mar 29 17:48:11 2006 EDT

  Modified files:              (Branch: version_2_1_X)
    /loncom/xml	scripttag.pm 
  Log:
  - backport 1.137
  
  
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.134.2.1 loncom/xml/scripttag.pm:1.134.2.2
--- loncom/xml/scripttag.pm:1.134.2.1	Tue Mar 28 23:32:19 2006
+++ loncom/xml/scripttag.pm	Wed Mar 29 17:48:08 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # <script> definiton
 #
-# $Id: scripttag.pm,v 1.134.2.1 2006/03/29 04:32:19 albertel Exp $
+# $Id: scripttag.pm,v 1.134.2.2 2006/03/29 22:48:08 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=\''.
@@ -214,7 +214,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]);
@@ -260,7 +260,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]);
@@ -301,7 +301,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{';
@@ -323,7 +323,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,'<>&"\'');
@@ -440,7 +440,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 {
@@ -453,7 +453,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>';
@@ -471,8 +471,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);
   }
@@ -514,7 +515,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);
@@ -535,9 +536,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) {
@@ -565,9 +566,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') {