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

raeburn raeburn@source.lon-capa.org
Mon, 16 Feb 2009 02:09:16 -0000


raeburn		Mon Feb 16 02:09:16 2009 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  - Bug 5889.
   - More changes to avoid applying &mt() to user-supplied parameter descriptions.
   - When constructing parameter setting tables, for "Parameter Name" use the description from the allparams hash, if a key => value pair exists for the parameter name (values in the allparams hash are already localized).
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.432 loncom/interface/lonparmset.pm:1.433
--- loncom/interface/lonparmset.pm:1.432	Sun Feb 15 17:19:39 2009
+++ loncom/interface/lonparmset.pm	Mon Feb 16 02:09:15 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.432 2009/02/15 17:19:39 raeburn Exp $
+# $Id: lonparmset.pm,v 1.433 2009/02/16 02:09:15 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -973,9 +973,8 @@
     if ($parmlev eq 'full') {
         $r->print('<td style="background-color:'.$defbgtwo.';" align="center">'
                   .$$part{$which}.'</td>');
-    } else {    
+    } else {
         $parm=~s|\[.*\]\s||g;
-        $parm=&mt($parm);
     }
     my $automatic=&rulescache(($which=~/\_([^\_]+)$/)[0].'_triggers');
     if ($automatic) {
@@ -1977,7 +1976,16 @@
                         if (grep $_ eq $tempkeyp, @catmarker) {
                           $part{$_}=&Apache::lonnet::metadata($uri,$_.'.part');
                           $name{$_}=&Apache::lonnet::metadata($uri,$_.'.name');
-                          $display{$_}=&Apache::lonnet::metadata($uri,$_.'.display');
+                          my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display');
+                          if ($allparms{$name{$_}} ne '') {
+                              my $identifier;
+                              if ($parmdis =~ /(\s*\[Part.*)$/) {
+                                  $identifier = $1;
+                              }
+                              $display{$_} = $allparms{$name{$_}}.$identifier;
+                          } else {
+                              $display{$_} = $parmdis;
+                          }
                           unless ($display{$_}) { $display{$_}=''; }
                           $display{$_}.=' ('.$name{$_}.')';
                           $default{$_}=&Apache::lonnet::metadata($uri,$_);
@@ -2084,7 +2092,16 @@
                       if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {
                         $part{$tempkeyp}="0";
                         $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');
-                        $display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
+                        my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
+                        if ($allparms{$name{$tempkeyp}} ne '') {
+                            my $identifier;
+                            if ($parmdis =~ /(\s*\[Part.*)$/) {
+                                $identifier = $1;
+                            }
+                            $display{$tempkeyp} = $allparms{$name{$tempkeyp}}.$identifier;
+                        } else {
+                            $display{$tempkeyp} = $parmdis;
+                        }
                         unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }
                         $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';
                         $display{$tempkeyp} =~ s/_\w+_/_0_/;
@@ -2177,7 +2194,16 @@
                   if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {
                     $part{$tempkeyp}="0";
                     $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');
-                    $display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
+                    my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
+                    if ($allparms{$name{$tempkeyp}} ne '') {
+                        my $identifier;
+                        if ($parmdis =~ /(\s*\[Part.*)$/) {
+                            $identifier = $1;
+                        }
+                        $display{$tempkeyp} = $allparms{$name{$tempkeyp}}.$identifier;
+                    } else {
+                        $display{$tempkeyp} = $parmdis;
+                    }
                     unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }
                     $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';
                     $display{$tempkeyp} =~ s/_\w+_/_0_/;