--- loncom/interface/lonparmset.pm 2005/06/13 15:35:37 1.220 +++ loncom/interface/lonparmset.pm 2005/06/14 02:33:18 1.221 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.220 2005/06/13 15:35:37 www Exp $ +# $Id: lonparmset.pm,v 1.221 2005/06/14 02:33:18 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -70,6 +70,8 @@ my $parmhashid; my %parmhash; my $symbsid; my %symbs; +my $rulesid; +my %rules; # --- end local caches @@ -240,6 +242,24 @@ sub symbcache { return $symbs{$id}; } +sub resetrulescache { + $rulesid=''; +} + +sub rulescache { + my $id=shift; + if ($rulesid ne $env{'request.course.id'}) { + %rules=(); + } + unless ($rules{$id}) { + my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; + my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; + my %rules=&Apache::lonnet::dump('parmdefactions',$dom,$crs); + $rulesid=$env{'request.course.id'}; + } + return $rules{$id}; +} + ################################################## ################################################## # @@ -2551,12 +2571,52 @@ $bodytag $breadcrumbs