--- loncom/interface/lonparmset.pm 2008/12/12 17:06:05 1.419 +++ loncom/interface/lonparmset.pm 2009/05/06 16:19:34 1.444 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.419 2008/12/12 17:06:05 bisitz Exp $ +# $Id: lonparmset.pm,v 1.444 2009/05/06 16:19:34 bisitz 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 ''); - } else { + } else { $parm=~s|\[.*\]\s||g; } my $automatic=&rulescache(($which=~/\_([^\_]+)$/)[0].'_triggers'); if ($automatic) { $parm.='
'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'
'; } - $r->print(''); + $r->print(''); my $thismarker=$which; $thismarker=~s/^parameter\_//; @@ -1075,12 +1076,20 @@ sub print_td { my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_; $r->print(''."\n"); } @@ -1181,9 +1190,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}= @@ -1307,17 +1322,22 @@ sub parmmenu { ENDSCRIPT $r->print(); - $r->print("\n
'. + return '
'. ''. $valout.'
'; @@ -972,14 +973,14 @@ sub print_row { if ($parmlev eq 'full') { $r->print('
' .$$part{$which}.''.$parm.''.$parm.''); - if ($which<11 || $which > 12) { - $r->print(&plink($$typeoutpar[$which], - $$display{$value},$$outpar[$which], - $mprefix."$which",'parmform.pres','psub')); + my $nolink = 0; + if ($which == 11 || $which == 12) { + $nolink = 1; + } elsif ($mprefix =~ /availablestudent\&$/) { + if ($which > 3) { + $nolink = 1; + } + } + if ($nolink) { + $r->print(&valout($$outpar[$which],$$typeoutpar[$which])); } else { - $r->print(&valout($$outpar[$which],$$typeoutpar[$which])); + $r->print(&plink($$typeoutpar[$which], + $$display{$value},$$outpar[$which], + $mprefix."$which",'parmform.pres','psub')); } $r->print('
"); + $r->print(''); + $r->print(''); + $r->print(''); } sub partmenu { my ($r,$allparts,$psprt)=@_; - $r->print(''); + $r->print(''); + $r->print(''); } sub usermenu { @@ -1402,7 +1429,7 @@ sub usermenu { my $g_s_header=''; my $g_s_footer=''; - + if (%sectionhash) { $sections=&mt('Section:').' '); + $r->print(''); + $r->print(''); + } + $r->print(''); + $r->print(''); + $r->print(''); } sub displaymenu { my ($r,$allparms,$allparts,$pscat,$psprt,$keyorder)=@_; - $r->print('
'); + $r->print('
'.&mt('Select Parameters to View').'
'); + $r->print('
'); + $r->print("\n".''); my $cnt=0; foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { $r->print("\n".''); + $r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} + : $tempkey) + .''); $cnt++; if ($cnt==3) { $r->print("\n"); @@ -1325,7 +1345,7 @@ ENDSCRIPT } } $r->print('' - .'' + .'' .'' .'
' .'
'.&mt('Parameter Selection').'' .'' @@ -1364,11 +1384,17 @@ ENDSCRIPT .'
' ); + $r->print('
'); + $r->print('
'. &mt('Select Parts to View').'
'); + $r->print('
'); + $r->print(''); + $r->print('
'); + $r->print('
'.&mt('Group/Section').'
'); + $r->print('
'); + $r->print($sections.$groups); + $r->print('
'); + $r->print('
'. &mt('User').'
'); + $r->print('
'); + + $r->print(&mt('For User [_1] or Student/Employee ID [_2] at Domain [_3]' ,'' ,' ' - ,$chooseopt) - .'' - .'' - ); + ,$chooseopt)); + + $r->print('
'.&mt('Select Parameters to View').''. - &mt('Select Parts to View').'
'); + $r->print('
'); + $r->print('

Step 2

'); + $r->print('
'); + $r->print(''); + + #$r->print('
'.&mt('Select Parameters to View').''. &mt('Select Parts to View').'
'); &parmmenu($r,$allparms,$pscat,$keyorder); - $r->print(''); + &partmenu($r,$allparts,$psprt); - $r->print('
'); + $r->print('
'); } -sub mapmenu { - my ($r,$allmaps,$pschp,$maptitles)=@_; - $r->print(''.&mt('Select Enclosing Map or Folder').' '); +sub mapmenu {## + my ($r,$allmaps,$pschp,$maptitles)=@_; + $r->print(''); + $r->print(''); + $r->print('
'.&mt('Select Enclosing Map or Folder').'
'); + $r->print(''); + $r->print('
'); $r->print('"); + $r->print('
'); } sub levelmenu { - my ($r,$alllevs,$parmlev)=@_; - $r->print(''.&mt('Select Parameter Level'). - &Apache::loncommon::help_open_topic('Course_Parameter_Levels').' '); + my ($r,$alllevs,$parmlev)=@_; + $r->print(''); + $r->print(''); + $r->print('
'.&mt('Select Parameter Level').&Apache::loncommon::help_open_topic('Course_Parameter_Levels').'
'); + $r->print(''); + $r->print('
'); $r->print('"); + $r->print('
'); } @@ -1532,7 +1575,7 @@ sub sectionmenu { my %sectionhash = &Apache::loncommon::get_sections(); return if (!%sectionhash); - $r->print(''); foreach my $s ('all',sort keys %sectionhash) { $r->print('