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

raeburn lon-capa-cvs@mail.lon-capa.org
Fri, 21 May 2004 20:16:40 -0000


raeburn		Fri May 21 16:16:40 2004 EDT

  Modified files:              
    /rat	lonsequence.pm 
  Log:
  When forward is used to get to the first item in a random pick folder, lonpageflip causes a request to be made for the .sequence URL. lonsequence now checks to see if the first item in the sequence is hidden (i.e., randomout = 1).
  
  
Index: rat/lonsequence.pm
diff -u rat/lonsequence.pm:1.16 rat/lonsequence.pm:1.17
--- rat/lonsequence.pm:1.16	Sun Sep 21 23:02:06 2003
+++ rat/lonsequence.pm	Fri May 21 16:16:40 2004
@@ -2,7 +2,7 @@
 #
 # Sequence Handler
 #
-# $Id: lonsequence.pm,v 1.16 2003/09/22 03:02:06 www Exp $
+# $Id: lonsequence.pm,v 1.17 2004/05/21 20:16:40 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -263,6 +263,7 @@
        if (tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db',
                     &GDBM_READER(),0640)) {
 	   my $disid='';
+           my $randomout ='';
 
            if ($direction eq 'back') {
 	       $disid=$bighash{'map_finish_'.$requrl};
@@ -272,9 +273,10 @@
            if ($disid) {
 	       $disurl=$bighash{'src_'.$disid};
                $dismapid=(split(/\./,$disid))[1];
+               $randomout = $bighash{'randomout_'.$disid};
            }
-# ------------------------- If this is an empty one, skip to next non-empty one
-           if ((!$disurl) && ($disid)) {
+# ----------- If this is an empty one, or hidden, skip to next non-empty or non-hidden one
+           if ( ((!$disurl) && ($disid)) || ($randomout && $disid) ) {
 	       $direction=($direction?$direction:'forward');
                ($disid,$requrl)=
                          &Apache::lonpageflip::fullmove($disid,