[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm

harris41 lon-capa-cvs@mail.lon-capa.org
Thu, 14 Feb 2002 22:13:36 -0000


harris41		Thu Feb 14 17:13:36 2002 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  map to foreach
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.25 loncom/interface/lonnavmaps.pm:1.26
--- loncom/interface/lonnavmaps.pm:1.25	Mon Feb 11 13:59:36 2002
+++ loncom/interface/lonnavmaps.pm	Thu Feb 14 17:13:36 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.25 2002/02/11 18:59:36 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.26 2002/02/14 22:13:36 harris41 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -331,7 +331,7 @@
        if (defined($hash{'to_'.$rid})) {
 	  my $mincond=1;
           my $next='';
-          map {
+          foreach (split(/\,/,$hash{'to_'.$rid})) {
               my $thiscond=
       &Apache::lonnet::directcondval($hash{'condid_'.$hash{'undercond_'.$_}});
               if ($thiscond>=$mincond) {
@@ -342,14 +342,14 @@
 		  }
                   if ($thiscond>$mincond) { $mincond=$thiscond; }
 	      }
-          } split(/\,/,$hash{'to_'.$rid});
-          map {
+          }
+          foreach (split(/\,/,$next)) {
               my ($linkid,$condval)=split(/\:/,$_);
               if ($condval>=$mincond) {
                 my $now=&tracetable($sofar,$hash{'goesto_'.$linkid},$beenhere);
                 if ($now>$further) { $further=$now; }
 	      }
-          } split(/\,/,$next);
+          }
 
        }
     }
@@ -413,11 +413,11 @@
             $courserdatas{$cid.'.last_cache'}=time;
          }
       }
-      map {
+      foreach (split(/\&/,$courserdatas{$cid})) {
          my ($name,$value)=split(/\=/,$_);
          $courseopt{$userprefix.&Apache::lonnet::unescape($name)}=
                     &Apache::lonnet::unescape($value);
-      } split(/\&/,$courserdatas{$cid});
+      }
 # --------------------------------------------------- Get userdata (if present)
       unless
         ((time-$userrdatas{$uname.'___'.$udom.'.last_cache'})<240) {
@@ -428,11 +428,11 @@
 	     $userrdatas{$uname.'___'.$udom.'.last_cache'}=time;
          }
       }
-      map {
+      foreach (split(/\&/,$userrdatas{$uname.'___'.$udom})) {
          my ($name,$value)=split(/\=/,$_);
          $useropt{$userprefix.&Apache::lonnet::unescape($name)}=
 	          &Apache::lonnet::unescape($value);
-      } split(/\&/,$userrdatas{$uname.'___'.$udom});
+      }
     }
 
                   @rows=();