--- loncom/interface/domainprefs.pm 2018/07/06 03:18:36 1.327 +++ loncom/interface/domainprefs.pm 2018/07/06 04:03:31 1.328 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.327 2018/07/06 03:18:36 raeburn Exp $ +# $Id: domainprefs.pm,v 1.328 2018/07/06 04:03:31 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -8481,20 +8481,23 @@ sub initialize_categories { communities => 'Communities', placement => 'Placement Tests', ); - my $select0 = ' selected="selected"'; - my $select1 = ''; + my %selnum = ( + instcode => '0', + communities => '1', + placement => '2', + ); + my %selected; foreach my $default ('instcode','communities','placement') { $css_class = $itemcount%2?' class="LC_odd_row"':''; $chgstr = ' onchange="javascript:reorderCats(this.form,'."'','$default"."_pos','0'".');"'; - if (($default eq 'communities') || ($default eq 'placement')) { - $select1 = $select0; - $select0 = ''; - } + map { $selected{$selnum{$_}} = '' } keys(%selnum); + $selected{$selnum{$default}} = ' selected="selected"'; $datatable .= '