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

raeburn raeburn at source.lon-capa.org
Fri Aug 20 23:42:02 EDT 2021


raeburn		Sat Aug 21 03:42:02 2021 EDT

  Modified files:              
    /rat	lonuserstate.pm lonpageflip.pm 
  Log:
  - Bug 6907 Content in a course can be set to be deep-link only.
    - escape the components in each deeplinkonly_$rid item in the big hash.
  
  
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.166 rat/lonuserstate.pm:1.167
--- rat/lonuserstate.pm:1.166	Tue Aug 10 15:28:14 2021
+++ rat/lonuserstate.pm	Sat Aug 21 03:42:02 2021
@@ -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.166 2021/08/10 15:28:14 raeburn Exp $
+# $Id: lonuserstate.pm,v 1.167 2021/08/21 03:42:02 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -950,7 +950,7 @@
             @deeplink = &Apache::lonnet::EXT('resource.0.deeplink',$symb,'','','','',$cid,\@recurseup);
         }
         unless (@deeplink < 2) {
-            $hash{'deeplinkonly_'.$rid}=join(':', at deeplink);
+            $hash{'deeplinkonly_'.$rid}=join(':',map { &escape($_); } @deeplink);
         }
 
 	if (defined($hash{'conditions_'.$rid})) {
@@ -1613,7 +1613,10 @@
             }
             my $deeplink;
             if ($hash{'deeplinkonly_'.$loginrid} ne '') {
-                $deeplink = $hash{'deeplinkonly_'.$loginrid};
+                my @deeplinkinfo = map { &unescape($_); } split(/:/,$hash{'deeplinkonly_'.$loginrid});
+                unless (@deeplinkinfo < 2) {
+                    $deeplink = $deeplinkinfo[0];
+                }
             }
             if ($deeplink) {
                 my $disallow;
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.109 rat/lonpageflip.pm:1.110
--- rat/lonpageflip.pm:1.109	Mon Aug  9 18:51:04 2021
+++ rat/lonpageflip.pm	Sat Aug 21 03:42:02 2021
@@ -2,7 +2,7 @@
 #
 # Page flip handler
 #
-# $Id: lonpageflip.pm,v 1.109 2021/08/09 18:51:04 raeburn Exp $
+# $Id: lonpageflip.pm,v 1.110 2021/08/21 03:42:02 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -126,7 +126,7 @@
 	}
         $deeplinkonly = 0;
         if ($hash{'deeplinkonly_'.$next}) {
-            my ($value,$level) = split(/:/,$hash{'deeplinkonly_'.$next});
+            my ($value,$level) = map { &unescape($_); } split(/:/,$hash{'deeplinkonly_'.$next});
             my ($state,$others,$listed,$scope,$protect) = split(/,/,$value);
             unless (($state eq 'both') || ($hash{'is_map_'.$next})) {
                 if ($level eq 'resource') {
@@ -160,7 +160,7 @@
                 }
             }
         } elsif (($hash{'deeplinkonly_'.$prev}) && (!$firstres)) {
-            my ($value,$level) = split(/:/,$hash{'deeplinkonly_'.$prev});
+            my ($value,$level) = map { &unescape($_); } split(/:/,$hash{'deeplinkonly_'.$prev});
             my ($state,$others,$listed,$scope,$protect) = split(/,/,$value);
             unless (($state eq 'both') || ($hash{'is_map_'.$prev})) {
                 if ($level eq 'resource') {
@@ -690,7 +690,8 @@
                       my $mapid = $hash{'map_pc_'.&Apache::lonnet::clutter($map)};
                       my $position_deeplink = $hash{'deeplinkonly_'.$mapid.'.'.$resid};
                       if ($position_deeplink) {
-                          (my $value,$deeplinklevel) = split(/:/,$position_deeplink);
+                          (my $value,$deeplinklevel) = map { &unescape($_); } 
+                                                       split(/:/,$position_deeplink);
                       }
                   }
               }




More information about the LON-CAPA-cvs mailing list