--- loncom/interface/lonparmset.pm 2003/11/10 16:33:57 1.134 +++ loncom/interface/lonparmset.pm 2003/12/04 20:06:29 1.140 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.134 2003/11/10 16:33:57 albertel Exp $ +# $Id: lonparmset.pm,v 1.140 2003/12/04 20:06:29 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -131,12 +131,12 @@ sub parmval { # -------------------------------------------------------- first, check default - if ($def) { $outpar[11]=$def; $result=11; } + if (defined($def)) { $outpar[11]=$def; $result=11; } # ----------------------------------------------------- second, check map parms my $thisparm=$parmhash{$symbparm}; - if ($thisparm) { $outpar[10]=$thisparm; $result=10; } + if (defined($thisparm)) { $outpar[10]=$thisparm; $result=10; } # --------------------------------------------------------- third, check course @@ -285,7 +285,7 @@ sub plink { sub startpage { - my ($r,$id,$udom,$csec,$uname,$have_assesments)=@_; + my ($r,$id,$udom,$csec,$uname,$have_assesments,$trimheader)=@_; my $bodytag=&Apache::loncommon::bodytag('Set/Modify Course Parameters','', 'onUnload="pclose()"'); @@ -354,7 +354,9 @@ sub startpage { $selscript $bodytag +ENDHEAD + unless ($trimheader) {$r->print(<

$lt{'cep'}

@@ -370,9 +372,12 @@ $bodytag
+ENDHEAD2 +} + $r->print(<

$lt{'captm'}

-ENDHEAD +ENDHEAD3 if (!$have_assesments) { $r->print(''.&mt('There are no assesment parameters in this course to set.').'
'); @@ -485,21 +490,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"); } @@ -687,6 +694,7 @@ sub assessparms { my $pssymb=''; my $parmlev=''; + my $trimheader=''; my $prevvisit=$ENV{'form.prevvisit'}; # unless ($parmlev==$ENV{'form.parmlev'}) { @@ -709,11 +717,13 @@ sub assessparms { if (!@pscat) { @pscat=('all'); } $pschp=''; $parmlev = 'full'; + $trimheader='yes'; } elsif ($ENV{'form.symb'}) { $pssymb=$ENV{'form.symb'}; if (!@pscat) { @pscat=('all'); } $pschp=''; $parmlev = 'full'; + $trimheader='yes'; } else { $ENV{'form.url'}=''; } @@ -903,7 +913,7 @@ sub assessparms { my $have_assesments=1; if (scalar(keys(%allkeys)) eq 0) { $have_assesments=0; } - &startpage($r,$id,$udom,$csec,$uname,$have_assesments); + &startpage($r,$id,$udom,$csec,$uname,$have_assesments,$trimheader); if (!$have_assesments) { untie(%bighash); @@ -1089,9 +1099,9 @@ sub assessparms { 'rl' => "Resource Level", 'ic' => 'in Course', 'aut' => "Assessment URL and Title", - 'type' => 'Type', + 'type' => &mt('Type'), 'emof' => "Enclosing Map or Folder", - 'part' => 'Part', + 'part' => &mt('Part'), 'pn' => 'Parameter Name', 'def' => 'default', 'femof' => 'from Enclosing Map or Folder', @@ -1287,8 +1297,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) { @@ -1296,17 +1306,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(''); @@ -1370,21 +1380,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(''); @@ -1498,26 +1507,29 @@ sub crsenv { # -------------------------------------------------------- Get parameters again my %values=&Apache::lonnet::dump('environment',$dom,$crs); + my $SelectStyleFile=&mt('Select Style File'); my $output=''; if (! exists($values{'con_lost'})) { my %descriptions= - ('url' => 'Top Level Map '. + ('url' => ''.&mt('Top Level Map').' '. '". - 'Select Map
'. - 'Modification may make assessment data '. - 'inaccessible', - 'description' => 'Course Description', - 'courseid' => 'Course ID or number
'. - '(internal, optional)', - 'grading' => 'Grading'. - '"standard" or any other value. '. - 'Default for new courses is "standard".', - - 'default_xml_style' => 'Default XML Style File '. + &mt('Select Map').'
'. + &mt('Modification may make assessment data inaccessible'). + '', + 'description' => ''.&mt('Course Description').'', + 'courseid' => ''.&mt('Course ID').' '.&mt('or').' '.&mt('number'). + '
'. + '('.&mt('internal').', '.&mt('optional').')', + 'grading' => ''.&mt('Grading').''. + ' "'.&mt('standard').'", "'.&mt('external').'", '. + &mt('or any other value').'.'. + ' '.&mt('Default for new courses is').' "'. + &mt('standard').'".', + 'default_xml_style' => ''.&mt('Default XML Style File').' '. 'Select Style File
", + ",'sty')\">$SelectStyleFile
", 'question.email' => 'Feedback Addresses for Resource Content '. 'Questions
(user:domain,'. 'user:domain(section;section;...;*;...),...)', @@ -1569,9 +1581,9 @@ sub crsenv { => 'Allow limited HTML in discussion posts
'. '(Set value to "yes" to allow)', 'rndseed' - => 'Randomization algorithm used
'. - 'Modifying this will make problems '. - 'have different numbers and answers', + => ''.&mt('Randomization algorithm used').'
'. + ''.&mt('Modifying this will make problems').' '. + &mt('have different numbers and answers').'', 'problem_stream_switch' => 'Allow problems to be split over pages
'. ' ("yes" if allowed, anything else if not)', @@ -1582,7 +1594,7 @@ sub crsenv { 'when enrolling students', 'default_enrollment_end_date' => 'Default ending date '. 'when enrolling students', - 'languages' => 'Languages used', + 'languages' => ''.&mt('Languages used').'', 'disable_receipt_display' => 'Disable display of problem receipts
'. ' ("yes" to disable, anything else if not)' @@ -1645,6 +1657,8 @@ sub crsenv { $onchange.' />'; } + my $Parameter=&mt('Parameter'); + my $Value=&mt('Value'); $r->print(<
'.&mt('Parameter Name').' '. '