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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 09 Aug 2006 20:40:16 -0000


albertel		Wed Aug  9 16:40:16 2006 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  - packages.tab already has a valid (translated) set of terms use them instead of another set of static definitions
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.327 loncom/interface/lonparmset.pm:1.328
--- loncom/interface/lonparmset.pm:1.327	Wed Aug  9 16:37:52 2006
+++ loncom/interface/lonparmset.pm	Wed Aug  9 16:40:16 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.327 2006/08/09 20:37:52 albertel Exp $
+# $Id: lonparmset.pm,v 1.328 2006/08/09 20:40:16 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3349,27 +3349,29 @@
 	    $what,$middle,$uname,$udom,$issection,$realmdescription);
 }
 
+my %standard_parms;
+sub load_parameter_names {
+    open(my $config,"<$Apache::lonnet::perlvar{'lonTabDir'}/packages.tab");
+    while (my $configline=<$config>) {
+	if ($configline !~ /\S/ || $configline=~/^\#/) { next; }
+	chomp($configline);
+	my ($short,$plain)=split(/:/,$configline);
+	my (undef,$name,$type)=split(/\&/,$short,3);
+	if ($type eq 'display') {
+	    $standard_parms{$name} = $plain;
+	}
+    }
+    close($config);
+    $standard_parms{'int_pos'}      = 'Positive Integer';
+    $standard_parms{'int_zero_pos'} = 'Positive Integer or Zero';
+    %standard_parms=&Apache::lonlocal::texthash(%standard_parms);	
+}
+
 sub standard_parameter_names {
     my ($name)=@_;
-    my %standard_parms=&Apache::lonlocal::texthash('duedate' => 'Due Date',
-						   'answerdate' => 'Answer Date',
-						   'opendate' => 'Open Date',
-						   'maxtries' => 'Max. Number of Tries',
-						   'weight' => 'Weight',
-						   'date_start' => 'Starting Date',
-						   'date_end' => 'Ending Date',
-                                                   'interval' => 'Time Interval Length',
-                                                   'tol' => 'Numerical Tolerance',
-                                                   'sig' => 'Significant Digits',
-                                                   'contentopen' => 'Content Opening Date',
-                                                   'contentclose' => 'Content Closing Date',
-                                                   'discussend' => 'End of Discussion Time',
-                                                   'discusshide' => 'Discussion Hidden',
-                                                   'problemstatus' => 'Problem Status Visible',
-						   'int_pos' => 'Positive Integer',
-						   'int_zero_pos' => 'Positive Integer or Zero',
-						   'hinttries' => 'Number of Tries till Hints appear',
-                                                   'numbubbles' => 'Number of Bubbles in Exam Mode');
+    if (!%standard_parms) {
+	&load_parameter_names();
+    }
     if ($standard_parms{$name}) {
 	return $standard_parms{$name}; 
     } else {