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

www lon-capa-cvs@mail.lon-capa.org
Sun, 07 Jul 2002 21:04:47 -0000


www		Sun Jul  7 17:04:47 2002 EDT

  Modified files:              
    /rat	lonpageflip.pm 
  Log:
  Skip over "randomout" resources.
  
  
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.25 rat/lonpageflip.pm:1.26
--- rat/lonpageflip.pm:1.25	Thu May 23 11:07:55 2002
+++ rat/lonpageflip.pm	Sun Jul  7 17:04:47 2002
@@ -2,7 +2,7 @@
 #
 # Page flip handler
 #
-# $Id: lonpageflip.pm,v 1.25 2002/05/23 15:07:55 www Exp $
+# $Id: lonpageflip.pm,v 1.26 2002/07/07 21:04:47 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -238,8 +238,9 @@
               ($next,$endupmap)=&move($rid,$startoutmap,$direction);
 # -------------------------------------- Do we have one and only one empty URL?
               my $safecount=0;
-              while (($next) && ($next!~/\,/) && (!$hash{'src_'.$next})
-                     && ($safecount<25)) {
+              while (($next) && ($next!~/\,/) && 
+                     ((!$hash{'src_'.$next}) || ($hash{'randomout_'.$next}))
+                     && ($safecount<10000)) {
                   ($next,$endupmap)=&move($next,$endupmap,$direction);
                   $safecount++;
               }
@@ -304,14 +305,14 @@
 <table border=2>
 <tr><th>Title</th><th>Type</th></tr>
 ENDSTART
-                     map {
+                     foreach (@possibilities) {
                         $r->print(
                               '<tr><td><a href="'.
                               $multichoicehash{'src_'.$_}.'">'.
                               $multichoicehash{'title_'.$_}.
                               '</a></td><td>'.$multichoicehash{'type_'.$_}.
 			      '</td></tr>');
-                     } @possibilities;
+                     }
                      $r->print('</table></body></html>');
 		     return OK;
                   } else {