[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm

raeburn raeburn@source.lon-capa.org
Sun, 15 Feb 2009 17:19:39 -0000


raeburn		Sun Feb 15 17:19:39 2009 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  - Bug 5889.
  - Move the call to &standard_parameter_names() to a higher level - 
     i.e., within &extractResourceInformation() so values in key => value  
     pairs in %allparms use (localized) standard parameter descriptions if available.
  - Eliminate the &mt() applied to parameter descriptions inside &parmmenu().
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.431 loncom/interface/lonparmset.pm:1.432
--- loncom/interface/lonparmset.pm:1.431	Sun Feb 15 15:14:34 2009
+++ loncom/interface/lonparmset.pm	Sun Feb 15 17:19:39 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.431 2009/02/15 15:14:34 raeburn Exp $
+# $Id: lonparmset.pm,v 1.432 2009/02/15 17:19:39 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1183,9 +1183,15 @@
 #
 	    my $name=&Apache::lonnet::metadata($srcf,$key.'.name');
 	    if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) {
-		my $display= &Apache::lonnet::metadata($srcf,$key.'.display');
-		my $parmdis = $display;
-		$parmdis =~ s/\s*\[Part.*$//g;
+		my ($display,$parmdis);
+		$display = &standard_parameter_names($name);
+		if ($display eq '') {
+		    $display= &Apache::lonnet::metadata($srcf,$key.'.display');
+		    $parmdis = $display;
+		    $parmdis =~ s/\s*\[Part.*$//g;
+		} else {
+		    $parmdis = $display;
+		}
 		$$allparms{$name}=$parmdis;
 		if (ref($defkeytype)) {
 		    $$defkeytype{$name}=
@@ -1317,15 +1323,9 @@
 	if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {
 	    $r->print(' checked="checked"');
 	}
-        my $displaykey = &standard_parameter_names($tempkey);
-        if ($displaykey eq '') {
-            if ($$allparms{$tempkey}=~/\S/) {
-                $displaykey = $$allparms{$tempkey};
-            } else {
-                $displaykey = $tempkey;
-            }
-        }
-        $r->print(' />'.$displaykey.'</label></td>');
+        $r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey}
+                                                  : $tempkey)
+                  .'</label></td>');
  	$cnt++;
         if ($cnt==3) {
 	    $r->print("</tr>\n<tr>");