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

minaeibi lon-capa-cvs@mail.lon-capa.org
Tue, 19 Feb 2002 20:22:00 -0000


minaeibi		Tue Feb 19 15:22:00 2002 EDT

  Modified files:              
    /loncom/interface	lonchart.pm 
  Log:
  changed map's into foreach's
  
  
Index: loncom/interface/lonchart.pm
diff -u loncom/interface/lonchart.pm:1.30 loncom/interface/lonchart.pm:1.31
--- loncom/interface/lonchart.pm:1.30	Tue Feb 19 13:58:10 2002
+++ loncom/interface/lonchart.pm	Tue Feb 19 15:22:00 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # (Publication Handler
 #
-# $Id: lonchart.pm,v 1.30 2002/02/19 18:58:10 minaeibi Exp $
+# $Id: lonchart.pm,v 1.31 2002/02/19 20:22:00 minaeibi Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -88,10 +88,10 @@
             substr($rowlabels[$index].
             '                                                        ',0,45).' ! ';
     unless ($reply=~/^error\:/) {
-        map {
+        foreach (split(/\&/,$reply)) {
             my ($name,$value)=split(/\=/,&Apache::lonnet::unescape($_));
             $result{$name}=$value;
-        } split(/\&/,$reply);
+        }
 	$ProbNo = 0;
 	$ProbTotal = 0;
         $ProbSolved = 0;
@@ -109,7 +109,7 @@
 	    my $meta=$hash{'src_'.$ResId};
 	    my $PartNo = 0;
 	    undef %TempHash;
-	    map {
+	    foreach (split(/\,/,&Apache::lonnet::metadata($meta,'keys'))) {
 		if ($_=~/^stores\_(\d+)\_tries$/) {
                     my $Part=&Apache::lonnet::metadata($meta,$_.'.part');
 		    if ( $TempHash{"$Part"} eq '' ) { 
@@ -119,7 +119,7 @@
 			$PartNo++;
 		    }
 		}
-            } split(/\,/,&Apache::lonnet::metadata($meta,'keys'));
+            }
 
             my $Prob = &Apache::lonnet::declutter( $hash{'map_id_'.$1} ).
                        '___'.$2.'___'.
@@ -217,9 +217,9 @@
           }
        }
        if (defined($hash{'to_'.$rid})) {
-          map {
+          foreach (split(/\,/,$hash{'to_'.$rid})){
               &tracetable($hash{'goesto_'.$_},$beenhere);
-          } split(/\,/,$hash{'to_'.$rid});
+          }
        }
     }
 }
@@ -239,8 +239,8 @@
                             ('dump:'.$cdom.':'.$cnum.':classlist',$chome);
 	my $now=time;
 	unless ($classlst=~/^error\:/) {
-	    map {
-		my ($name,$value)=split(/\=/,$_);
+	    foreach my $KeyPoint(sort split(/\&/,$classlst)) {
+		my ($name,$value)=split(/\=/,$KeyPoint);
 		my ($end,$start)=split(/\:/,&Apache::lonnet::unescape($value));
 		my $active=1;
 		if (($end) && ($now>$end)) { $active=0; }
@@ -260,11 +260,11 @@
                                      ':environment:lastname&generation&firstname&middlename',
                                                  &Apache::lonnet::homeserver($sname,$sdom));
 			#$ssec=(int($ssec)) ? int($ssec) : $ssec;
-			$rowlabels[$thisindex]=
-			    sprintf('%3s',$ssec).' '.$reply{$sname}.' ';
-			$PreCol[$thisindex] .= $reply.':'.$ssec;
+			my $sec=sprintf('%3s',$ssec);
+			$rowlabels[$thisindex]=$sec.' '.$reply{$sname}.' ';
+			$PreCol[$thisindex] .= $reply.':'.$sec;
 			my $i=0;
-			map {
+			foreach (split(/\&/,$reply)) {
 			    $i++;
 			    if ( $_ ne '') {
 				$rowlabels[$thisindex].=&Apache::lonnet::unescape($_).' ';
@@ -273,10 +273,10 @@
 				chop($rowlabels[$thisindex]);
 				$rowlabels[$thisindex].=', ';
 			    }
-			} split(/\&/,$reply);
+			}
 		    }
 		}
-	    } sort split(/\&/,$classlst);
+	    }
 
 	} else {
 	    $r->print('<h1>Could not access course data</h1>');