--- loncom/interface/lonparmset.pm 2006/08/09 20:37:52 1.327 +++ loncom/interface/lonparmset.pm 2006/08/09 20:40:16 1.328 @@ -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 @@ sub components { $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 {