[LON-CAPA-cvs] cvs: loncom /interface courseprefs.pm lonblockingmenu.pm loncommon.pm lonparmset.pm lonrelrequtils.pm /lonnet/perl lonnet.pm /misc releaseslist.xml

raeburn raeburn at source.lon-capa.org
Fri Mar 4 16:43:34 EST 2016


raeburn		Fri Mar  4 21:43:34 2016 EDT

  Modified files:              
    /loncom/interface	courseprefs.pm lonblockingmenu.pm loncommon.pm 
                     	lonparmset.pm lonrelrequtils.pm 
    /loncom/misc	releaseslist.xml 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Bug 4373. 
    - Setting map-level parameters which apply recursively to subfolders is
      not permitted unless course's homeserver is running 2.12.
      (hiddenresource and encrypturl exempt, since they have always recursed).
  
  
-------------- next part --------------
Index: loncom/interface/courseprefs.pm
diff -u loncom/interface/courseprefs.pm:1.75 loncom/interface/courseprefs.pm:1.76
--- loncom/interface/courseprefs.pm:1.75	Sat Feb 20 00:12:39 2016
+++ loncom/interface/courseprefs.pm	Fri Mar  4 21:43:15 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set configuration settings for a course
 #
-# $Id: courseprefs.pm,v 1.75 2016/02/20 00:12:39 raeburn Exp $
+# $Id: courseprefs.pm,v 1.76 2016/03/04 21:43:15 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2557,7 +2557,7 @@
                         if (grep(/^\Q$value\E$/,@{$Apache::lonrelrequtils::checkparms{$item}})) {
                             my $stdtype = &Apache::lonparmset::standard_parameter_types($item);
                             $found{$item}{'valname'} = &get_param_description($stdtype,$value);
-                            $found{$item}{'rev'} = $Apache::lonnet::needsrelease{'parameter:'.$item.':'.$value.':'};
+                            $found{$item}{'rev'} = $Apache::lonnet::needsrelease{'parameter:'.$item.':'.$value.'::'};
                         }
                     }
                 }
@@ -2570,16 +2570,39 @@
                             my $stdtype = &Apache::lonparmset::standard_parameter_types($item);
                             $found{$item}{'valname'} = &get_param_description($stdtype,$value,1);
                             $found{$item}{'rev'} = 
-                                $Apache::lonnet::needsrelease{'parameter:'.$item.'::'.$valuematch};
+                                $Apache::lonnet::needsrelease{'parameter:'.$item.'::'.$valuematch.':'};
                             last;
                         }
                     }
                 }
             }
+            foreach my $item (keys(%Apache::lonrelrequtils::checkparmnamesmatch)) {
+                my $regexp;
+                if ($item eq 'maplevelrecurse') {
+                    $regexp = '\.(?:sequence|page)___\(rec\)\.';
+                }
+                if ($regexp ne '') {
+                    if ($key =~ /$regexp.*\.(\w+)$/) {
+                        my $name = $1;
+                        my $value = $resourcedata->{$key};
+                        if ($name eq 'type') { 
+                            last unless (($value eq 'problem') || ($value eq 'practice') || ($value eq 'exam') ||
+                                         ($value eq 'survey') || ($value eq 'surveycred') || ($value eq 'anonsurvey') || 
+                                         ($value eq 'anonsurveycred') || ($value eq 'randomizetry') || ($value eq 'library'));
+                        }
+                        my $stdtype = &Apache::lonparmset::standard_parameter_types($name);
+                        $found{$name}{'valname'} = &get_param_description($stdtype,$value);
+                        $found{$name}{'extra'} = &mt('Recursive into sub-folders');
+                        $found{$name}{'rev'} =
+                            $Apache::lonnet::needsrelease{'parameter::::'.$item};
+                    }
+                }
+            }
             foreach my $item (keys(%found)) {
                 my $stdname = &Apache::lonparmset::standard_parameter_names($item);
                 my $rev = $found{$item}{'rev'};
                 my $valname = $found{$item}{'valname'};
+                my $extra = $found{$item}{'extra'};
                 my ($middle,$scope,$which,$level,$map,$resource);  
                 my $start = $cid.'.';
                 if ($key =~ /^\Q$start\E(\[useropt\:($match_username\:$match_domain)\]\.)/) {
@@ -2594,6 +2617,9 @@
                     $scope = 'all';
                 }
                 my $what="$stdname=$valname";
+                if ($extra) {
+                    $what .= "<br/>$extra<br />";
+                }
                 if ($key =~ /^\Q$start$middle\E\w+\.\Q$item\E$/) {
                     $level = 'general';
                     if ($scope eq 'all') {
@@ -2614,7 +2640,7 @@
                         }
                     }
                     $rowspan{$rev} ++;
-                } elsif ($key =~ /^\Q$start$middle\E(.+)___\(all\).\w+\.\Q$item\E$/) {
+                } elsif ($key =~ /^\Q$start$middle\E(.+)___\((all|rec)\).\w+\.\Q$item\E$/) {
                     $level = 'folder';
                     $map = $1;
                     if ($scope eq 'all') {
@@ -2769,9 +2795,9 @@
 
     if (defined($navmap)) {
         my %anonsubms=&Apache::lonnet::dump('nohist_anonsurveys',$cdom,$cnum);
-        my $rev_anonsurv=$Apache::lonnet::needsrelease{'parameter:type:anonsurvey:'};
+        my $rev_anonsurv=$Apache::lonnet::needsrelease{'parameter:type:anonsurvey::'};
         my %randtrysubms=&Apache::lonnet::dump('nohist_randomizetry',$cdom,$cnum);
-        my $rev_randtry=$Apache::lonnet::needsrelease{'parameter:type:randomizetry:'};
+        my $rev_randtry=$Apache::lonnet::needsrelease{'parameter:type:randomizetry::'};
         my $stdtype=&Apache::lonparmset::standard_parameter_types('type');
         my $stdname=&Apache::lonparmset::standard_parameter_names('type');
         my $valanon=&get_param_description($stdtype,'anonsurvey');
@@ -3106,6 +3132,13 @@
         if (ref($paramstrings) eq 'ARRAY') {
             @possibles = @{$paramstrings};
         } else {
+            if (($stdtype eq 'date_start') || ($stdtype eq 'date_end')) {
+                if ($name == 0) {
+                    $name = &mt('Never');
+                } elsif (($name ne '') && ($name !~ /\D/)) {
+                    $name = &Apache::lonlocal::locallocaltime($name);
+                }
+            }
             return $name;
         }
     }
Index: loncom/interface/lonblockingmenu.pm
diff -u loncom/interface/lonblockingmenu.pm:1.17 loncom/interface/lonblockingmenu.pm:1.18
--- loncom/interface/lonblockingmenu.pm:1.17	Wed Jan 27 03:04:49 2016
+++ loncom/interface/lonblockingmenu.pm	Fri Mar  4 21:43:15 2016
@@ -2,7 +2,7 @@
 # Routines for configuring blocking of access to collaborative functions, 
 # and specific resources during an exam
 #
-# $Id: lonblockingmenu.pm,v 1.17 2016/01/27 03:04:49 raeburn Exp $
+# $Id: lonblockingmenu.pm,v 1.18 2016/03/04 21:43:15 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -951,7 +951,7 @@
 
 sub check_release_required {
     my ($value,$chomemajor,$chomeminor) = @_; 
-    my $needsrelease = $Apache::lonnet::needsrelease{'course:commblock:'.$value.':'};
+    my $needsrelease = $Apache::lonnet::needsrelease{'course:commblock:'.$value};
     if ($needsrelease) {
         my ($needsmajor,$needsminor) = split(/\./,$needsrelease);
         if (($chomemajor < $needsmajor) || 
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1235 loncom/interface/loncommon.pm:1.1236
--- loncom/interface/loncommon.pm:1.1235	Sat Feb 20 00:12:39 2016
+++ loncom/interface/loncommon.pm	Fri Mar  4 21:43:15 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1235 2016/02/20 00:12:39 raeburn Exp $
+# $Id: loncommon.pm,v 1.1236 2016/03/04 21:43:15 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -16337,7 +16337,7 @@
     my ($reqdmajor,$reqdminor) = split(/\./,$curr_reqd_hash{'internal.releaserequired'});
     my %checkresponsetypes;
     foreach my $key (keys(%Apache::lonnet::needsrelease)) {
-        my ($item,$name,$value,$valmatch) = split(/:/,$key);
+        my ($item,$name,$value) = split(/:/,$key);
         if ($item eq 'resourcetag') {
             if ($name eq 'responsetype') {
                 $checkresponsetypes{$value} = $Apache::lonnet::needsrelease{$key}
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.556 loncom/interface/lonparmset.pm:1.557
--- loncom/interface/lonparmset.pm:1.556	Wed Mar  2 14:14:06 2016
+++ loncom/interface/lonparmset.pm	Fri Mar  4 21:43:15 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.556 2016/03/02 14:14:06 raeburn Exp $
+# $Id: lonparmset.pm,v 1.557 2016/03/04 21:43:15 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -759,7 +759,6 @@
     &Apache::lonnet::expirespread('','','studentcalc');
     if (($snum==13) || ($snum==9) || ($snum==5)) {
         &Apache::lonnet::expirespread('','','assesscalc',$symb);
-#FIXME
     } elsif (($snum==14) || ($snum==10) || ($snum==6)) {
         &Apache::lonnet::expirespread('','','assesscalc',$map);
     } else {
@@ -2412,13 +2411,16 @@
         my $totalstored = 0;
         my $now = time;
         for (my $i=0;$i<=$#markers;$i++) {
-            my ($needsrelease,$needsnewer,$name);
+            my ($needsrelease,$needsnewer,$name,$namematch);
             if (($env{'request.course.sec'} ne '') && ($markers[$i] =~ /\&(9|10|11|12)$/)) {
                 next if ($csec ne $env{'request.course.sec'});
             }
             if ($markers[$i] =~ /\&(8|7|6|5)$/) {
                 next if ($noeditgrp);
-            } 
+            }
+            if ($markers[$i] =~ /\&(17|11|7|3)$/) {
+                $namematch = 'maplevelrecurse';
+            }
             if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3|4)$/) {
                 my (@ok_slots, at fail_slots, at del_slots);
                 my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom);
@@ -2505,19 +2507,42 @@
                     }
                 }
                 $needsrelease =
-                    $Apache::lonnet::needsrelease{"parameter:$name:$val:$valmatch"};
+                    $Apache::lonnet::needsrelease{"parameter:$name:$val:$valmatch:"};
                 if ($needsrelease) {
                     unless ($got_chostname) {
                         ($chostname,$cmajor,$cminor) = &parameter_release_vars();
                         $got_chostname = 1;
                     } 
-                    $needsnewer = &parameter_releasecheck($name,$val,$valmatch,
+                    $needsnewer = &parameter_releasecheck($name,$val,$valmatch,undef,
                                                           $needsrelease,
                                                           $cmajor,$cminor);
                 }
             }
             if ($needsnewer) {
-                $message .= &oldversion_warning($name,$values[$i],$chostname,$cmajor,
+                undef($namematch);
+            } else {
+                my $currneeded;
+                if ($needsrelease) {
+                    $currneeded = $needsrelease;
+                }
+                if ($namematch) {
+                    $needsrelease =
+                        $Apache::lonnet::needsrelease{"parameter::::$namematch"};
+                    if (($needsrelease) && (($currneeded eq '') || ($needsrelease < $currneeded))) {
+                        unless ($got_chostname) {
+                            ($chostname,$cmajor,$cminor) = &parameter_release_vars();
+                            $got_chostname = 1;
+                        }
+                        $needsnewer = &parameter_releasecheck(undef,undef,undef,$namematch,
+                                                              $needsrelease,
+                                                              $cmajor,$cminor);
+                    } else {
+                        undef($namematch);
+                    }
+                }
+            }
+            if ($needsnewer) {
+                $message .= &oldversion_warning($name,$namematch,$values[$i],$chostname,$cmajor,
                                                 $cminor,$needsrelease);
             } else {
                 $message.=&storeparm(split(/\&/,$markers[$i]),
@@ -3153,7 +3178,7 @@
         $tkey=~s/\.\[useropt\:$tuname\:$tudom\]\./\./;
         }
         if ($cmd eq 'set' || $cmd eq 'datepointer' || $cmd eq 'dateinterval') {
-        my ($data, $typeof, $text, $name, $valchk, $valmatch);
+        my ($data, $typeof, $text, $name, $valchk, $valmatch, $namematch);
         if ($cmd eq 'set') {
             $data=$env{$key};
             $valmatch = '';
@@ -3234,24 +3259,51 @@
             $typeof=$env{'form.typeof_'.$thiskey};
             $text = &mt('Saved modified date for');
         }
-        if ($name ne '') {
+        if ($thiskey =~ m{\.(?:sequence|page)___\(rec\)}) {
+            $namematch = 'maplevelrecurse';
+        }
+        if (($name ne '') || ($namematch ne '')) {
             my ($needsrelease,$needsnewer);
-            $needsrelease = $Apache::lonnet::needsrelease{"parameter:$name:$valchk:$valmatch"};
-            if ($needsrelease) {
-                unless ($got_chostname) {
-                    ($chostname,$cmajor,$cminor)=&parameter_release_vars();
-                    $got_chostname = 1;
+            if ($name ne '') {
+                $needsrelease = $Apache::lonnet::needsrelease{"parameter:$name:$valchk:$valmatch:"};
+                if ($needsrelease) {
+                    unless ($got_chostname) {
+                        ($chostname,$cmajor,$cminor)=&parameter_release_vars();
+                        $got_chostname = 1;
+                    }
+                    $needsnewer = &parameter_releasecheck($name,$valchk,$valmatch,undef,
+                                                          $needsrelease,
+                                                          $cmajor,$cminor);
                 }
-                $needsnewer = &parameter_releasecheck($name,$valchk,$valmatch,
-                                                      $needsrelease,
-                                                      $cmajor,$cminor);
+            }
+            if ($namematch ne '') {
                 if ($needsnewer) {
-                    $r->print('<br />'.&oldversion_warning($name,$data,
-                                                           $chostname,$cmajor,
-                                                           $cminor,$needsrelease));
-                    next;
+                    undef($namematch);
+                } else {
+                    my $currneeded;
+                    if ($needsrelease) {
+                        $currneeded = $needsrelease;
+                    }
+                    $needsrelease =
+                        $Apache::lonnet::needsrelease{"parameter::::$namematch"};
+                    if (($needsrelease) && (($currneeded eq '') || ($needsrelease < $currneeded))) {
+                        unless ($got_chostname) {
+                            ($chostname,$cmajor,$cminor) = &parameter_release_vars();
+                            $got_chostname = 1;
+                        }
+                        $needsnewer = &parameter_releasecheck(undef,$valchk,$valmatch,$namematch,
+                                                              $needsrelease,$cmajor,$cminor);
+                    } else {
+                        undef($namematch);
+                    }
                 }
             }
+            if ($needsnewer) {
+                $r->print('<br />'.&oldversion_warning($name,$namematch,$data,
+                                                       $chostname,$cmajor,
+                                                       $cminor,$needsrelease));
+                next;
+            }
         }
         if (defined($data) and $$olddata{$thiskey} ne $data) {
             if ($tuname) {
@@ -3735,7 +3787,7 @@
                     ($chostname,$cmajor,$cminor)=&parameter_release_vars();
                     $got_chostname = 1;
                 }
-                my $needsnewer=&parameter_releasecheck($name,$parmval,$parmmatch,
+                my $needsnewer=&parameter_releasecheck($name,$parmval,$parmmatch,undef,
                                                        $needsrelease,$cmajor,$cminor);
                 if ($needsnewer) {
                     if ($parmmatch ne '') {
@@ -3914,7 +3966,7 @@
                     ($chostname,$cmajor,$cminor)=&parameter_release_vars();
                     $got_chostname = 1;
                 }
-                my $needsnewer=&parameter_releasecheck($name,$parmval,$parmmatch,
+                my $needsnewer=&parameter_releasecheck($name,$parmval,$parmmatch,undef,
                                                        $needsrelease,$cmajor,$cminor);
                 if ($needsnewer) {
                     if ($parmmatch ne '') {
@@ -3963,7 +4015,24 @@
 }
 
 sub oldversion_warning {
-    my ($name,$value,$chostname,$cmajor,$cminor,$needsrelease) = @_;
+    my ($name,$namematch,$value,$chostname,$cmajor,$cminor,$needsrelease) = @_;
+    my $standard_name = &standard_parameter_names($name);
+    if ($namematch) {
+        my $level = &standard_parameter_levels($namematch);
+        my $msg = '';
+        if ($level) {
+            $msg = &mt('[_1] was [_2]not[_3] set at the level of: [_4].',
+                       $standard_name,'<b>','</b>','"'.$level.'"');
+        } else {
+            $msg = &mt('[_1] was [_2]not[_3] set.',
+                      $standard_name,'<b>','</b>');
+        }
+        return '<p class="LC_warning">'.$msg.'<br />'.
+               &mt('LON-CAPA version ([_1]) installed on home server ([_2]) does not meet version requirements ([_3] or newer).',
+                   $cmajor.'.'.$cminor,$chostname,
+                   $needsrelease).
+                   '</p>';
+    }
     my $desc;
     my $stringtype = &get_stringtype($name);
     if ($stringtype ne '') {
@@ -4008,14 +4077,13 @@
             }
         }
     }
-    my $standard_name = &standard_parameter_names($name);
     return '<p class="LC_warning">'.
-           &mt('[_1] was [_2]not[_3] set to [_4].',
-               $standard_name,'<b>','</b>','"'.$desc.'"').'<br />'.
-           &mt('LON-CAPA version ([_1]) installed on home server ([_2]) does not meet version requirements ([_3] or newer).',
-           $cmajor.'.'.$cminor,$chostname,
-           $needsrelease).
-           '</p>';
+       &mt('[_1] was [_2]not[_3] set to [_4].',
+           $standard_name,'<b>','</b>','"'.$desc.'"').'<br />'.
+       &mt('LON-CAPA version ([_1]) installed on home server ([_2]) does not meet version requirements ([_3] or newer).',
+       $cmajor.'.'.$cminor,$chostname,
+       $needsrelease).
+       '</p>';
 }
 
 }
@@ -5177,6 +5245,20 @@
     return;
 }
 
+sub standard_parameter_levels {
+    my ($name)=@_;
+    my %levels = (
+                    'resourcelevel'   => 'a single resource',
+                    'maplevel'        => 'the enclosing map/folder', 
+                    'maplevelrecurse' => 'the enclosing map/folder (recursive into sub-folders)',
+                    'courselevel'     => 'the general (course) level',
+                 );
+    if ($levels{$name}) {
+        return $levels{$name};
+    }
+    return;
+}
+
 sub parm_change_log {
     my ($r)=@_;
     my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
@@ -5472,16 +5554,20 @@
 }
 
 sub parameter_releasecheck {
-    my ($name,$value,$valmatch,$needsrelease,$cmajor,$cminor) = @_;
+    my ($name,$value,$valmatch,$namematch,$needsrelease,$cmajor,$cminor) = @_;
     my $needsnewer;
     my ($needsmajor,$needsminor) = split(/\./,$needsrelease);
     if (($cmajor < $needsmajor) || 
         ($cmajor == $needsmajor && $cminor < $needsminor)) {
         $needsnewer = 1;
-    } elsif ($valmatch) {
-        &Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter:'.$name.'::'.$valmatch});
-    } elsif ($value) { 
-        &Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter:'.$name.':'.$value.':'});
+    } elsif ($name) {
+        if ($valmatch) {
+            &Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter:'.$name.'::'.$valmatch.':'});
+        } elsif ($value) { 
+            &Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter:'.$name.':'.$value.'::'});
+        }
+    } elsif ($namematch) {
+        &Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter::::'.$namematch});
     }
     return $needsnewer;
 }
Index: loncom/interface/lonrelrequtils.pm
diff -u loncom/interface/lonrelrequtils.pm:1.4 loncom/interface/lonrelrequtils.pm:1.5
--- loncom/interface/lonrelrequtils.pm:1.4	Sun Sep 13 21:48:05 2015
+++ loncom/interface/lonrelrequtils.pm	Fri Mar  4 21:43:16 2016
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # The LearningOnline Network
 #
-# $Id: lonrelrequtils.pm,v 1.4 2015/09/13 21:48:05 raeburn Exp $
+# $Id: lonrelrequtils.pm,v 1.5 2016/03/04 21:43:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -265,30 +265,36 @@
 
 sub init_global_hashes {
     %Apache::lonrelrequtils::checkparms = ();
-    %Apache::lonrelrequtils::checkparmsmatch = ();
+    %Apache::lonrelrequtils::checkparmvalsmatch = ();
+    %Apache::lonrelrequtils::checkparmnamesmatch = ();
     %Apache::lonrelrequtils::checkresponsetypes = ();
     %Apache::lonrelrequtils::checkcrstypes = ();
     %Apache::lonrelrequtils::anonsurvey = ();
     %Apache::lonrelrequtils::randomizetry = ();
 
     foreach my $key (keys(%Apache::lonnet::needsrelease)) {
-        my ($item,$name,$value,$valuematch) = split(/:/,$key);
+        my ($item,$name,$value,$valuematch,$namematch) = split(/:/,$key);
         if ($item eq 'parameter') {
-            if ($value ne '') {
-                if (ref($Apache::lonrelrequtils::checkparms{$name}) eq 'ARRAY') {
-                    unless(grep(/^\Q$name\E$/,@{$Apache::lonrelrequtils::checkparms{$name}})) {
-                        push(@{$Apache::lonrelrequtils::checkparms{$name}},$value);
+            if ($namematch ne '') {
+                $Apache::lonrelrequtils::checkparmnamesmatch{$namematch} = 1;
+            }
+            if ($name ne '') {
+                if ($value ne '') {
+                    if (ref($Apache::lonrelrequtils::checkparms{$name}) eq 'ARRAY') {
+                        unless(grep(/^\Q$name\E$/,@{$Apache::lonrelrequtils::checkparms{$name}})) {
+                            push(@{$Apache::lonrelrequtils::checkparms{$name}},$value);
+                       }
+                    } else {
+                       push(@{$Apache::lonrelrequtils::checkparms{$name}},$value);
                     }
-                } else {
-                    push(@{$Apache::lonrelrequtils::checkparms{$name}},$value);
-                }
-            } elsif ($valuematch ne '') {
-                if (ref($Apache::lonrelrequtils::checkparmsmatch{$name}) eq 'ARRAY') {
-                    unless(grep(/^\Q$name\E$/,@{$Apache::lonrelrequtils::checkparmsmatch{$name}})) {
-                        push(@{$Apache::lonrelrequtils::checkparmsmatch{$name}},$valuematch);
+                } elsif ($valuematch ne '') {
+                    if (ref($Apache::lonrelrequtils::checkparmvalsmatch{$name}) eq 'ARRAY') {
+                        unless(grep(/^\Q$name\E$/,@{$Apache::lonrelrequtils::checkparmvalsmatch{$name}})) {
+                            push(@{$Apache::lonrelrequtils::checkparmvalsmatch{$name}},$valuematch);
+                       }
+                    } else {
+                        push(@{$Apache::lonrelrequtils::checkparmvalsmatch{$name}},$valuematch);
                     }
-                } else {
-                    push(@{$Apache::lonrelrequtils::checkparmsmatch{$name}},$valuematch);
                 }
             }
         } elsif ($item eq 'resourcetag') {
@@ -302,9 +308,9 @@
         }
     }
     ($Apache::lonrelrequtils::anonsurvey{major},$Apache::lonrelrequtils::anonsurvey{minor}) =
-        split(/\./,$Apache::lonnet::needsrelease{'parameter:type:anonsurvey:'});
+        split(/\./,$Apache::lonnet::needsrelease{'parameter:type:anonsurvey::'});
     ($Apache::lonrelrequtils::randomizetry{major},$Apache::lonrelrequtils::randomizetry{minor}) =
-        split(/\./,$Apache::lonnet::needsrelease{'parameter:type:randomizetry:'});
+        split(/\./,$Apache::lonnet::needsrelease{'parameter:type:randomizetry::'});
     return;
 }
 
@@ -362,18 +368,18 @@
                         }
                         if (grep(/^\Q$value\E$/,@{$Apache::lonrelrequtils::checkparms{$item}})) {
                             my ($major,$minor) = 
-                                split(/\./,$Apache::lonnet::needsrelease{'parameter:'.$item.':'.$value.':'});
+                                split(/\./,$Apache::lonnet::needsrelease{'parameter:'.$item.':'.$value.'::'});
                             ($reqdmajor,$reqdminor) =
                                 &update_reqd_loncaparev($major,$minor,$reqdmajor,$reqdminor);
                         }
                     }
                 }
             }
-            foreach my $item (keys(%Apache::lonrelrequtils::checkparmsmatch)) { 
+            foreach my $item (keys(%Apache::lonrelrequtils::checkparmvalsmatch)) { 
                 if ($key =~ /(\Q$item\E)$/) {
-                    if (ref($Apache::lonrelrequtils::checkparmsmatch{$item}) eq 'ARRAY') {
+                    if (ref($Apache::lonrelrequtils::checkparmvalsmatch{$item}) eq 'ARRAY') {
                         my $value = $resourcedata->{$key};
-                        foreach my $entry (@{$Apache::lonrelrequtils::checkparmsmatch{$item}}) {
+                        foreach my $entry (@{$Apache::lonrelrequtils::checkparmvalsmatch{$item}}) {
                             my $regexp;
                             if (($item eq 'lenient') && ($entry eq 'weighted')) {
                                 $regexp = '^[\-\.\d]+,[\-\.\d]+,[\-\.\d]+,[\-\.\d]+$';      
@@ -385,7 +391,7 @@
                             if ($regexp ne '') {
                                 if ($value =~ /$regexp/) {
                                     my ($major,$minor) =
-                                        split(/\./,$Apache::lonnet::needsrelease{'parameter:'.$item.'::'.$entry});
+                                        split(/\./,$Apache::lonnet::needsrelease{'parameter:'.$item.'::'.$entry.':'});
                                     ($reqdmajor,$reqdminor) =
                                         &update_reqd_loncaparev($major,$minor,$reqdmajor,$reqdminor);
                                     last;
@@ -395,6 +401,21 @@
                     }
                 }
             }
+            foreach my $item (keys(%Apache::lonrelrequtils::checkparmnamesmatch)) {
+                my $regexp;
+                if ($item eq 'maplevelrecurse') {
+                    $regexp = '\.(?:sequence|page)___\(rec\)\.';
+                }
+                if ($regexp ne '') {
+                    if ($key =~ /$regexp/) {
+                        my ($major,$minor) =
+                          split(/\./,$Apache::lonnet::needsrelease{'parameter::::'.$item});
+                          ($reqdmajor,$reqdminor) =
+                              &update_reqd_loncaparev($major,$minor,$reqdmajor,$reqdminor);
+
+                    }
+                }
+            }
         }
     }
     return ($reqdmajor,$reqdminor);
@@ -417,7 +438,7 @@
     if (keys(%comm_blocks) > 0) {
         foreach my $block (keys(%comm_blocks)) {
             if ($block =~ /^firstaccess____(.+)$/) {
-                my ($major,$minor) = split(/\./,$Apache::lonnet::needsrelease{'course:commblock:timer:'});
+                my ($major,$minor) = split(/\./,$Apache::lonnet::needsrelease{'course:commblock:timer'});
                 ($reqdmajor,$reqdminor) = &update_reqd_loncaparev($major,$minor,$reqdmajor,$reqdminor);
                 last;
             } elsif ($block =~ /^(\d+)____(\d+)$/) {
@@ -428,13 +449,13 @@
                 if (ref($comm_blocks{$block}{'blocks'}) eq 'HASH') {
                     if (ref($comm_blocks{$block}{'blocks'}{'docs'}) eq 'HASH') {
                         if (keys(%{$comm_blocks{$block}{'blocks'}{'docs'}}) > 0) {
-                            my ($major,$minor) = split(/\./,$Apache::lonnet::needsrelease{'course:commblock:docs:'});
+                            my ($major,$minor) = split(/\./,$Apache::lonnet::needsrelease{'course:commblock:docs'});
                             ($reqdmajor,$reqdminor) = &update_reqd_loncaparev($major,$minor,$reqdmajor,$reqdminor);
                             last;
                         }
                     }
                     if ($comm_blocks{$block}{'blocks'}{'printout'} eq 'on') {
-                        my ($major,$minor) = split(/\./,$Apache::lonnet::needsrelease{'course:commblock:printout:'});
+                        my ($major,$minor) = split(/\./,$Apache::lonnet::needsrelease{'course:commblock:printout'});
                         ($reqdmajor,$reqdminor) = &update_reqd_loncaparev($major,$minor,$reqdmajor,$reqdminor);
                         last;
                     }
Index: loncom/misc/releaseslist.xml
diff -u loncom/misc/releaseslist.xml:1.13 loncom/misc/releaseslist.xml:1.14
--- loncom/misc/releaseslist.xml:1.13	Wed Jan 27 00:24:20 2016
+++ loncom/misc/releaseslist.xml	Fri Mar  4 21:43:24 2016
@@ -19,6 +19,7 @@
 <parameter name="printenddate" value="past">2.11</parameter>
 <parameter name="acc" valuematch="_denyfrom_">2.12</parameter>
 <parameter name="interval" valuematch="done">2.12</parameter>
+<parameter name="" namematch="maplevelrecurse" value="">2.12</parameter>
 <resourcetag name="responsetype" value="custom">2.1</resourcetag>
 <resourcetag name="responsetype" value="math">2.2</resourcetag>
 <resourcetag name="responsetype" value="functionplot">2.10</resourcetag>
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1302 loncom/lonnet/perl/lonnet.pm:1.1303
--- loncom/lonnet/perl/lonnet.pm:1.1302	Wed Mar  2 18:23:17 2016
+++ loncom/lonnet/perl/lonnet.pm	Fri Mar  4 21:43:33 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1302 2016/03/02 18:23:17 raeburn Exp $
+# $Id: lonnet.pm,v 1.1303 2016/03/04 21:43:33 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -13084,10 +13084,17 @@
                 my $name = $token->[2]{'name'};
                 my $value = $token->[2]{'value'};
                 my $valuematch = $token->[2]{'valuematch'};
-                if ($item ne '' && $name ne '' && ($value ne '' || $valuematch ne '')) {
+                my $namematch = $token->[2]{'namematch'};
+                if ($item eq 'parameter') {
+                    if (($namematch ne '') || (($name ne '') && ($value ne '' || $valuematch ne ''))) {
+                        my $release = $parser->get_text();
+                        $release =~ s/(^\s*|\s*$ )//gx;
+                        $needsrelease{$item.':'.$name.':'.$value.':'.$valuematch.':'.$namematch} = $release;
+                    }
+                } elsif ($item ne '' && $name ne '') {
                     my $release = $parser->get_text();
                     $release =~ s/(^\s*|\s*$ )//gx;
-                    $needsrelease{$item.':'.$name.':'.$value.':'.$valuematch} = $release;
+                    $needsrelease{$item.':'.$name.':'.$value} = $release;
                 }
             }
         }


More information about the LON-CAPA-cvs mailing list