--- loncom/interface/lonparmset.pm 2003/10/10 16:56:16 1.133 +++ loncom/interface/lonparmset.pm 2003/11/18 22:18:42 1.136 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.133 2003/10/10 16:56:16 www Exp $ +# $Id: lonparmset.pm,v 1.136 2003/11/18 22:18:42 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -485,21 +485,23 @@ sub print_row { } # end of $brief if/else } # end of $parmlev if/else - if ($parmlev eq 'full' || $parmlev eq 'brief') { - $r->print(''. + $r->print(''. &valout($outpar[$result],$typeoutpar[$result]).''); - } - my $sessionval=&Apache::lonnet::EXT('resource.'.$$part{$which}. + + if ($parmlev eq 'full' || $parmlev eq 'brief') { + my $sessionval=&Apache::lonnet::EXT('resource.'.$$part{$which}. '.'.$$name{$which},$symbp{$rid}); + # this doesn't seem to work, and I don't think is correct # my $sessionvaltype=&Apache::lonnet::EXT('resource.'.$$part{$which}. # '.'.$$name{$which}.'.type',$symbp{$rid}); # this seems to work - my $sessionvaltype=$typeoutpar[$result]; - if (!defined($sessionvaltype)) { $sessionvaltype=$$defaulttype{$which}; } - $r->print(''. + my $sessionvaltype=$typeoutpar[$result]; + if (!defined($sessionvaltype)) { $sessionvaltype=$$defaulttype{$which}; } + $r->print(''. &valout($sessionval,$sessionvaltype).' '. ''); + } $r->print(''); $r->print("\n"); } @@ -518,20 +520,6 @@ sub print_td { $r->print(''."\n"); } -sub get_env_multiple { - my ($name) = @_; - my @values; - if (defined($ENV{$name})) { - # exists is it an array - if (ref($ENV{$name})) { - @values=@{ $ENV{$name} }; - } else { - $values[0]=$ENV{$name}; - } - } - return(@values); -} - =pod =item B: Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes. @@ -693,9 +681,9 @@ sub assessparms { $udom=$ENV{'form.udom'}; unless ($udom) { $udom=$r->dir_config('lonDefDomain'); } - my @pscat=&get_env_multiple('form.pscat'); + my @pscat=&Apache::loncommon::get_env_multiple('form.pscat'); my $pschp=$ENV{'form.pschp'}; - my @psprt=&get_env_multiple('form.psprt'); + my @psprt=&Apache::loncommon::get_env_multiple('form.psprt'); if (!@psprt) { $psprt[0]='0'; } my $showoptions=$ENV{'form.showoptions'}; @@ -1301,8 +1289,8 @@ ENDTABLEHEADFOUR my $showtitle=$maptitles{$maptitle}.($maptitle!~/^uploaded/?' ['.$maptitle.']':''); $r->print(<

-Set Defaults for All Resources in $foldermap
-$showtitle
+Set Defaults for All Resources in $foldermap
+$showtitle
Specifically for ENDMAPONE if ($uname) { @@ -1310,17 +1298,17 @@ ENDMAPONE ('firstname','middlename','lastname','generation', 'id')); my $person=$name{'firstname'}.' '.$name{'middlename'}.' ' .$name{'lastname'}.' '.$name{'generation'}; - $r->print(&mt("User")." $uname \($person\) ". + $r->print(&mt("User")." $uname \($person\) ". &mt('in')." \n"); } else { - $r->print("".&mt('all').' '.&mt('users in')." \n"); + $r->print("".&mt('all').' '.&mt('users in')." \n"); } - if ($csec) {$r->print(&mt("Section")." $csec ". + if ($csec) {$r->print(&mt("Section")." $csec ". &mt('of')." \n")}; - $r->print("$coursename
"); - $r->print("

\n"); + $r->print("$coursename
"); + $r->print("\n"); #---------------------------------------------------------------- print table $r->print('

'); $r->print(''); @@ -1384,21 +1372,20 @@ ENDMAPONE my $setdef=&mt("Set Defaults for All Resources in Course"); $r->print(<

$setdef - -$coursename
+$coursename
ENDMAPONE if ($uname) { my %name=&Apache::lonnet::userenvironment($udom,$uname, ('firstname','middlename','lastname','generation', 'id')); my $person=$name{'firstname'}.' '.$name{'middlename'}.' ' .$name{'lastname'}.' '.$name{'generation'}; - $r->print(" ".&mt("User")." $uname \($person\) \n"); + $r->print(" ".&mt("User")." $uname \($person\) \n"); } else { - $r->print("".&mt("ALL")." ".&mt("USERS")." \n"); + $r->print(" ".&mt("ALL")." ".&mt("USERS")." \n"); } - if ($csec) {$r->print(&mt("Section")." $csec\n")}; - $r->print("

\n"); + if ($csec) {$r->print(&mt("Section")." $csec\n")}; + $r->print("\n"); #---------------------------------------------------------------- print table $r->print('

'.&mt('Parameter Name').'
'); $r->print('');
'.&mt('Parameter Name').'