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

www lon-capa-cvs@mail.lon-capa.org
Thu, 27 Jun 2002 13:21:04 -0000


www		Thu Jun 27 09:21:04 2002 EDT

  Modified files:              
    /rat	lonuserstate.pm 
  Log:
  Add randomout also to environment, so that it is available to &allowed
  without opening hash.
  
  
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.30 rat/lonuserstate.pm:1.31
--- rat/lonuserstate.pm:1.30	Wed Jun 26 11:44:35 2002
+++ rat/lonuserstate.pm	Thu Jun 27 09:21:04 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construct and maintain state and binary representation of course for user
 #
-# $Id: lonuserstate.pm,v 1.30 2002/06/26 15:44:35 www Exp $
+# $Id: lonuserstate.pm,v 1.31 2002/06/27 13:21:04 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -409,6 +409,7 @@
 # ------------------------------------- Selectively delete from randompick maps
 
 sub pickrandom {
+    my $randomoutentry='';
     foreach my $rid (keys %randompick) {
         my $rndpick=$randompick{$rid};
         my $mpc=$hash{'map_pc_'.$hash{'src_'.$rid}};
@@ -435,8 +436,12 @@
         for (my $k=0; $k<=$#currentrids; $k++) {
             if ($currentrids[$k]) {
 		$hash{'randomout_'.$currentrids[$k]}=1;
+                $randomoutentry.='&'.$currentrids[$k].'&';
             }
         }
+    }
+    if ($randomoutentry) {
+	&Apache::lonnet::appenv('acc.randomout' => $randomoutentry);
     }
 }