[LON-CAPA-cvs] cvs: loncom /interface lonsearchcourse.pm

raeburn raeburn at source.lon-capa.org
Sun Feb 11 15:40:37 EST 2024


raeburn		Sun Feb 11 20:40:37 2024 EDT

  Modified files:              
    /loncom/interface	lonsearchcourse.pm 
  Log:
  - For unprivileged users exclude "unlisted" resources from course search
    when deep linking is used in course.
  
  
Index: loncom/interface/lonsearchcourse.pm
diff -u loncom/interface/lonsearchcourse.pm:1.8 loncom/interface/lonsearchcourse.pm:1.9
--- loncom/interface/lonsearchcourse.pm:1.8	Sun Feb 11 20:32:42 2024
+++ loncom/interface/lonsearchcourse.pm	Sun Feb 11 20:40:37 2024
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Course
 #
-# $Id: lonsearchcourse.pm,v 1.8 2024/02/11 20:32:42 raeburn Exp $
+# $Id: lonsearchcourse.pm,v 1.9 2024/02/11 20:40:37 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -136,8 +136,15 @@
         foreach (sort(keys(%hash))) {
             if ($c->aborted()) { last; }
             if (($_=~/^src\_(.+)$/)) {
-                if ($hash{'randomout_'.$1} & !$env{'request.role.adv'}) {
-                    next;
+                my $rid = $1;
+                unless ($env{'request.role.adv'}) {
+                    next if ($hash{'randomout_'.$rid} || $hash{'deeplinkout_'.$rid});
+                    if (!$env{'request.deeplink.login'} && $hash{'deeplinkonly_'.$rid}) {
+                        my ($value) = map { &unescape($_); } split(/:/,$hash{'deeplinkonly_'.$rid});
+                        my ($state,$others,$listed) = split(/,/,$value);
+                        next if (($state eq 'only') &&
+                                 (($listed eq 'absent') || ($listed eq 'grades')));
+                    }
                 }
                 my $symb=&make_symb($1);
                 &checkonthis($r,$1,$hash{$_},0,&Apache::lonnet::gettitle($symb),




More information about the LON-CAPA-cvs mailing list