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

raeburn raeburn@source.lon-capa.org
Fri, 24 Dec 2010 17:30:36 -0000


raeburn		Fri Dec 24 17:30:36 2010 EDT

  Modified files:              (Branch: version_2_10_X)
    /loncom/interface	loncommon.pm 
  Log:
  - Backport 1.990. 
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.948.2.15 loncom/interface/loncommon.pm:1.948.2.16
--- loncom/interface/loncommon.pm:1.948.2.15	Sun Dec 19 22:59:22 2010
+++ loncom/interface/loncommon.pm	Fri Dec 24 17:30:35 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.948.2.15 2010/12/19 22:59:22 raeburn Exp $
+# $Id: loncommon.pm,v 1.948.2.16 2010/12/24 17:30:35 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -11023,6 +11023,36 @@
     return ($symb,$enc);
 }
 
+sub build_release_hashes {
+    my ($checkparms,$checkresponsetypes,$checkcrstypes,$anonsurvey,$randomizetry) = @_;
+    return unless((ref($checkparms) eq 'HASH') && (ref($checkresponsetypes) eq 'HASH') &&
+                  (ref($checkcrstypes) eq 'HASH') && (ref($anonsurvey) eq 'HASH') &&
+                  (ref($randomizetry) eq 'HASH'));
+    foreach my $key (keys(%Apache::lonnet::needsrelease)) {
+        my ($item,$name,$value) = split(/:/,$key);
+        if ($item eq 'parameter') {
+            if (ref($checkparms->{$name}) eq 'ARRAY') {
+                unless(grep(/^\Q$name\E$/,@{$checkparms->{$name}})) {
+                    push(@{$checkparms->{$name}},$value);
+                }
+            } else {
+                push(@{$checkparms->{$name}},$value);
+            }
+        } elsif ($item eq 'resourcetag') {
+            if ($name eq 'responsetype') {
+                $checkresponsetypes->{$value} = $Apache::lonnet::needsrelease{$key}
+            }
+        } elsif ($item eq 'course') {
+            if ($name eq 'crstype') {
+                $checkcrstypes->{$value} = $Apache::lonnet::needsrelease{$key};
+            }
+        }
+    }
+    ($anonsurvey->{major},$anonsurvey->{minor}) = split(/\./,$Apache::lonnet::needsrelease{'parameter:type:anonsurvey'});
+    ($randomizetry->{major},$randomizetry->{minor}) = split(/\./,$Apache::lonnet::needsrelease{'parameter:type:randomizetry'});
+    return;
+}
+
 =pod
 
 =back