Diff for /rat/lonpageflip.pm between versions 1.61 and 1.62

version 1.61, 2006/01/09 18:39:31 version 1.62, 2006/01/09 18:51:26
Line 136  sub move { Line 136  sub move {
                  while ($hash{'type_'.$rid} eq 'start') {                   while ($hash{'type_'.$rid} eq 'start') {
              $rid=$hash{'ids_'.$hash{'map_id_'.(split(/\./,$rid))[0]}};               $rid=$hash{'ids_'.$hash{'map_id_'.(split(/\./,$rid))[0]}};
  }   }
                   map {   foreach my $id (split(/\,/,$hash{'from_'.$rid})) {
                       my $thiscond=       my $thiscond=
       &Apache::lonnet::directcondval($hash{'condid_'.$hash{'undercond_'.$_}});        &Apache::lonnet::directcondval($hash{'condid_'.$hash{'undercond_'.$id}});
                       if ($thiscond>=$mincond) {       if ($thiscond>=$mincond) {
           if ($posnext) {   if ($posnext) {
              $posnext.=','.$_.':'.$thiscond;               $posnext.=','.$id.':'.$thiscond;
                           } else {   } else {
                              $posnext=$_.':'.$thiscond;                               $posnext=$id.':'.$thiscond;
           }   }
                           if ($thiscond>$mincond) { $mincond=$thiscond; }   if ($thiscond>$mincond) { $mincond=$thiscond; }
               }       }
                   } split(/\,/,$hash{'from_'.$rid});   } 
                   map {   foreach my $id (split(/\,/,$posnext)) {
                       my ($linkid,$condval)=split(/\:/,$_);       my ($linkid,$condval)=split(/\:/,$id);
                       if ($condval>=$mincond) {       if ($condval>=$mincond) {
           $next=&addrid($next,$hash{'comesfrom_'.$linkid},   $next=&addrid($next,$hash{'comesfrom_'.$linkid},
                                 $hash{'condid_'.$hash{'undercond_'.$linkid}});         $hash{'condid_'.$hash{'undercond_'.$linkid}});
                       }       }
                   } split(/\,/,$posnext);   }
                   if ($hash{'is_map_'.$next}) {                    if ($hash{'is_map_'.$next}) {
 # This jumps to the end of a new map (going down one level)  # This jumps to the end of a new map (going down one level)
                       if (                        if (
Line 338  sub handler { Line 338  sub handler {
                   } else {                    } else {
 # ------------------------ There are multiple possibilities for a next resource  # ------------------------ There are multiple possibilities for a next resource
                       $multichoice=1;                        $multichoice=1;
                       map {        foreach my $id (@possibilities) {
   $multichoicehash{'src_'.$_}=$hash{'src_'.$_};    $multichoicehash{'src_'.$id}=$hash{'src_'.$id};
                           $multichoicehash{'title_'.$_}=$hash{'title_'.$_};                            $multichoicehash{'title_'.$id}=$hash{'title_'.$id};
                           $multichoicehash{'type_'.$_}=$hash{'type_'.$_};                            $multichoicehash{'type_'.$id}=$hash{'type_'.$id};
                           (my $first, my $second) = $_ =~ /(\d+).(\d+)/;                            (my $first, my $second) = $id =~ /(\d+).(\d+)/;
                           my $symbSrc = Apache::lonnet::declutter($hash{'src_'.$_});                            my $symbSrc = Apache::lonnet::declutter($hash{'src_'.$id});
                           $multichoicehash{'symb_'.$_} =                             $multichoicehash{'symb_'.$id} = 
                               Apache::lonnet::declutter($hash{'map_id_'.$first}.'___'.                                Apache::lonnet::declutter($hash{'map_id_'.$first}.'___'.
                                                         $second.'___'.$symbSrc);                                                          $second.'___'.$symbSrc);
                                                                                                                     
                           my ($choicemap,$choiceres)=split(/\./,$_);                            my ($choicemap,$choiceres)=split(/\./,$id);
   my $map=&Apache::lonnet::declutter($hash{'src_'.$choicemap});    my $map=&Apache::lonnet::declutter($hash{'src_'.$choicemap});
   my $url=$multichoicehash{'src_'.$_};    my $url=$multichoicehash{'src_'.$id};
                           $cachehash{$map}{$url}=[$url,$choiceres];                            $cachehash{$map}{$url}=[$url,$choiceres];
                       } @possibilities;                        }
                   }                    }
       } else {        } else {
 # -------------------------------------------------------------- No place to go  # -------------------------------------------------------------- No place to go
Line 425  $lt{'pick'}: Line 425  $lt{'pick'}:
 <table border=2>  <table border=2>
 <tr><th>$lt{'titleheader'}</th><th>$lt{'type'}</th></tr>  <tr><th>$lt{'titleheader'}</th><th>$lt{'type'}</th></tr>
 ENDSTART  ENDSTART
                      foreach (@possibilities) {                       foreach my $id (@possibilities) {
                         $r->print(                          $r->print(
                               '<tr><td><a href="'.                                '<tr><td><a href="'.
                               $multichoicehash{'src_'.$_}.'?symb=' .                                $multichoicehash{'src_'.$id}.'?symb=' .
                                   Apache::lonnet::escape($multichoicehash{'symb_'.$_}).'">'.                                    Apache::lonnet::escape($multichoicehash{'symb_'.$id}).'">'.
                               $multichoicehash{'title_'.$_}.                                $multichoicehash{'title_'.$id}.
                               '</a></td><td>'.$multichoicehash{'type_'.$_}.                                '</a></td><td>'.$multichoicehash{'type_'.$id}.
       '</td></tr>');        '</td></tr>');
                      }                       }
                      $r->print('</table>');                       $r->print('</table>');

Removed from v.1.61  
changed lines
  Added in v.1.62


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>