[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface loncommon.pm

raeburn raeburn at source.lon-capa.org
Sat Sep 11 11:57:33 EDT 2021


raeburn		Sat Sep 11 15:57:33 2021 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	loncommon.pm 
  Log:
  - For 2.11
    Temporarily reverse changes included in rev. 1.1075.2.154 (1.1361 backport) 
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.155 loncom/interface/loncommon.pm:1.1075.2.156
--- loncom/interface/loncommon.pm:1.1075.2.155	Sat Sep 11 14:59:37 2021
+++ loncom/interface/loncommon.pm	Sat Sep 11 15:57:33 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1075.2.155 2021/09/11 14:59:37 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.156 2021/09/11 15:57:33 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -10427,15 +10427,11 @@
 }
 
 sub get_institutional_codes {
-    my ($cdom,$crs,$settings,$allcourses,$LC_code) = @_;
+    my ($settings,$allcourses,$LC_code) = @_;
 # Get complete list of course sections to update
     my @currsections = ();
     my @currxlists = ();
-    my (%unclutteredsec,%unclutteredlcsec);
     my $coursecode = $$settings{'internal.coursecode'};
-    my $crskey = $crs.':'.$coursecode;
-    @{$unclutteredsec{$crskey}} = ();
-    @{$unclutteredlcsec{$crskey}} = ();
 
     if ($$settings{'internal.sectionnums'} ne '') {
         @currsections = split(/,/,$$settings{'internal.sectionnums'});
@@ -10446,8 +10442,8 @@
     }
 
     if (@currxlists > 0) {
-        foreach my $xl (@currxlists) {
-            if ($xl =~ /^([^:]+):(\w*)$/) {
+        foreach (@currxlists) {
+            if (m/^([^:]+):(\w*)$/) {
                 unless (grep/^$1$/,@{$allcourses}) {
                     push(@{$allcourses},$1);
                     $$LC_code{$1} = $2;
@@ -10455,28 +10451,15 @@
             }
         }
     }
-
+ 
     if (@currsections > 0) {
-        foreach my $sec (@currsections) {
-            if ($sec =~ m/^(\w+):(\w*)$/ ) {
-                my $instsec = $1;
+        foreach (@currsections) {
+            if (m/^(\w+):(\w*)$/) {
+                my $sec = $coursecode.$1;
                 my $lc_sec = $2;
-                unless (grep/^\Q$instsec\E$/,@{$unclutteredsec{$crskey}}) {
-                    push(@{$unclutteredsec{$crskey}},$instsec);
-                    push(@{$unclutteredlcsec{$crskey}},$lc_sec);
-                }
-            }
-        }
-    }
-
-    if (@{$unclutteredsec{$crskey}} > 0) {
-        my %formattedsec = &Apache::lonnet::auto_instsec_reformat($cdom,'clutter',\%unclutteredsec);
-        if ((ref($formattedsec{$crskey}) eq 'ARRAY') && (ref($unclutteredlcsec{$crskey}) eq 'ARRAY')) {
-            for (my $i=0; $i<@{$formattedsec{$crskey}}; $i++) {
-                my $sec = $coursecode.$formattedsec{$crskey}[$i];
-                unless (grep/^\Q$sec\E$/,@{$allcourses}) {
+                unless (grep/^$sec$/,@{$allcourses}) {
                     push(@{$allcourses},$sec);
-                    $$LC_code{$sec} = $unclutteredlcsec{$crskey}[$i];
+                    $$LC_code{$sec} = $lc_sec;
                 }
             }
         }




More information about the LON-CAPA-cvs mailing list