--- rat/lonuserstate.pm 2002/06/24 14:09:49 1.29 +++ rat/lonuserstate.pm 2002/06/27 14:08:26 1.32 @@ -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.29 2002/06/24 14:09:49 www Exp $ +# $Id: lonuserstate.pm,v 1.32 2002/06/27 14:08:26 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -409,6 +409,7 @@ sub accinit { # ------------------------------------- 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,9 +436,19 @@ sub pickrandom { for (my $k=0; $k<=$#currentrids; $k++) { if ($currentrids[$k]) { $hash{'randomout_'.$currentrids[$k]}=1; + my ($mapid,$resid)=split(/\./,$currentrids[$k]); + $randomoutentry.='&'. + &Apache::lonnet::symbclean( + &Apache::lonnet::declutter($hash{'map_id_'.$mapid}). + '___'.$resid.'___'. + &Apache::lonnet::declutter($hash{'src_'.$currentrids[$k]}) + ).'&'; } } } + if ($randomoutentry) { + &Apache::lonnet::appenv('acc.randomout' => $randomoutentry); + } } # ---------------------------------------------------- Read map and all submaps @@ -467,6 +478,11 @@ sub readmap { %parmhash=(); $errtext=''; $pc=0; + my $furi='/res/'.&Apache::lonnet::declutter($uri); + $hash{'src_0.0'}=$furi; + $hash{'title_0.0'}=&Apache::lonnet::metadata($uri,'title'); + $hash{'ids_'.$furi}='0.0'; + $hash{'is_map_0.0'}=1; loadmap($uri); if (defined($hash{'map_start_'.$uri})) { &traceroute('0',$hash{'map_start_'.$uri},'&');