[LON-CAPA-cvs] cvs: modules /msu/sentinel sentinelonly.pm
raeburn
lon-capa-cvs-allow@mail.lon-capa.org
Thu, 06 Mar 2008 17:16:28 -0000
raeburn Thu Mar 6 12:16:28 2008 EDT
Modified files:
/modules/msu/sentinel sentinelonly.pm
Log:
- Checking if ref($stucourse{$code} was an ARRAY would always return false.
- Extra inner hash (inner key = 'sections') eliminated so ref checking of value in outer hash can now return true, when appropriate.
Index: modules/msu/sentinel/sentinelonly.pm
diff -u modules/msu/sentinel/sentinelonly.pm:1.4 modules/msu/sentinel/sentinelonly.pm:1.5
--- modules/msu/sentinel/sentinelonly.pm:1.4 Thu Mar 6 11:42:38 2008
+++ modules/msu/sentinel/sentinelonly.pm Thu Mar 6 12:16:28 2008
@@ -2,7 +2,7 @@
# is successful but there is no corresponding account in the
# MSU LON-CAPA domain.
#
-# $Id: sentinelonly.pm,v 1.4 2008/03/06 16:42:38 raeburn Exp $
+# $Id: sentinelonly.pm,v 1.5 2008/03/06 17:16:28 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -143,12 +143,12 @@
my @sections = split(/:/,$seclist);
if (ref($stucourse{$code}) eq 'ARRAY') {
foreach my $sec (@sections) {
- if (!grep(/^\Q$sec\E$/,@{$stucourse{$code}{sections}})) {
- push(@{$stucourse{$code}{sections}},$sec);
+ if (!grep(/^\Q$sec\E$/,@{$stucourse{$code}})) {
+ push(@{$stucourse{$code}},$sec);
}
}
} else {
- @{$stucourse{$code}{sections}} = @sections;
+ @{$stucourse{$code}} = @sections;
}
}
}
@@ -162,7 +162,7 @@
my ($instseclist,$numsec) =
&Apache::coursecatalog::identify_sections($courseinfo{'internal.sectionnums'});
my @instsecs = split(/, /,$instseclist);
- foreach my $stusec (@{$stucourse{$code}{sections}}) {
+ foreach my $stusec (@{$stucourse{$code}}) {
if (grep(/^\Q$stusec\E$/,@instsecs)) {
$matches{$cid} = $allcourses->{$cid};
push(@{$matchedsec{$cid}},$stusec);