[LON-CAPA-cvs] cvs: rat / lonratsrv.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 27 Jun 2002 17:00:12 -0000


albertel		Thu Jun 27 13:00:12 2002 EDT

  Modified files:              
    /rat	lonratsrv.pm 
  Log:
  - stupidly backed out some changes, Grrr!!!
  - ANy way diffs abainst 1.18 should make things better
  
  
Index: rat/lonratsrv.pm
diff -u rat/lonratsrv.pm:1.19 rat/lonratsrv.pm:1.20
--- rat/lonratsrv.pm:1.19	Thu Jun 27 12:43:57 2002
+++ rat/lonratsrv.pm	Thu Jun 27 13:00:12 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Server for RAT Maps
 #
-# $Id: lonratsrv.pm,v 1.19 2002/06/27 16:43:57 albertel Exp $
+# $Id: lonratsrv.pm,v 1.20 2002/06/27 17:00:12 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -197,7 +197,7 @@
 # ----------------------------------------------------------- Saves map to disk
 
 sub savemap {
-    my ($fn,$errtext,$r)=@_;
+    my ($fn,$errtext)=@_;
     my %alltypes;
     my %allvalues;
     if (($fn=~/\.sequence$/) ||
@@ -262,17 +262,19 @@
            } elsif ($parts[0] eq 'objparms') {
                undef %alltypes;
                undef %allvalues;
-               map {
+               foreach (split(/:/,$parts[$#parts])) {
                    my ($type,$name,$value)=split(/\_\_\_/,$_);
                    $alltypes{$name}=$type;
                    $allvalues{$name}=$value;
-               } split(/:/,$parts[$#parts]);
-               map {
+               }
+               foreach (keys %allvalues) {
+                  if ($allvalues{$_} ne '') {
                    $outstr.='<param to="'.$parts[1].'" type="'
                           .$alltypes{$_}.'" name="'.$_
                           .'" value="'.$allvalues{$_}.'">'
                           ."</param>\n";
-               } keys %allvalues;
+	          }
+               }
            } elsif (($parts[0] ne '') && ($graphdef)) {
 # ------------------------------------------------------------- Graphical input
                $outstr.='<'.$parts[0];
@@ -295,7 +297,7 @@
         }
     } else {
 # -------------------------------------------- Cannot write to that file, error
-        $errtext.='Map not saved: The specified '.$fn.' path does not exist. '.$r->uri();
+        $errtext.='Map not saved: The specified path does not exist. ';
     }
     return $errtext;
 }
@@ -327,7 +329,7 @@
   my $outtext='';
 
   if ($mode ne 'loadonly') {
-     $errtext=&savemap($fn,$errtext,$r);
+     $errtext=&savemap($fn,$errtext);
   }
   ($outtext,$errtext)=&loadmap($fn,$errtext);