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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 23 Feb 2006 19:29:26 -0000


albertel		Thu Feb 23 14:29:26 2006 EDT

  Modified files:              
    /rat	lonpageflip.pm 
  Log:
  - need to check if 
    - I can get to the resource through a valid forward path (check the condition_ for the res)
    - and if I can is this link a valid one to take
  
  
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.63 rat/lonpageflip.pm:1.64
--- rat/lonpageflip.pm:1.63	Tue Feb  7 14:46:08 2006
+++ rat/lonpageflip.pm	Thu Feb 23 14:29:26 2006
@@ -2,7 +2,7 @@
 #
 # Page flip handler
 #
-# $Id: lonpageflip.pm,v 1.63 2006/02/07 19:46:08 albertel Exp $
+# $Id: lonpageflip.pm,v 1.64 2006/02/23 19:29:26 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -98,9 +98,11 @@
 	             $rid=$hash{'ids_'.$hash{'map_id_'.(split(/\./,$rid))[0]}};
                   }
 		  foreach my $id (split(/\,/,$hash{'to_'.$rid})) {
-		      my $thiscond=
-      &Apache::lonnet::directcondval($hash{'condid_'.$hash{'undercond_'.$id}});
-                      if ($thiscond>=$mincond) {
+		     my $condition= $hash{'conditions_'.$hash{'goesto_'.$id}};
+		     my $rescond  = &Apache::lonnet::docondval($condition);
+		     my $linkcond = &Apache::lonnet::directcondval($hash{'condid_'.$hash{'undercond_'.$id}});
+		     my $thiscond = ($rescond<$linkcond)?$rescond:$linkcond;
+		     if ($thiscond>=$mincond) {
 		          if ($posnext) {
 		             $posnext.=','.$id.':'.$thiscond;
                           } else {
@@ -138,8 +140,10 @@
 	             $rid=$hash{'ids_'.$hash{'map_id_'.(split(/\./,$rid))[0]}};
 		 }
 		 foreach my $id (split(/\,/,$hash{'from_'.$rid})) {
-		     my $thiscond=
-      &Apache::lonnet::directcondval($hash{'condid_'.$hash{'undercond_'.$id}});
+		     my $condition= $hash{'conditions_'.$hash{'comesfrom_'.$id}};
+		     my $rescond  = &Apache::lonnet::docondval($condition);
+		     my $linkcond = &Apache::lonnet::directcondval($hash{'condid_'.$hash{'undercond_'.$id}});
+		     my $thiscond = ($rescond<$linkcond)?$rescond:$linkcond;
 		     if ($thiscond>=$mincond) {
 			 if ($posnext) {
 		             $posnext.=','.$id.':'.$thiscond;