[LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm

raeburn raeburn at source.lon-capa.org
Fri Jul 6 00:03:31 EDT 2018


raeburn		Fri Jul  6 04:03:31 2018 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm 
  Log:
  - Selected positions for default categories modified for additional category
    (Placement tests). 
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.327 loncom/interface/domainprefs.pm:1.328
--- loncom/interface/domainprefs.pm:1.327	Fri Jul  6 03:18:36 2018
+++ loncom/interface/domainprefs.pm	Fri Jul  6 04:03:31 2018
@@ -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 @@
                       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 .= '<tr '.$css_class.'><td><span class="LC_nobreak">'
-                     .'<select name="'.$default.'_pos">'
-                     .'<option value="0"'.$select0.'>1</option>'
-                     .'<option value="1"'.$select1.'>2</option>'
-                     .'<option value="2">3</option></select> '
+                     .'<select name="'.$default.'_pos"'.$chgstr.'>'
+                     .'<option value="0"'.$selected{'0'}.'>1</option>'
+                     .'<option value="1"'.$selected{'1'}.'>2</option>'
+                     .'<option value="2"'.$selected{'2'}.'>3</option>'
+                     .'<option value="3">4</option></select> '
                      .$default_names{$default}
                      .'</span></td><td><span class="LC_nobreak">'
                      .'<label><input type="radio" name="'.$default.'" value="1" checked="checked" />'
@@ -8509,7 +8512,8 @@
                   .'<select name="addcategory_pos"'.$chgstr.'>'
                   .'<option value="0">1</option>'
                   .'<option value="1">2</option>'
-                  .'<option value="2" selected="selected">3</option></select> '
+                  .'<option value="2">3</option>'
+                  .'<option value="3" selected="selected">4</option></select> '
                   .&mt('Add category').'</span></td><td><span class="LC_nobreak">'.&mt('Name:')
                   .' <input type="text" size="20" name="addcategory_name" value="" /></span>'
                   .'</td></tr>';




More information about the LON-CAPA-cvs mailing list