[LON-CAPA-cvs] cvs: rat / lonratparms.pm lonuserstate.pm loncom/interface loncommon.pm loncom/lonnet/perl lonnet.pm loncom/publisher packages.tab

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 23 Oct 2003 21:01:54 -0000


albertel		Thu Oct 23 17:01:54 2003 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
    /loncom/lonnet/perl	lonnet.pm 
    /loncom/publisher	packages.tab 
    /rat	lonratparms.pm lonuserstate.pm 
  Log:
  - takes care of more of BUG#55
     - added new parameter to packages .tab and away to associate parameters with only part 0
     - map level parameters work again
     
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.132 loncom/interface/loncommon.pm:1.133
--- loncom/interface/loncommon.pm:1.132	Fri Oct 17 11:13:49 2003
+++ loncom/interface/loncommon.pm	Thu Oct 23 17:01:54 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.132 2003/10/17 15:13:49 matthew Exp $
+# $Id: loncommon.pm,v 1.133 2003/10/23 21:01:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2663,7 +2663,7 @@
 
 sub check_if_partid_hidden {
     my ($id,$symb,$udom,$uname) = @_;
-    my $hiddenparts=&Apache::lonnet::EXT('resource.0.parameter_hiddenparts',
+    my $hiddenparts=&Apache::lonnet::EXT('resource.0.hiddenparts',
 					 $symb,$udom,$uname);
     my @hiddenlist=split(/,/,$hiddenparts);
     foreach my $checkid (@hiddenlist) {
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.431 loncom/lonnet/perl/lonnet.pm:1.432
--- loncom/lonnet/perl/lonnet.pm:1.431	Wed Oct 22 14:29:28 2003
+++ loncom/lonnet/perl/lonnet.pm	Thu Oct 23 17:01:54 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.431 2003/10/22 18:29:28 www Exp $
+# $Id: lonnet.pm,v 1.432 2003/10/23 21:01:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3848,18 +3848,25 @@
 			$lcmetacache{':packages'}=$package.$keyroot;
 		    }
 		    foreach (keys %packagetab) {
-			if ($_=~/^$package\&/) {
+			my $part=$keyroot;
+			$part=~s/^\_//;
+			if ($_=~/^\Q$package\E\&/ || 
+			    $_=~/^\Q$package\E_0\&/) {
 			    my ($pack,$name,$subp)=split(/\&/,$_);
 			    # ignore package.tab specified default values
                             # here &package_tab_default() will fetch those
 			    if ($subp eq 'default') { next; }
 			    my $value=$packagetab{$_};
-			    my $part=$keyroot;
-			    $part=~s/^\_//;
+			    my $unikey;
+			    if ($pack =~ /_0$/) {
+				$unikey='parameter_0_'.$name;
+				$part=0;
+			    } else {
+				$unikey='parameter'.$keyroot.'_'.$name;
+			    }
 			    if ($subp eq 'display') {
 				$value.=' [Part: '.$part.']';
 			    }
-			    my $unikey='parameter'.$keyroot.'_'.$name;
 			    $lcmetacache{':'.$unikey.'.part'}=$part;
 			    $metathesekeys{$unikey}=1;
 			    unless (defined($lcmetacache{':'.$unikey.'.'.$subp})) {
Index: loncom/publisher/packages.tab
diff -u loncom/publisher/packages.tab:1.23 loncom/publisher/packages.tab:1.24
--- loncom/publisher/packages.tab:1.23	Thu Oct 23 03:32:25 2003
+++ loncom/publisher/packages.tab	Thu Oct 23 17:01:54 2003
@@ -19,6 +19,8 @@
 part&problemstatus&type:string_yesno
 part&problemstatus&default:yes
 part&problemstatus&display:Show Problem Status
+part_0&hiddenparts&display:List of hidden parts
+part_0&hiddenparts&type:string_any
 numericalhint&tol&display:Numerical Tolerance
 numericalhint&tol&type:tolerance
 numericalhint&tol&default:5%
Index: rat/lonratparms.pm
diff -u rat/lonratparms.pm:1.18 rat/lonratparms.pm:1.19
--- rat/lonratparms.pm:1.18	Thu Oct 23 14:38:50 2003
+++ rat/lonratparms.pm	Thu Oct 23 17:01:54 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Set parameters inside of the RAT
 #
-# $Id: lonratparms.pm,v 1.18 2003/10/23 18:38:50 albertel Exp $
+# $Id: lonratparms.pm,v 1.19 2003/10/23 21:01:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -90,12 +90,6 @@
         $content{'parameter_mapalias'}='';
         $type{'parameter_mapalias'}='string';
 	$display{'parameter_mapalias'}='Resource alias name for conditions';
-    }
-    if ($uri=~/\.(problem|exam|quiz|assess|survey|form|library)\.meta$/) {
-	$content{'parameter_hiddenparts'}='';
-        $type{'parameter_hiddenparts'}='string';
-	$display{'parameter_hiddenparts'}=
-	    'A comma separted list of Part Ids to not display.';
     }
 # ---------------------------------------------------------- Current Parameters
 
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.62 rat/lonuserstate.pm:1.63
--- rat/lonuserstate.pm:1.62	Wed Oct 22 12:52:14 2003
+++ rat/lonuserstate.pm	Thu Oct 23 17:01:54 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construct and maintain state and binary representation of course for user
 #
-# $Id: lonuserstate.pm,v 1.62 2003/10/22 16:52:14 www Exp $
+# $Id: lonuserstate.pm,v 1.63 2003/10/23 21:01:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -161,11 +161,9 @@
 			}
 		    }
 		    &Apache::lonnet::do_cache(\%Apache::lonnet::titlecache,
-		       &Apache::lonnet::symbclean(
-                        &Apache::lonnet::declutter($uri).'___'.
-                        $token->[2]->{'id'}.'___'.
-		        &Apache::lonnet::declutter($turi)),
-					      $token->[2]->{'title'});
+		       &Apache::lonnet::encode_symb($uri,$token->[2]->{'id'},
+						    $turi),
+					      $token->[2]->{'title'},'title');
                     unless ($ispage) {
                         $turi=~/\.(\w+)$/;
                         my $embstyle=&Apache::loncommon::fileembstyle($1);
@@ -267,12 +265,17 @@
 # ------------------------------------------------------------------- Parameter
 
                     my $referid=$lpc.'.'.$token->[2]->{'to'};
-                    my $part=$token->[2]->{'part'};
-                    unless ($part) { $part=0; }
+		    my $name=$token->[2]->{'name'};
+		    my $part;
+		    if ($name=~/^parameter_(.*)_/) {
+			$part=$1;
+		    } else {
+			$part=0;
+		    }
+		    $name=~s/^.*_([^_]*)$/$1/;
                     my $newparam=
 			&Apache::lonnet::escape($token->[2]->{'type'}).':'.
-			&Apache::lonnet::escape($part.'.'.
-                         $token->[2]->{'name'}).'='.
+			&Apache::lonnet::escape($part.'.'.$name).'='.
 			&Apache::lonnet::escape($token->[2]->{'value'});
                     if (defined($hash{'param_'.$referid})) {
                         $hash{'param_'.$referid}.='&'.$newparam;