[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm
raeburn
raeburn at source.lon-capa.org
Thu Apr 11 10:47:15 EDT 2019
raeburn Thu Apr 11 14:47:15 2019 EDT
Modified files:
/loncom/interface loncommon.pm
Log:
- When &update_content_constraints() is called in Course Editor context,
contents of LONCAPA::map globals need to be saved before recursing
supplemental maps, and then restored.
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1325 loncom/interface/loncommon.pm:1.1326
--- loncom/interface/loncommon.pm:1.1325 Sat Jan 26 00:18:48 2019
+++ loncom/interface/loncommon.pm Thu Apr 11 14:47:14 2019
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1325 2019/01/26 00:18:48 raeburn Exp $
+# $Id: loncommon.pm,v 1.1326 2019/04/11 14:47:14 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -17484,7 +17484,7 @@
}
sub update_content_constraints {
- my ($cdom,$cnum,$chome,$cid) = @_;
+ my ($cdom,$cnum,$chome,$cid,$keeporder) = @_;
my %curr_reqd_hash = &Apache::lonnet::userenvironment($cdom,$cnum,'internal.releaserequired');
my ($reqdmajor,$reqdminor) = split(/\./,$curr_reqd_hash{'internal.releaserequired'});
my (%checkresponsetypes,%checkcrsrestypes);
@@ -17532,10 +17532,24 @@
}
undef($navmap);
}
+ my (@resources, at order, at resparms, at zombies);
+ if ($keeporder) {
+ use LONCAPA::map;
+ @resources = @LONCAPA::map::resources;
+ @order = @LONCAPA::map::order;
+ @resparms = @LONCAPA::map::resparms;
+ @zombies = @LONCAPA::map::zombies;
+ }
my $suppmap = 'supplemental.sequence';
my ($suppcount,$supptools,$errors) = (0,0,0);
($suppcount,$supptools,$errors) = &recurse_supplemental($cnum,$cdom,$suppmap,
$suppcount,$supptools,$errors);
+ if ($keeporder) {
+ @LONCAPA::map::resources = @resources;
+ @LONCAPA::map::order = @order;
+ @LONCAPA::map::resparms = @resparms;
+ @LONCAPA::map::zombies = @zombies;
+ }
if ($supptools) {
my ($major,$minor) = split(/\./,$checkcrsrestypes{'exttool'});
if (($major > $reqdmajor) || ($major == $reqdmajor && $minor > $reqdminor)) {
@@ -17562,7 +17576,7 @@
if ($lastchange > $env{'request.course.tied'}) {
my ($furl,$ferr) = &Apache::lonuserstate::readmap("$cdom/$cnum");
unless ($ferr) {
- &update_content_constraints($cdom,$cnum,$chome,$cid);
+ &update_content_constraints($cdom,$cnum,$chome,$cid,1);
}
}
my $navmap = Apache::lonnavmaps::navmap->new();
More information about the LON-CAPA-cvs
mailing list