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

raeburn raeburn at source.lon-capa.org
Thu Aug 5 21:27:04 EDT 2021


raeburn		Fri Aug  6 01:27:04 2021 EDT

  Modified files:              
    /rat	lonuserstate.pm lonpageflip.pm 
  Log:
  - Bug 6907 Content in a course can be set to be deep-link only.
    - deeplink parameter has 5 components:
      state, others, listing, scope, protect and menus.
    - if value of others component is hide, then resources besides deeplinked
      item(s) are not accessible to students. 
  
  
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.164 rat/lonuserstate.pm:1.165
--- rat/lonuserstate.pm:1.164	Mon Jul 19 15:48:25 2021
+++ rat/lonuserstate.pm	Fri Aug  6 01:27:04 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.164 2021/07/19 15:48:25 raeburn Exp $
+# $Id: lonuserstate.pm,v 1.165 2021/08/06 01:27:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -950,7 +950,6 @@
             @deeplink = &Apache::lonnet::EXT('resource.0.deeplink',$symb,'','','','',$cid,\@recurseup);
         }
         unless (@deeplink < 2) {
-            my ($listed,$scope,$access) = split(/,/,$deeplink[0]);
             $hash{'deeplinkonly_'.$rid}=join(':', at deeplink);
         }
 
@@ -1617,9 +1616,8 @@
                 $deeplink = $hash{'deeplinkonly_'.$loginrid};
             }
             if ($deeplink) {
-                my ($listed,$scope,$access) = split(/,/,$deeplink);
-                my $exclude = 1;
-                if ($exclude) {
+                my ($state,$others,$listed,$scope,$protect) = split(/,/,$deeplink);
+                if ($others eq 'hide') {
                     my @recfolders;
                     if ($scope eq 'rec') {
                         foreach my $key (keys(%hash)) {
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.107 rat/lonpageflip.pm:1.108
--- rat/lonpageflip.pm:1.107	Fri Aug  6 00:52:43 2021
+++ rat/lonpageflip.pm	Fri Aug  6 01:27:04 2021
@@ -2,7 +2,7 @@
 #
 # Page flip handler
 #
-# $Id: lonpageflip.pm,v 1.107 2021/08/06 00:52:43 raeburn Exp $
+# $Id: lonpageflip.pm,v 1.108 2021/08/06 01:27:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -127,8 +127,8 @@
         $deeplinkonly = 0;
         if ($hash{'deeplinkonly_'.$next}) {
             my ($value,$level) = split(/:/,$hash{'deeplinkonly_'.$next});
-            my ($listed,$scope,$access) = split(/,/,$value);
-            unless (($access eq 'any') || ($hash{'is_map_'.$next})) {
+            my ($state,$others,$listed,$scope,$protect) = split(/,/,$value);
+            unless (($state eq 'both') || ($hash{'is_map_'.$next})) {
                 if ($level eq 'resource') {
                     $deeplinkonly = 1;
                 } elsif ($level eq 'map') {
@@ -161,12 +161,11 @@
             }
         } elsif (($hash{'deeplinkonly_'.$prev}) && (!$firstres)) {
             my ($value,$level) = split(/:/,$hash{'deeplinkonly_'.$prev});
-            my ($listed,$scope,$access) = split(/,/,$value);
-            unless (($access eq 'any') || ($hash{'is_map_'.$prev})) {
+            my ($state,$others,$listed,$scope,$protect) = split(/,/,$value);
+            unless (($state eq 'both') || ($hash{'is_map_'.$prev})) {
                 if ($level eq 'resource') {
                     $deeplinkonly = 1;
                 } elsif ($level eq 'map') {
-                    my ($listed,$scope,$access) = split(/,/,$value);
                     if ($scope eq 'rec') {
                         unless ($mapid == $prevmapid) {
                             unless ($deeplinkchecked) {




More information about the LON-CAPA-cvs mailing list