--- loncom/interface/lonparmset.pm 2008/12/03 21:20:57 1.418 +++ 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.418 2008/12/03 21:20:57 schafran 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\_//; @@ -1056,14 +1057,14 @@ sub print_row { } } # end of $parmlev if/else - $r->print(''); + $r->print(''); if ($parmlev eq 'full') { my $sessionval=&Apache::lonnet::EXT('resource.'.$$part{$which}. '.'.$$name{$which},$$symbp{$rid}); my $sessionvaltype=$typeoutpar[$result]; if (!defined($sessionvaltype)) { $sessionvaltype=$$defaulttype{$which}; } - $r->print(''); } @@ -1073,14 +1074,22 @@ sub print_row { sub print_td { my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_; - $r->print(''."\n"); } @@ -1100,11 +1109,11 @@ sub print_usergroups { my $grp_parm; if (($coursereply) && ($cgroup ne $resultgroup)) { if ($result > 3) { - $bgcolor = '"#AAFFAA"'; + $bgcolor = '#AAFFAA'; $grp_parm = &valout($coursereply,$resulttype); } $grp_parm = &valout($coursereply,$resulttype); - $output = ''; } else { - $output .= ''; + $output .= ''; } return ($coursereply,$output,$grp_parm,$resultgroup); } @@ -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.'
'; @@ -935,10 +936,10 @@ sub startpage { $start_page $breadcrumbs
- - - - + + + + ENDHEAD } @@ -970,16 +971,16 @@ sub print_row { my $parm=$$display{$which}; if ($parmlev eq 'full') { - $r->print('
' + $r->print('' .$$part{$which}.''.$parm.''.$parm.''.$effective_parm.''.$effective_parm.''. + $r->print(''. &valout($sessionval,$sessionvaltype).' '. ''); - if ($which<11 || $which > 12) { - $r->print(&plink($$typeoutpar[$which], - $$display{$value},$$outpar[$which], - $mprefix."$which",'parmform.pres','psub')); + $r->print(''); + 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(''; + $output = ''; if ($resultgroup && $resultlevel) { $output .= ''.$resultgroup.' ('.$resultlevel.'): '.$grp_parm; } else { @@ -1112,7 +1121,7 @@ sub print_usergroups { } $output .= '  
"); + $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('