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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 14 Oct 2002 20:47:11 -0000


albertel		Mon Oct 14 16:47:11 2002 EDT

  Modified files:              
    /loncom/xml	scripttag.pm 
  Log:
  - better support of analyze mode in preparation of analyzing problems
  
  
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.77 loncom/xml/scripttag.pm:1.78
--- loncom/xml/scripttag.pm:1.77	Mon Sep 23 13:25:24 2002
+++ loncom/xml/scripttag.pm	Mon Oct 14 16:47:11 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # <script> definiton
 #
-# $Id: scripttag.pm,v 1.77 2002/09/23 17:25:24 albertel Exp $
+# $Id: scripttag.pm,v 1.78 2002/10/14 20:47:11 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -57,7 +57,8 @@
     if ( $target eq "modified" ) {
       $result=$token->[4].&Apache::edit::modifiedfield();
     } elsif ( $target eq 'web' || $target eq 'tex' ||
-	      $target eq 'grade' || $target eq 'answer') {
+	      $target eq 'grade' || $target eq 'answer' ||
+	      $target eq 'analyze' ) {
       &Apache::run::run($bodytext,$safeeval);
       if (($target eq 'answer') && ($Apache::lonhomework::viewgrades == 'F')) {
 	$Apache::lonxml::evaluate--;
@@ -93,7 +94,7 @@
     return $token->[2];
   } elsif ($target eq 'edit' ) {
     return &Apache::edit::end_table();
-  } elsif (($target eq 'answer')) {
+  } elsif ($target eq 'answer') {
     $Apache::lonxml::evaluate++;
   }
   return '';
@@ -108,9 +109,11 @@
   if ( $target eq "modified" ) {
     $result=$token->[4].&Apache::edit::modifiedfield();
   } elsif ( $target eq 'web' || $target eq 'tex' ||
-	    $target eq 'grade' || $target eq 'answer') {
+	    $target eq 'grade' || $target eq 'answer' ||
+	      $target eq 'analyze') {
     $result=&Apache::run::run($bodytext,$safeeval);
-    if ($target eq 'grade' || $target eq 'answer' ) {
+    if ($target eq 'grade' || $target eq 'answer' ||
+	      $target eq 'analyze') {
       $result=''; # grade should produce no output
     }
   } elsif ($target eq "edit" ) {
@@ -135,7 +138,8 @@
   my $result ='';
   my $error='';
 
-  if ($target eq 'web' || $target eq 'grade' || $target eq 'meta' || $target eq 'edit' || $target eq 'answer') {
+  if ($target eq 'web' || $target eq 'grade' || $target eq 'meta' || 
+      $target eq 'edit' || $target eq 'answer' || $target eq 'analyze') {
     $bodytext=$$parser[$#$parser]->get_text("/scriptlib");
     $bodytext=&Apache::run::evaluate($bodytext,$safeeval,
 				     $$parstack[$#$parstack]);
@@ -180,7 +184,8 @@
   my $bodytext;
   my $result ="";
   my $error='';
-  if ($target eq 'web' || $target eq 'grade' || $target eq 'meta' || $target eq 'edit' || $target eq 'answer') {
+  if ($target eq 'web' || $target eq 'grade' || $target eq 'meta' ||
+      $target eq 'edit' || $target eq 'answer' || $target eq 'analyze') {
     $bodytext=$$parser[$#$parser]->get_text("/parserlib");
     $bodytext=&Apache::run::evaluate($bodytext,$safeeval,
 				     $$parstack[$#$parstack]);
@@ -253,7 +258,8 @@
 
   $bodytext=Apache::run::evaluate($bodytext,$safeeval,$$parstack[$#$parstack]);
 
-  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 'analyze' ) {
     # FIXME this probably needs to be smart about construction vs.
     # non construction space.
     my $location=&Apache::lonnet::filelocation($Apache::lonxml::pwd['-1'],$bodytext);
@@ -370,8 +376,8 @@
     $result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,4)
   } elsif ( $target eq 'modified') {
     $result=$token->[4].&Apache::edit::modifiedfield($token);
-  } elsif ( $target eq 'web' || $target eq 'tex' ||
-	    $target eq 'grade' || $target eq 'answer' || $target eq 'meta') {
+  } elsif ( $target eq 'web' || $target eq 'tex' || $target eq 'grade' ||
+	    $target eq 'answer' || $target eq 'meta' || $target eq 'analyze') {
     #normally throw away comments
     my $bodytext=&Apache::lonxml::get_all_text("/comment",$$parser[$#$parser]);
   }