[LON-CAPA-cvs] cvs: loncom /interface lonindexcourse.pm
raeburn
raeburn at source.lon-capa.org
Sun Feb 11 23:04:06 EST 2024
raeburn Mon Feb 12 04:04:06 2024 EDT
Modified files:
/loncom/interface lonindexcourse.pm
Log:
- For unprivileged users exclude "unlisted" resources from course index
when deep linking is used in course.
Index: loncom/interface/lonindexcourse.pm
diff -u loncom/interface/lonindexcourse.pm:1.3 loncom/interface/lonindexcourse.pm:1.4
--- loncom/interface/lonindexcourse.pm:1.3 Mon Feb 12 03:46:17 2024
+++ loncom/interface/lonindexcourse.pm Mon Feb 12 04:04:06 2024
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Index Course
#
-# $Id: lonindexcourse.pm,v 1.3 2024/02/12 03:46:17 raeburn Exp $
+# $Id: lonindexcourse.pm,v 1.4 2024/02/12 04:04:06 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -74,8 +74,14 @@
last if ($c->aborted());
if ($key =~ /^src\_(.+)$/) {
my $rid = $1;
- if ($hash{'randomout_'.$rid} & !$env{'request.role.adv'}) {
- next;
+ 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($rid);
my %newwords=&checkonthis($r,$rid,$hash{$key},0,&Apache::lonnet::gettitle($symb),
More information about the LON-CAPA-cvs
mailing list