[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm
raeburn
raeburn at source.lon-capa.org
Wed Mar 2 15:07:21 EST 2016
raeburn Wed Mar 2 20:07:21 2016 EDT
Modified files:
/loncom/interface lonnavmaps.pm
Log:
- Bug 4373.
- Map-level parameters which apply recursively to subfolders can be used
for start/end dates for print availability.
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.515 loncom/interface/lonnavmaps.pm:1.516
--- loncom/interface/lonnavmaps.pm:1.515 Wed Mar 2 14:14:06 2016
+++ loncom/interface/lonnavmaps.pm Wed Mar 2 20:07:20 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.515 2016/03/02 14:14:06 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.516 2016/03/02 20:07:20 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2817,6 +2817,7 @@
unless ($symb) { return ['']; }
my $result='';
+ my ($recursed, at recurseup);
# Figure out which map we are in.
@@ -2862,6 +2863,18 @@
if (defined($$useropt{$courseleveli})) {
return $$useropt{$courseleveli};
}
+ unless ($recursed) {
+ @recurseup = $self->recurseup_maps($mapname);
+ $recursed = 1;
+ }
+ foreach my $item (@recurseup) {
+ my $norecursechk=$usercourseprefix.'.'.$item.'___(all).'.$what;
+ last if (defined($$useropt{$norecursechk}));
+ my $recursechk=$usercourseprefix.'.'.$item.'___(rec).'.$what;
+ if (defined($$useropt{$recursechk})) {
+ return $$useropt{$recursechk};
+ }
+ }
}
# Check course -- group
@@ -2875,18 +2888,42 @@
if (defined($$courseopt{$grpleveli})) {
return $$courseopt{$grpleveli};
}
+ unless ($recursed) {
+ @recurseup = $self->recurseup_maps($mapname);
+ $recursed = 1;
+ }
+ foreach my $item (@recurseup) {
+ my $norecursechk=$usercourseprefix.'.['.$cgroup.'].'.$item.'___(all).'.$what;
+ last if (defined($$courseopt{$norecursechk}));
+ my $recursechk=$usercourseprefix.'.['.$cgroup.'].'.$item.'___(rec).'.$what;
+ if (defined($$courseopt{$recursechk})) {
+ return $$courseopt{$recursechk};
+ }
+ }
}
# Check course -- section
- if ($csec and defined($courseopt)) {
+ if ($csec ne '' and defined($courseopt)) {
if (defined($$courseopt{$seclevelm})) {
return $$courseopt{$seclevelm};
}
if (defined($$courseopt{$secleveli})) {
return $$courseopt{$secleveli};
}
+ unless ($recursed) {
+ @recurseup = $self->recurseup_maps($mapname);
+ $recursed = 1;
+ }
+ foreach my $item (@recurseup) {
+ my $norecursechk=$usercourseprefix.'.['.$csec.'].'.$item.'___(all).'.$what;
+ last if (defined($$courseopt{$norecursechk}));
+ my $recursechk=$usercourseprefix.'.['.$csec.'].'.$item.'___(rec).'.$what;
+ if (defined($$courseopt{$recursechk})) {
+ return $$courseopt{$recursechk};
+ }
+ }
}
# Check the map parameters themselves:
@@ -2902,8 +2939,22 @@
if (defined($$courseopt{$courselevelm})) {
return $$courseopt{$courselevelm};
}
+ unless ($recursed) {
+ @recurseup = $self->recurseup_maps($mapname);
+ $recursed = 1;
+ }
+ if (@recurseup) {
+ foreach my $item (@recurseup) {
+ my $norecursechk=$usercourseprefix.'.'.$item.'___(all).'.$what;
+ last if (defined($$courseopt{$norecursechk}));
+ my $recursechk=$usercourseprefix.'.'.$item.'___(rec).'.$what;
+ if (defined($$courseopt{$recursechk})) {
+ return $$courseopt{$recursechk};
+ }
+ }
+ }
}
- return undef; # Unefined if we got here.
+ return undef; # Undefined if we got here.
}
sub course_printdates {
More information about the LON-CAPA-cvs
mailing list