--- loncom/interface/lonparmset.pm 2009/01/20 18:05:55 1.422
+++ loncom/interface/lonparmset.pm 2009/02/19 10:19:49 1.434
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.422 2009/01/20 18:05:55 bisitz Exp $
+# $Id: lonparmset.pm,v 1.434 2009/02/19 10:19:49 biermanm Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -848,12 +848,13 @@ sub plink {
my ($hour,$min,$sec,$val)=&preset_defaults($parmname);
unless (defined($winvalue)) { $winvalue=$val; }
my $valout = &valout($value,$type,1);
+ my $unencmarker = $marker;
foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call,
\$hour, \$min, \$sec) {
$$item = &HTML::Entities::encode($$item,'"<>&');
$$item =~ s/\'/\\\'/g;
}
- return '
|
'.
+ return '';
@@ -972,14 +973,14 @@ sub print_row {
if ($parmlev eq 'full') {
$r->print(' | '
.$$part{$which}.' | ');
- } else {
+ } else {
$parm=~s|\[.*\]\s||g;
}
my $automatic=&rulescache(($which=~/\_([^\_]+)$/)[0].'_triggers');
if ($automatic) {
$parm.='
'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'';
}
- $r->print(''.$parm.' | ');
+ $r->print(''.$parm.' | ');
my $thismarker=$which;
$thismarker=~s/^parameter\_//;
@@ -1181,9 +1182,15 @@ sub extractResourceInformation {
#
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}=
@@ -1315,9 +1322,9 @@ ENDSCRIPT
if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {
$r->print(' checked="checked"');
}
- $r->print('>'.($$allparms{$tempkey}=~/\S/ ? &mt($$allparms{$tempkey})
- : &mt($tempkey))
- .'');
+ $r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey}
+ : $tempkey)
+ .'');
$cnt++;
if ($cnt==3) {
$r->print("
\n");
@@ -1816,12 +1823,13 @@ sub assessparms {
if (!$pssymb) {
$r->print('');
&levelmenu($r,\%alllevs,$parmlev);
+ $r->print(' | ');
if ($parmlev ne 'general') {
$r->print('');
&mapmenu($r,\%allmaps,$pschp,\%maptitles);
$r->print(' | ');
}
- $r->print('
');
+ $r->print('
');
&displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder);
} else {
my ($map,$id,$resource)=&Apache::lonnet::decode_symb($pssymb);
@@ -1968,7 +1976,16 @@ ENDTABLEHEADFOUR
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,$_);
@@ -2075,7 +2092,16 @@ ENDTABLEHEADFOUR
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_/;
@@ -2168,7 +2194,16 @@ ENDTABLEHEADFOUR
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_/;
@@ -2293,12 +2328,12 @@ sub crsenv {
my ($name,$domain) = split(':',$user);
if (!defined($user) || !defined($domain)) {
$setoutput.= '
'.
- &mt("Invalid email address specified, address must be of the form username:domain what was specified was ([_1])",$user).
+ &mt("Invalid e-mail address specified, address must be of the form username:domain what was specified was ([_1])",$user).
'';
undef($value);
} elsif (&Apache::lonnet::homeserver($user,$domain) eq 'no_host') {
$setoutput.= '
'.
- &mt("Invalid email address specified, user [_1] is unknown.",$name).
+ &mt("Invalid e-mail address specified, user [_1] is unknown.",$name).
'';
undef($value);
}
@@ -2545,7 +2580,7 @@ sub crsenv {
'externalsyllabus'
=> ''.&mt('URL of Syllabus (not using internal handler)').'',
'tthoptions'
- => ''.&mt('Default set of options to pass to tth/m when converting tex').'',
+ => ''.&mt('Default set of options to pass to tth/m when converting TeX').'',
'texengine'
=> ''.&mt('Force all students in the course to use a specific math rendering engine.').'
'
@@ -3140,7 +3175,7 @@ sub listdata {
$r->print(&default_selector($thiskey,$$resourcedata{$thiskey}));
}
$r->print('');
+ $thistype.'" />');
$r->print(''.&Apache::loncommon::end_data_table_row());
}
}
@@ -3452,7 +3487,7 @@ ENDOVER
my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder);
$r->print(&tableend().''.
- ($foundkeys?'':&mt('There are no parameters.')).'
'.
+ ($foundkeys?'':&mt('There are no parameters.')).''.
&Apache::loncommon::end_page());
}
@@ -3885,19 +3920,19 @@ sub output_row {
my $single_checked;
if ($options =~ m/onlyone/) {
$multiple_checked = '';
- $single_checked = ' checked="checked" ';
+ $single_checked = ' checked="checked"';
} else {
- $multiple_checked = ' checked="checked" ';
+ $multiple_checked = ' checked="checked"';
$single_checked = '';
}
$output .= &Apache::loncommon::continue_data_table_row();
$output .= ''.(' ' x 10).'
-
+
'.&mt('Student may select multiple choices from list').' | ';
$output .= &Apache::loncommon::end_data_table_row();
$output .= &Apache::loncommon::continue_data_table_row();
$output .= ''.(' ' x 10).'
-
+
'.&mt('Student may select only one choice from list').' | ';
$output .= &Apache::loncommon::end_data_table_row();
}
@@ -4326,7 +4361,7 @@ ENDYESNO
}
$r->print(&Apache::loncommon::end_data_table().
"\n".''."\n".
+ &mt('Save').'" />'."\n".
&Apache::loncommon::end_page());
return;
}