[LON-CAPA-cvs] cvs: loncom /interface coursecatalog.pm domainprefs.pm loncommon.pm loncoursequeueadmin.pm loncreatecourse.pm lonmodifycourse.pm lonrequestcourse.pm

raeburn raeburn at source.lon-capa.org
Sun Apr 3 21:09:48 EDT 2016


raeburn		Mon Apr  4 01:09:48 2016 EDT

  Modified files:              
    /loncom/interface	coursecatalog.pm domainprefs.pm loncommon.pm 
                     	loncoursequeueadmin.pm loncreatecourse.pm 
                     	lonmodifycourse.pm lonrequestcourse.pm 
  Log:
  - Bug 6808. New course container -- "Placement" for Placement Tests.
  
  
-------------- next part --------------
Index: loncom/interface/coursecatalog.pm
diff -u loncom/interface/coursecatalog.pm:1.88 loncom/interface/coursecatalog.pm:1.89
--- loncom/interface/coursecatalog.pm:1.88	Tue Jun  9 21:22:55 2015
+++ loncom/interface/coursecatalog.pm	Mon Apr  4 01:09:47 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler for displaying the course catalog interface
 #
-# $Id: coursecatalog.pm,v 1.88 2015/06/09 21:22:55 damieng Exp $
+# $Id: coursecatalog.pm,v 1.89 2016/04/04 01:09:47 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -319,6 +319,8 @@
                 my $display_button;
                 if ($env{'form.currcat_0'} eq 'communities::0') {
                     $display_button = &mt('Display communities');
+                } elsif ($env{'form.currcat_0'} eq 'placement::0') {
+                    $display_button = &mt('Display placement tests');
                 } else {
                     $display_button = &mt('Display courses');
                 }
@@ -358,9 +360,18 @@
     }
     my $brtextone = 'Course listing';
     my $brtexttwo = 'Course details';
+    my $textthree = &mt('Detailed course information:');
+    my $textfour = &mt('Back to course listing');
     if ($env{'form.currcat_0'} eq 'communities::0') {
         $brtextone = 'Community listing';
         $brtexttwo = 'Community details';
+        $textthree = &mt('Detailed community information:');
+        $textfour = &mt('Back to community listing');
+    } elsif ($env{'form.currcat_0'} eq 'placement::0') {
+        $brtextone = 'Placement test listing';
+        $brtexttwo = 'Placement test details';
+        $textthree = &mt('Detailed placement test information:');
+        $textfour = &mt('Back to placement test listing');
     }
     &Apache::lonhtmlcommon::add_breadcrumb
              ({href=>"javascript:document.$formname.submit()",
@@ -368,20 +379,12 @@
              {text=>$brtexttwo});
     $r->print(
         &Apache::lonhtmlcommon::breadcrumbs('Course/Community Catalog').
-        '<h2>'.
-        (($env{'form.currcat_0'} eq 'communities::0') ?
-            &mt('Detailed community information:') :
-            &mt('Detailed course information:')).
-        '</h2>'.
+        '<h2>'.$textthree.'</h2>'.
         &print_course_listing($codedom,undef,$trails,$allitems,undef,$codetitles).
         '<br />'.
         '<form name="'.$formname.'" method="post" action="/adm/coursecatalog">'.
         &Apache::lonhtmlcommon::actionbox([
-            '<a href = "javascript:document.coursecatalog.submit()">'.
-            (($env{'form.currcat_0'} eq 'communities::0') ?
-                &mt('Back to community listing') : &mt('Back to course listing')).
-            '</a>'
-        ]).
+            '<a href = "javascript:document.coursecatalog.submit()">'.$textfour.'</a>']).
         &Apache::lonhtmlcommon::echo_form_input(['coursenum','catalogfilter',
                                                  'showdetails','courseid']).
         '</form>');
@@ -505,6 +508,8 @@
     my $brtext = 'Course listing';
     if ($env{'form.currcat_0'} eq 'communities::0') {
         $brtext = 'Community listing';
+    } elsif ($env{'form.currcat_0'} eq 'placement::0') {
+        $brtext = 'Placement test listing';
     }
     if ($env{'form.state'} eq 'listing') {
         if ($numtitles > 0) {
@@ -558,6 +563,9 @@
             } elsif ($cats[0][0] eq 'communities') {
                 $catlinks .= &mt('Communities');
                 $env{'form.currcat_0'} = 'communities::0';
+            } elsif ($cats[0][0] eq 'placement') {
+                $catlinks .= &mt('Placement Tests');
+                $env{'form.currcat_0'} = 'placement::0';
             } else {
                 my $name = $cats[0][0];
                 my $item = &escape($name).'::0';
@@ -662,6 +670,8 @@
                 $maincatlinks .= &mt('Official courses (with institutional codes)');
             } elsif ($name eq 'communities') {
                 $maincatlinks .= &mt('Communities');
+            } elsif ($name eq 'placement') {
+                $maincatlinks .= &mt('Placement Tests');
             } else {
                 $maincatlinks .= $name;
             }
@@ -724,6 +734,8 @@
     my $selfenroll_text;
     if ($env{'form.currcat_0'} eq 'communities::0') {
         $selfenroll_text = &mt('Only show communities which currently allow self-enrollment (or will allow it in the future)');
+    } elsif ($env{'form.currcat_0'} eq 'placement::0') {
+        $selfenroll_text = &mt('Only show placement tests which currently allow self-enrollment (or will allow it in the future)');
     } else {
         $selfenroll_text = &mt('Only show courses which currently allow self-enrollment (or will allow it in the future)');
     }
@@ -758,6 +770,9 @@
         if ($env{'form.currcat_0'} eq 'communities::0') {
             $details_text = &mt('Show full details for each community ([_1] only)',$dc_title);
             $hidden_text = &mt('Include communities set to be hidden from catalog ([_1] only)',$dc_title);
+        } elsif ($env{'form.currcat_0'} eq 'placement::0') {
+            $details_text = &mt('Show full details for each placement test ([_1] only)',$dc_title);
+            $hidden_text = &mt('Include placement tests set to be hidden from catalog ([_1] only)',$dc_title);
         } else {
             $details_text = &mt('Show full details for each course ([_1] only)',$dc_title);
             $hidden_text = &mt('Include courses set to be hidden from catalog ([_1] only)',$dc_title);
@@ -966,6 +981,8 @@
         }
         if ($env{'form.currcat_0'} eq 'communities::0') {
             $typefilter = 'Community';
+        } elsif ($env{'form.currcat_0'} eq 'placement::0') {
+            $typefilter = 'Placement';
         } else {
             $typefilter = '.';
         }
@@ -997,7 +1014,9 @@
             $output = '<p class="LC_error">';
             if ($env{'form.currcat_0'} eq 'communities::0') {
                 $output .= &mt('The courseID provided does not match a community in this domain.');
-            } else { 
+            } elsif ($env{'form.currcat_0'} eq 'placement::0') {
+                $output .= &mt('The courseID provided does not match a placement test in this domain.');
+            } else {
                 $output .= &mt('The courseID provided does not match a course in this domain.');
             }
             $output .= '</p>';
@@ -1013,6 +1032,8 @@
             $output = '<p class="LC_info">';
             if ($env{'form.currcat_0'} eq 'communities::0') {
                 $output .= &mt('No communities match the criteria you selected.');
+            } elsif ($env{'form.currcat_0'} eq 'placement::0') {
+                $output .= &mt('No placement tests match the criteria you selected.');
             } else {
                 $output .= &mt('No courses match the criteria you selected.');
             }
@@ -1073,6 +1094,10 @@
             if ($env{'form.currcat_0'} eq 'communities::0') {
                 $output .= '<th>'.&mt('Default Access Dates for Members').'</th>'.
                            '<th>'.&mt('Member Counts').'</th>';
+            } elsif ($env{'form.currcat_0'} eq 'placement::0') {
+                $output .=
+                    '<th>'.&mt('Default Access Dates for Students').'</th>'.
+                    '<th>'.&mt('Student Counts').'</th>';               
             } else {
                 $output .=
                     '<th>'.&mt('Default Access Dates for Students').'</th>'.
@@ -1120,7 +1145,7 @@
     my (%numbers,%creditsum);
     my ($showcredits,$defofficial,$defunofficial,$deftextbook);
     my %domdefaults = &Apache::lonnet::get_domain_defaults($domain);
-    unless ($env{'form.currcat_0'} eq 'communities::0') {
+    unless (($env{'form.currcat_0'} eq 'communities::0') || ($env{'form.currcat_0'} eq 'placement::0')) {
         if ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'} || $domdefaults{'textbookcredits'}) {
             $showcredits = 1;
             $defofficial = $domdefaults{'officialcredits'};
@@ -1186,6 +1211,8 @@
                 $lt{'Active'} = &mt('Total current members'); 
                 $lt{'Future'} = &mt('Total future members');
                 $lt{'Previous'} = &mt('Total previous members');
+            } elsif ($env{'form.currcat_0'} eq 'placement::0') {
+                $lt{'courses'} = &mt('Total placement tests');
             }
             my $colspan = 8;
             if ($showcredits) {
@@ -1534,7 +1561,7 @@
             $output .=
                 '<td>'.$accessdates.'</td>'.
                 '<td>'.$counts.'</td>';
-            unless ($env{'form.currcat_0'} eq 'communities::0') {
+            unless (($env{'form.currcat_0'} eq 'communities::0') || ($env{'form.currcat_0'} eq 'placement::0')) {
                 $output .= '<td>'.$autoenrollment.'</td>';
             }
         } else {
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.271 loncom/interface/domainprefs.pm:1.272
--- loncom/interface/domainprefs.pm:1.271	Sat Apr  2 04:30:19 2016
+++ loncom/interface/domainprefs.pm	Mon Apr  4 01:09:47 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.271 2016/04/02 04:30:19 raeburn Exp $
+# $Id: domainprefs.pm,v 1.272 2016/04/04 01:09:47 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5552,6 +5552,10 @@
         my $toggle_catscomm_dom = ' checked="checked" ';
         my $can_catcomm_comm = ' ';
         my $can_catcomm_dom = ' checked="checked" ';
+        my $toggle_catsplace_place = ' ';
+        my $toggle_catsplace_dom = ' checked="checked" ';
+        my $can_catplace_place = ' ';
+        my $can_catplace_dom = ' checked="checked" ';
 
         if (ref($settings) eq 'HASH') {
             if ($settings->{'togglecats'} eq 'crs') {
@@ -5570,17 +5574,28 @@
                 $can_catcomm_comm = $can_catcomm_dom;
                 $can_catcomm_dom = ' ';
             }
+            if ($settings->{'togglecatsplace'} eq 'place') {
+                $toggle_catsplace_place = $toggle_catsplace_dom;
+                $toggle_catsplace_dom = ' ';
+            }
+            if ($settings->{'categorizeplace'} eq 'place') {
+                $can_catplace_place = $can_catplace_dom;
+                $can_catplace_dom = ' ';
+            }
         }
         my %title = &Apache::lonlocal::texthash (
-                     togglecats     => 'Show/Hide a course in catalog',
-                     togglecatscomm => 'Show/Hide a community in catalog',
-                     categorize     => 'Assign a category to a course',
-                     categorizecomm => 'Assign a category to a community',
+                     togglecats      => 'Show/Hide a course in catalog',
+                     togglecatscomm  => 'Show/Hide a community in catalog',
+                     togglecatsplace => 'Show/Hide a placement test in catalog',
+                     categorize      => 'Assign a category to a course',
+                     categorizecomm  => 'Assign a category to a community',
+                     categorizeplace => 'Assign a category to a placement test',
                     );
         my %level = &Apache::lonlocal::texthash (
-                     dom  => 'Set in Domain',
-                     crs  => 'Set in Course',
-                     comm => 'Set in Community',
+                     dom   => 'Set in Domain',
+                     crs   => 'Set in Course',
+                     comm  => 'Set in Community',
+                     place => 'Set in Placement Test',
                     );
         $datatable = '<tr class="LC_odd_row">'.
                   '<td>'.$title{'togglecats'}.'</td>'.
@@ -5610,8 +5625,22 @@
                   $can_catcomm_dom.' value="dom" />'.$level{'dom'}.'</label> '.
                   '<label><input type="radio" name="categorizecomm"'.
                   $can_catcomm_comm.'value="comm" />'.$level{'comm'}.'</label></span></td>'.
+                  '</tr><tr>'.
+                  '<td>'.$title{'togglecatsplace'}.'</td>'.
+                  '<td class="LC_right_item"><span class="LC_nobreak"><label>'.
+                  '<input type="radio" name="togglecatsplace"'.
+                  $toggle_catsplace_dom.' value="dom" />'.$level{'dom'}.'</label> '.
+                  '<label><input type="radio" name="togglecatscomm"'.
+                  $toggle_catsplace_place.' value="comm" />'.$level{'place'}.'</label></span></td>'.
+                  '</tr><tr>'.
+                  '<td>'.$title{'categorizeplace'}.'</td>'.
+                  '<td class="LC_right_item"><span class="LC_nobreak">'.
+                  '<label><input type="radio" name="categorizeplace"'.
+                  $can_catplace_dom.' value="dom" />'.$level{'dom'}.'</label> '.
+                  '<label><input type="radio" name="categorizeplace"'.
+                  $can_catplace_place.'value="place" />'.$level{'place'}.'</label></span></td>'.
                   '</tr>';
-        $$rowtotal += 4;
+        $$rowtotal += 6;
     } else {
         my $css_class;
         my $itemcount = 1;
@@ -5636,12 +5665,15 @@
                     my %default_names = (
                           instcode    => &mt('Official courses'),
                           communities => &mt('Communities'),
+                          placement   => &mt('Placement Tests'),
                     );
 
                     if ((!grep(/^instcode$/,@{$cats[0]})) || 
                         ($cathash->{'instcode::0'} eq '') ||
                         (!grep(/^communities$/,@{$cats[0]})) || 
-                        ($cathash->{'communities::0'} eq '')) {
+                        ($cathash->{'communities::0'} eq '') ||
+                        (!grep(/^placement$/,@{$cats[0]})) ||
+                        ($cathash->{'placement::0'} eq '')) {
                         $maxnum ++;
                     }
                     my $lastidx;
@@ -5662,7 +5694,7 @@
                             $datatable .= '<option value="'.$k.'"'.$selstr.'>'.$vpos.'</option>';
                         }
                         $datatable .= '</select></span></td><td>';
-                        if ($parent eq 'instcode' || $parent eq 'communities') {
+                        if ($parent eq 'instcode' || $parent eq 'communities' || $parent eq 'placement') {
                             $datatable .=  '<span class="LC_nobreak">'
                                            .$default_names{$parent}.'</span>';
                             if ($parent eq 'instcode') {
@@ -5685,7 +5717,7 @@
                             $datatable .= '<label><input type="radio" name="'
                                           .$parent.'" value="0" />'
                                           .&mt('Do not display').'</label></span>';
-                            if ($parent eq 'communities') {
+                            if (($parent eq 'communities') || ($parent eq 'placement')) {
                                 $datatable .= '</td></tr></table>';
                             }
                             $datatable .= '</td>';
@@ -5717,7 +5749,7 @@
                                   .'<input type="text" size="20" name="addcategory_name" value="" /></td>'
                                   .'</tr>'."\n";
                     $itemcount ++;
-                    foreach my $default ('instcode','communities') {
+                    foreach my $default ('instcode','communities','placement') {
                         if ((!grep(/^\Q$default\E$/,@{$cats[0]})) || ($cathash->{$default.'::0'} eq '')) {
                             $css_class = $itemcount%2?' class="LC_odd_row"':'';
                             my $chgstr = ' onchange="javascript:reorderCats(this.form,'."'','$default"."_pos','$lastidx'".');"';
@@ -5898,9 +5930,11 @@
     }
     my $instcode_reserved = &mt('The name: [_1] is a reserved category.','"instcode"');
     my $communities_reserved = &mt('The name: [_1] is a reserved category.','"communities"');
+    my $placement_reserved = &mt('The name: [_1] is a reserved category.','"placement"');
     my $choose_again = "\n".&mt('Please use a different name for the new top level category.'); 
     &js_escape(\$instcode_reserved);
     &js_escape(\$communities_reserved);
+    &js_escape(\$placement_reserved);
     &js_escape(\$choose_again);
     $output = <<"ENDSCRIPT";
 <script type="text/javascript">
@@ -5970,6 +6004,10 @@
         alert('$communities_reserved\\n$choose_again');
         return false;
     }
+    if (form.elements['addcategory_name'].value == 'placement') {
+        alert('$placement_reserved\\n$choose_again');
+        return false;
+    }
     return true;
 }
 
@@ -5986,13 +6024,14 @@
     my %default_names = (
                       instcode    => 'Official courses (with institutional codes)',
                       communities => 'Communities',
+                      placement   => 'Placement Tests',
                         );
     my $select0 = ' selected="selected"';
     my $select1 = '';
-    foreach my $default ('instcode','communities') {
+    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') {
+        if (($default eq 'communities') || ($default eq 'placement')) {
             $select1 = $select0;
             $select0 = '';
         }
@@ -10851,6 +10890,15 @@
         if ($domconfig{'coursecategories'}{'categorizecomm'} ne $env{'form.categorizecomm'}) {
             $changes{'categorizecomm'} = 1;
             $domconfig{'coursecategories'}{'categorizecomm'} = $env{'form.categorizecomm'};
+
+        }
+        if ($domconfig{'coursecategories'}{'togglecatsplace'} ne $env{'form.togglecatsplace'}) {
+            $changes{'togglecatsplace'} = 1;
+            $domconfig{'coursecategories'}{'togglecatsplace'} = $env{'form.togglecatsplace'};
+        }
+        if ($domconfig{'coursecategories'}{'categorizeplace'} ne $env{'form.categorizeplace'}) {
+            $changes{'categorizeplace'} = 1;
+            $domconfig{'coursecategories'}{'categorizeplace'} = $env{'form.categorizeplace'};
         }
         foreach my $item (@catitems) {
             if (grep(/^\Q$env{'form.coursecat_'.$item}\E$/, at cattypes)) {
@@ -10865,11 +10913,15 @@
         $changes{'categorize'} = 1;
         $changes{'togglecatscomm'} = 1;
         $changes{'categorizecomm'} = 1;
+        $changes{'togglecatsplace'} = 1;
+        $changes{'categorizeplace'} = 1;
         $domconfig{'coursecategories'} = {
                                              togglecats => $env{'form.togglecats'},
                                              categorize => $env{'form.categorize'},
                                              togglecatscomm => $env{'form.togglecatscomm'},
                                              categorizecomm => $env{'form.categorizecomm'},
+                                             togglecatsplace => $env{'form.togglecatsplace'},
+                                             categorizeplace => $env{'form.categorizeplace'},
                                          };
         foreach my $item (@catitems) {
             if ($env{'form.coursecat_'.$item} ne 'std') {
@@ -10887,6 +10939,9 @@
         if (($domconfig{'coursecategories'}{'cats'}{'communities::0'} ne '')  && ($env{'form.communities'} == 0)) {
             push(@deletecategory,'communities::0');
         }
+        if (($domconfig{'coursecategories'}{'cats'}{'placement::0'} ne '')  && ($env{'form.placement'} == 0)) {
+            push(@deletecategory,'placement::0');
+        }
     }
     my (@predelcats, at predeltrails,%predelallitems,%sort_by_deltrail);
     if (ref($cathash) eq 'HASH') {
@@ -10949,9 +11004,23 @@
             $adds{$newitem} = 1;
         }
     }
+    if ($env{'form.placement'} eq '1') {
+        if (ref($cathash) eq 'HASH') {
+            my $newitem = 'placement::0';
+            if ($cathash->{$newitem} eq '') {
+                $domconfig{'coursecategories'}{'cats'}{$newitem} = $env{'form.placement_pos'};
+                $adds{$newitem} = 1;
+            }
+        } else {
+            my $newitem = 'placement::0';
+            $domconfig{'coursecategories'}{'cats'}{$newitem} = $env{'form.placement_pos'};
+            $adds{$newitem} = 1;
+        }
+    }
     if ($env{'form.addcategory_name'} ne '') {
         if (($env{'form.addcategory_name'} ne 'instcode') &&
-            ($env{'form.addcategory_name'} ne 'communities')) {
+            ($env{'form.addcategory_name'} ne 'communities') &&
+            ($env{'form.addcategory_name'} ne 'placement')) {
             my $newitem = &escape($env{'form.addcategory_name'}).'::0';
             $domconfig{'coursecategories'}{'cats'}{$newitem} = $env{'form.addcategory_pos'};
             $adds{$newitem} = 1;
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1238 loncom/interface/loncommon.pm:1.1239
--- loncom/interface/loncommon.pm:1.1238	Mon Apr  4 00:56:04 2016
+++ loncom/interface/loncommon.pm	Mon Apr  4 01:09:47 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1238 2016/04/04 00:56:04 raeburn Exp $
+# $Id: loncommon.pm,v 1.1239 2016/04/04 01:09:47 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -881,6 +881,8 @@
    my $linktext = &mt('Select Course');
    if ($selecttype eq 'Community') {
        $linktext = &mt('Select Community');
+   } elsif ($selecttype eq 'Placement') {
+       $linktext = &mt('Select Placement Test'); 
    } elsif ($selecttype eq 'Course/Community') {
        $linktext = &mt('Select Course/Community');
        $type = '';
@@ -14271,6 +14273,8 @@
                     $trailstr = &mt('Official courses (with institutional codes)');
                 } elsif ($name eq 'communities') {
                     $trailstr = &mt('Communities');
+                } elsif ($name eq 'placement') {
+                    $trailstr = &mt('Placement Tests');
                 } else {
                     $trailstr = $name;
                 }
@@ -14409,8 +14413,10 @@
                     next if ($parent eq 'instcode');
                     if ($type eq 'Community') {
                         next unless ($parent eq 'communities');
+                    } elsif ($type eq 'Placement') {
+                        next unless ($parent eq 'placement');
                     } else {
-                        next if ($parent eq 'communities');
+                        next if (($parent eq 'communities') || ($parent eq 'placement'));
                     }
                     my $css_class = $itemcount%2?' class="LC_odd_row"':'';
                     my $item = &escape($parent).'::0';
@@ -14423,6 +14429,8 @@
                     my $parent_title = $parent;
                     if ($parent eq 'communities') {
                         $parent_title = &mt('Communities');
+                    } elsif ($parent eq 'placement') {
+                        $parent_title = &mt('Placement Tests');
                     }
                     $table .= '<tr '.$css_class.'><td><span class="LC_nobreak">'.
                               '<input type="checkbox" name="usecategory" value="'.
@@ -14858,7 +14866,12 @@
 #
 # Open course
 #
-    my $crstype = lc($args->{'crstype'});
+    my $showncrstype;
+    if ($args->{'crstype'} eq 'Placement') {
+        $showncrstype = 'placement test'; 
+    } else {  
+        $showncrstype = lc($args->{'crstype'});
+    }
     my %cenv=();
     $$courseid=&Apache::lonnet::createcourse($args->{'course_domain'},
                                              $args->{'cdescr'},
@@ -14875,7 +14888,7 @@
     # Utils::Course. This needs to at least be output as a comment
     # if anyone ever decides to not show this, and Utils::Course::new
     # will need to be suitably modified.
-    $outcome .= &mt('New LON-CAPA [_1] ID: [_2]',$crstype,$$courseid).$linefeed;
+    $outcome .= &mt('New LON-CAPA [_1] ID: [_2]',$showncrstype,$$courseid).$linefeed;
     if ($$courseid =~ /^error:/) {
         return (0,$outcome);
     }
@@ -14895,7 +14908,7 @@
 # Do the cloning
 #   
     if ($can_clone && $cloneid) {
-	$clonemsg = &mt('Cloning [_1] from [_2]',$crstype,$clonehome);
+	$clonemsg = &mt('Cloning [_1] from [_2]',$showncrstype,$clonehome);
 	if ($context ne 'auto') {
 	    $clonemsg = '<span class="LC_success">'.$clonemsg.'</span>';
 	}
@@ -15203,10 +15216,23 @@
 # 
 # Set params for Placement Tests
 #
-    if ($crstype eq 'Placement') {
-       my $storeunder=$$crsudom.'_'.$$crsunum.'.0.buttonshide';
-       my %storecontent = ($storeunder         => 'yes',
-                           $storeunder.'.type' => 'string_yesno');
+    if ($args->{'crstype'} eq 'Placement') {
+       my %storecontent; 
+       my $prefix=$$crsudom.'_'.$$crsunum.'.0.';
+       my %defaults = (
+                        buttonshide   => { value => 'yes',
+                                           type => 'string_yesno',},
+                        type          => { value => 'randomizetry',
+                                           type  => 'string_questiontype',},
+                        maxtries      => { value => 1,
+                                           type => 'int_pos',},
+                        problemstatus => { value => 'no',
+                                           type  => 'string_problemstatus',},
+                      );
+       foreach my $key (keys(%defaults)) {
+           $storecontent{$prefix.$key} = $defaults{$key}{'value'};
+           $storecontent{$prefix.$key.'.type'} = $defaults{$key}{'type'};
+       }
        &Apache::lonnet::cput
                  ('resourcedata',\%storecontent,$$crsudom,$$crsunum); 
     }
@@ -15764,15 +15790,19 @@
         $createdfilterform = &timebased_select_form('createdfilter',$filter);
     }
 
+    my $prefix = $crstype;
+    if ($crstype eq 'Placement') {
+        $prefix = 'Placement Test'
+    }
     my %lt = &Apache::lonlocal::texthash(
-                'cac' => "$crstype Activity",
-                'ccr' => "$crstype Created",
-                'cde' => "$crstype Title",
-                'cdo' => "$crstype Domain",
+                'cac' => "$prefix Activity",
+                'ccr' => "$prefix Created",
+                'cde' => "$prefix Title",
+                'cdo' => "$prefix Domain",
                 'ins' => 'Institutional Code',
                 'inc' => 'Institutional Categorization',
-                'cow' => "$crstype Owner/Co-owner",
-                'cop' => "$crstype Personnel Includes",
+                'cow' => "$prefix Owner/Co-owner",
+                'cop' => "$prefix Personnel Includes",
                 'cog' => 'Type',
              );
 
@@ -15780,6 +15810,8 @@
         my $typeval = 'Course';
         if ($crstype eq 'Community') {
             $typeval = 'Community';
+        } elsif ($crstype eq 'Placement') {
+            $typeval = 'Placement';
         }
         $typeselectform = '<input type="hidden" name="type" value="'.$typeval.'" />';
     } else {
@@ -15789,8 +15821,14 @@
         }
         $typeselectform .= '>'."\n";
         foreach my $posstype ('Course','Community','Placement') {
+            my $shown;
+            if ($posstype eq 'Placement') {
+                $shown = &mt('Placement Test');
+            } else {
+                $shown = &mt($posstype);
+            }
             $typeselectform.='<option value="'.$posstype.'"'.
-                ($posstype eq $crstype ? ' selected="selected" ' : ''). ">".&mt($posstype)."</option>\n";
+                ($posstype eq $crstype ? ' selected="selected" ' : ''). ">".$shown."</option>\n";
         }
         $typeselectform.="</select>";
     }
Index: loncom/interface/loncoursequeueadmin.pm
diff -u loncom/interface/loncoursequeueadmin.pm:1.52 loncom/interface/loncoursequeueadmin.pm:1.53
--- loncom/interface/loncoursequeueadmin.pm:1.52	Thu Jun  4 18:57:54 2015
+++ loncom/interface/loncoursequeueadmin.pm	Mon Apr  4 01:09:48 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Utilities to administer domain course requests and course self-enroll requests
 #
-# $Id: loncoursequeueadmin.pm,v 1.52 2015/06/04 18:57:54 raeburn Exp $
+# $Id: loncoursequeueadmin.pm,v 1.53 2016/04/04 01:09:48 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -523,6 +523,7 @@
                         unofficial => 'Unofficial course',
                         community  => 'Community',
                         textbook   => 'Textbook course',
+                        placement  => 'Placement test',
                     );
         $output .= '<th>'.&mt('Type').'</th>'.
                    '<th>'.&mt('Date requested').'</th>'.
@@ -1603,7 +1604,7 @@
         $keysmsg,$domdefs,$longroles,$coderef,$customhash) =  @_;
     unless ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH') && 
             (ref($longroles) eq 'HASH')) {
-        return 'error: Invalid request';
+        return ('error: Invalid request');
     }
     my ($result,$ownername,$ownerdom);
     my $crstype = $details->{'crstype'};
@@ -1674,6 +1675,8 @@
         $batchhash{'authparam'} = $domdefs->{'auth_arg_def'};
         if ($details->{'crstype'} eq 'community') {
             $batchhash{'crstype'} = 'Community';
+        } elsif ($details->{'crstype'} eq 'placement') {
+            $batchhash{'crstype'} = 'Placement';
         } else {
             if ($details->{'crstype'} eq 'textbook') {
                 if ($details->{'clonecrs'} && $details->{'clonedom'}) {
Index: loncom/interface/loncreatecourse.pm
diff -u loncom/interface/loncreatecourse.pm:1.158 loncom/interface/loncreatecourse.pm:1.159
--- loncom/interface/loncreatecourse.pm:1.158	Tue Jun  9 21:22:56 2015
+++ loncom/interface/loncreatecourse.pm	Mon Apr  4 01:09:48 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Create a course
 #
-# $Id: loncreatecourse.pm,v 1.158 2015/06/09 21:22:56 damieng Exp $
+# $Id: loncreatecourse.pm,v 1.159 2016/04/04 01:09:48 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -91,6 +91,8 @@
     my $crstype = 'Community';
     if ($env{'form.phase'} eq 'courseone') {
         $crstype = 'Course';
+    } elsif ($env{'form.phase'} eq 'placementone') {
+        $crstype = 'Placement';
     }
     my $defdom=$env{'request.role.domain'};
     my %domdefaults = &Apache::lonnet::get_domain_defaults($defdom);
@@ -130,7 +132,7 @@
         $krbform = &Apache::loncommon::authform_kerberos(%param);
         $intform = &Apache::loncommon::authform_internal(%param);
         $locform = &Apache::loncommon::authform_local(%param);
-    } else {
+    } elsif ($crstype eq 'Community') {
         my $title_alert = &mt('A Community title is required');
         my $coord_alert = &mt('The username of the Coordinator is required');
         &js_escape(\$title_alert);
@@ -147,6 +149,24 @@
     formname.submit();
 }
         |;
+    } else {
+        my $title_alert = &mt('A Placement Test title is required');
+        my $coord_alert = &mt('The username of the Course Coordinator is required');
+        &js_escape(\$title_alert);
+        &js_escape(\$coord_alert);
+        $javascript_validations = qq|
+function validate(formname) {
+    if (formname.title == '') {
+        alert("$title_alert");
+        return;
+    }
+    if (formname.ccuname == '') {
+        alert("$coord_alert");
+    }
+    formname.submit();
+}
+        |;
+        
     }
     my %lt=&Apache::lonlocal::texthash(
 		    'cinf' => "Course Information",
@@ -244,6 +264,18 @@
         $lt{'cc'}  = &mt('(will be assigned Coordinator role)');
         $lt{'cgrs'} = &mt('Community Group Settings');
         $lt{'cgrq'} = &mt('Set a quota for the total disk space available for storage of community group portfolio files');
+    } elsif ($crstype eq 'Placement') {
+        $lt{'cinf'} = &mt('Placement Test Information');
+        $lt{'ctit'} = &mt('Placement Test Title');
+        $lt{'chsr'} = &mt('Placement Test Home Server');
+        $lt{'cidn'} = &mt('Placement Test ID/Number');
+        $lt{'crco'} = &mt('Placement Test Content');
+        $lt{'cncr'} = &mt('Completely new placement test');
+        $lt{'cecr'} = &mt('Clone an existing placement test');
+        $lt{'sacr'} = &mt('Do NOT generate as standard placement test');
+        $lt{'stco'} = &mt('standard placement tests only');
+        $lt{'navi'} = &mt('Placement Test Contents');
+        $lt{'cid'}  = &mt('Placement Test ID');
     }
     my $js = <<END;
 <script type="text/javascript">
@@ -272,6 +304,7 @@
     my %titles = &Apache::lonlocal::texthash(
                   courseone => 'Create a New Course',
                   groupone => 'Create a New Community',
+                  placementone=> 'Create a New Placement Test',
     );  
     my $start_page = 
         &Apache::loncommon::start_page($titles{$env{'form.phase'}},$js);
@@ -351,7 +384,11 @@
                      .'<input type="radio" name="uniquecode" value="1" />'.&mt('Yes').(' 'x2)
                      .'<input type="radio" name="uniquecode" value="0" checked="checked" />'.&mt('No')
                      .&Apache::lonhtmlcommon::row_closure()
-            );
+                 );
+    }
+    my $blankchk;
+    if ($crstype eq 'Placement') {
+        $blankchk = ' checked="checked"';
     }
     # Table: New Course / Clone Course
     $r->print(&Apache::lonhtmlcommon::row_headline()
@@ -377,15 +414,14 @@
                  .&Apache::lonhtmlcommon::row_closure()
                  .&Apache::lonhtmlcommon::row_title($lt{'fres'})
                  .'<label>'
-                 .'<input type="radio" name="firstres" value="blank" />'.$lt{'blnk'}
-                 .'</label>'
-                 .' ');
+                 .'<input type="radio" name="firstres" value="blank"'.$blankchk.' />'.$lt{'blnk'}
+                 .'</label>');
     if ($crstype eq 'Community') {
-        $r->print('<label>'
+        $r->print(' <label>'
                  .'<input type="radio" name="firstres" value="nav" checked="checked" />'.$lt{'navi'}
                  .'</label>');
-    } else {
-        $r->print('<label>'
+    } elsif ($crstype eq 'Course') {
+        $r->print(' <label>'
                  .'<input type="radio" name="firstres" value="syl" checked="checked" />'.$lt{'sllb'}
                  .'</label>'
                  .' '
@@ -567,6 +603,14 @@
 <input type="submit" value="'.$lt{'opcm'}.'" />
 </p>'
         );
+    } elsif ($crstype eq 'Placement') {
+        $r->print('
+<p>
+<input type="hidden" name="prevphase" value="placementone" />
+<input type="hidden" name="phase" value="placementtwo" />
+<input type="submit" value="'.$lt{'opcm'}.'" />
+</p>'
+        );
     }
     $r->print('</form>'.
               $end_page);
@@ -587,6 +631,8 @@
         $crstype='Course';
         $enrollstart=&Apache::lonhtmlcommon::get_date_from_form('startenroll');
         $enrollend=&Apache::lonhtmlcommon::get_date_from_form('endenroll');
+    } elsif ($env{'form.phase'} eq 'placementtwo') {
+        $crstype='Placement';
     }
     $startaccess = &Apache::lonhtmlcommon::get_date_from_form('startaccess');
     $endaccess   = &Apache::lonhtmlcommon::get_date_from_form('endaccess');
@@ -734,9 +780,9 @@
 }
 
 sub print_intro_page {
-    my ($r,$show_all_choices) = @_;
+    my ($r,$show_all_choices,$cancreate) = @_;
     my $start_page =
-        &Apache::loncommon::start_page('Create a New Course or Community');
+        &Apache::loncommon::start_page('Create a New Course, Community or Placement Test');
     my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('Creation Options','Create_Course',undef,'Create_Courses');
     my $end_page =
         &Apache::loncommon::end_page();
@@ -758,18 +804,26 @@
           {
                linktext => 'Create a single community',
                url => '/adm/createcourse?phase=groupone',
-               permission => $show_all_choices,
+               permission => $cancreate->{'Community'},
                #help => '',
                icon => 'crsnew.png',
                linktitle => 'Create a new collaborative community by completing an online form.'
           },
           {
-               linktext => 'Create courses/communities by uploading an attributes file',
+               linktext => 'Create a single placement test',
+               url => '/adm/createcourse?phase=placementone',
+               permission => $cancreate->{'Placement'},
+               #help => '',
+               icon => 'crsnew.png',
+               linktitle => 'Create a new placement test by completing an online form.'
+          },
+          {
+               linktext => 'Create courses/communities/placement tests by uploading an attributes file',
                url => '/adm/createcourse?phase=batchone',
                permission => 1,
                help => 'Batch_Creation',
                icon => 'uplcrs.png',
-               linktitle => 'Upload an attributes file containing specifications for one or more courses or communities in XML format.'
+               linktitle => 'Upload an attributes file containing specifications for one or more courses, communities or placement tests in XML format.'
           },
        ]
        },
@@ -781,7 +835,7 @@
                permission => $show_all_choices,
                #help => '',
                icon => 'rcrs.png',
-               linktitle => 'Display course and community creation requests submitted by authorized users, held pending approval by a Domain Coordinator.'
+               linktitle => 'Display course, community creation and placement test requests submitted by authorized users, held pending approval by a Domain Coordinator.'
            },
            {
                linktext => 'View pending official course requests',
@@ -802,7 +856,7 @@
                permission => $show_all_choices,
                #help => '',
                icon => 'document-properties.png',
-               linktitle => 'Display information about when, how and by whom courses and communities were created in this domain.'
+               linktitle => 'Display information about when, how and by whom courses, communities and placement tests were created in this domain.'
            },
        ]
        },
@@ -819,18 +873,18 @@
 sub upload_batchfile {
     my $r = shift;
     my $start_page =
-        &Apache::loncommon::start_page('Create a New Course or Community');
-    my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('Upload Course/Community Attributes File','Create_Course',undef,'Create_Courses');
+        &Apache::loncommon::start_page('Create a New Course, Community, or Placement Test');
+    my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('Upload Course/Community/Placement Test Attributes File','Create_Course',undef,'Create_Courses');
     my $end_page =
         &Apache::loncommon::end_page();
     $r->print($start_page.$crumbs);
-    $r->print('<h3>'.&mt('Upload a courses or communities attributes file').'</h3>');
+    $r->print('<h3>'.&mt('Upload a courses, communities or placement tests attributes file').'</h3>');
     $r->print('<form name="batchcreate" method="post" '.
                 'enctype="multipart/form-data" action="/adm/createcourse">'.
               '<input type="file" name="coursecreatorxml" />'.
               '<input type="hidden" name="phase" value="batchtwo" /><br /><br />'.
               '<input type="submit" name="batchsubmit" '.
-              'value="'.&mt('Create Courses/Communities').'" /></form>');
+              'value="'.&mt('Create Courses/Communities/Placement Tests').'" /></form>');
     $r->print($end_page);
     return;
 }
@@ -838,7 +892,7 @@
 sub process_batchfile {
     my $r = shift;
     my $start_page =
-        &Apache::loncommon::start_page('Create a New Course or Community');
+        &Apache::loncommon::start_page('Create a New Course, Community or Placement Test');
     my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('Creation Outcome','Create_Course',undef,'Create_Courses');
     my $end_page =
         &Apache::loncommon::end_page();
@@ -957,6 +1011,8 @@
         $crstype = '.';
     } elsif ($curr{'type'} eq 'community') {
         $crstype = 'Community';
+    } elsif ($curr{'type'} eq 'placement') {
+        $crstype = 'Placement';
     }
 
     my ($instcodefilter,$regexpok);
@@ -1047,6 +1103,8 @@
         my $showtype;
         if ($courses{$cid}{type} eq 'Community') {
             $showtype = &mt('community');
+        } elsif ($courses{$cid}{type} eq 'Placement') {
+            $showtype = &mt('placement test');
         } else {
             my $instcode = $courses{$cid}{inst_code};
             if ($instcode ne '')  {
@@ -1259,10 +1317,25 @@
 
     my $show_all_choices = 0;
     my $primary_rev = &Apache::lonnet::get_server_loncaparev($env{'request.role.domain'});
+    my %cancreate = (
+                         Community => 0,
+                         Placement => 0,
+                    );
+
     if (($primary_rev ne 'refused') && ($primary_rev ne 'error') &&
         ($primary_rev ne 'unknown_cmd') && ($primary_rev ne 'no_such_host')) {
         $show_all_choices = 1;
+        my ($primary_major,$primary_minor) = split(/\./,$primary_rev);
+        foreach my $key (keys(%cancreate)) {
+            my ($needsmajor,$needsminor) = 
+                split(/\./,$Apache::lonnet::needsrelease{'course:crstype:'.$key});
+            unless (($needsmajor > $primary_major) ||
+                    (($needsmajor == $primary_major) && ($needsminor > $primary_minor))) {
+                $cancreate{$key} = 1;
+            }
+        }
     }
+print STDERR "cacreate Community $cancreate{'Community'} cancreate Placement $cancreate{'Placement'}\n";
 
     if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) {
        &Apache::loncommon::content_type($r,'text/html');
@@ -1277,7 +1350,9 @@
             faq=>79,bug=>'Dom Coord Interface',});
        if (($env{'form.phase'} eq 'coursetwo') ||
            (($env{'form.phase'} eq 'grouptwo') && 
-            ($show_all_choices))) { 
+            ($cancreate{'Community'})) ||
+           (($env{'form.phase'} eq 'placementtwo') &&
+            ($cancreate{'Placement'}))) { 
            &Apache::lonhtmlcommon::add_breadcrumb
                  ({href=>"/adm/createcourse?phase=$env{'form.prevphase'}",
                    text=>&mt('[_1] Creation Settings',),
@@ -1289,7 +1364,9 @@
            &create_course($r);
        } elsif (($env{'form.phase'} eq 'courseone') || 
                 (($env{'form.phase'} eq 'groupone') && 
-                ($show_all_choices))) {
+                ($cancreate{'Community'})) ||
+                (($env{'form.phase'} eq 'placementone') &&
+                 ($cancreate{'Placement'}))) {
            &Apache::lonhtmlcommon::add_breadcrumb
                  ({href=>"/adm/createcourse?phase=$env{'form.phase'}",
                    text=>&mt('[_1] Creation Settings',),
@@ -1384,7 +1461,7 @@
            &print_creation_logs($r);
            $r->print('</div>'.&Apache::loncommon::end_page());
        } else {
-           &print_intro_page($r,$show_all_choices);
+           &print_intro_page($r,$show_all_choices,\%cancreate);
        }
    } else {
       $env{'user.error.msg'}=
Index: loncom/interface/lonmodifycourse.pm
diff -u loncom/interface/lonmodifycourse.pm:1.80 loncom/interface/lonmodifycourse.pm:1.81
--- loncom/interface/lonmodifycourse.pm:1.80	Sat Apr  2 04:30:21 2016
+++ loncom/interface/lonmodifycourse.pm	Mon Apr  4 01:09:48 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # handler for DC-only modifiable course settings
 #
-# $Id: lonmodifycourse.pm,v 1.80 2016/04/02 04:30:21 raeburn Exp $
+# $Id: lonmodifycourse.pm,v 1.81 2016/04/04 01:09:48 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -41,7 +41,7 @@
 
 sub get_dc_settable {
     my ($type,$cdom) = @_;
-    if ($type eq 'Community') {
+    if (($type eq 'Community') || ($type eq 'Placement')) {
         return ('courseowner','selfenrollmgrdc','selfenrollmgrcc');
     } else {
         my @items = ('courseowner','coursecode','authtype','autharg','selfenrollmgrdc','selfenrollmgrcc');
@@ -71,6 +71,13 @@
             if ($confhash->{'categorizecomm'} ne 'comm') {
                 push(@settable,'categorize');
             }
+        } elsif ($type eq 'Placement') {
+            if ($confhash->{'togglecatsplace'} ne 'place') {
+                push(@settable,'togglecats');
+            }
+            if ($confhash->{'categorizeplace'} ne 'place') {
+                push(@settable,'categorize');
+            }
         } else {
             if ($confhash->{'togglecats'} ne 'crs') {
                 push(@settable,'togglecats');
@@ -167,6 +174,8 @@
     $r->print(&Apache::loncommon::js_changer());
     if ($type eq 'Community') {
         $r->print('<h3>'.&mt('Search for a community in the [_1] domain',$domdesc).'</h3>');
+    } elsif ($type eq 'Placement') {
+        $r->print('<h3>'.&mt('Search for a placement test in the [_1] domain',$domdesc).'</h3>');
     } else {
         $r->print('<h3>'.&mt('Search for a course in the [_1] domain',$domdesc).'</h3>');
     }
@@ -178,6 +187,11 @@
                   '<li>'.&mt('Enter the community with the role of [_1]',$cctitle).'</li>'."\n".
                   '<li>'.&mt('View or modify community settings which only a [_1] may modify.',$dctitle).
                   '</li>'."\n".'</ul>');
+    } elsif ($type eq 'Placement') {
+        $r->print(&mt('Actions available after searching for a placement test:').'<ul>'.
+                  '<li>'.&mt('Enter the placement test with the role of [_1]',$cctitle).'</li>'."\n".
+                  '<li>'.&mt('View or modify placement test settings which only a [_1] may modify.',$dctitle).
+                  '</li>'."\n".'</ul>');
     } else {
         $r->print(&mt('Actions available after searching for a course:').'<ul>'.
                   '<li>'.&mt('Enter the course with the role of [_1]',$cctitle).'</li>'."\n".
@@ -254,7 +268,9 @@
         $categorytitle = 'View/Modify Course Settings';
         $setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a course.');
         $setuploadquota_text = &mt('Disk space allocated for storage of content uploaded directly to a course via Content Editor.');
-        if (&showcredits($dom)) {
+        if ($type eq 'Placement') {
+            $setparams_text = 'View/Modify course owner and self-enrollment';
+        } elsif (&showcredits($dom)) {
             $setparams_text = 'View/Modify course owner, institutional code, default authentication, credits, and self-enrollment';
         } else {
             $setparams_text = 'View/Modify course owner, institutional code, default authentication, and self-enrollment';
@@ -320,7 +336,7 @@
             {
                 linktext => 'Display current settings for automated enrollment',
                 url => &phaseurl('viewparms'),
-                permission => ($type ne 'Community'),
+                permission => (($type ne 'Community') && ($type ne 'Placement')),
                 #help => '',
                 icon => 'roles.png',
                 linktitle => ''
@@ -359,10 +375,14 @@
     if ($type eq 'Community') {
         $menu_html .= '<li>'.&mt('Community owner (permitted to assign Coordinator roles in the community).').'</li>'."\n".
                       '<li>'.&mt('Override defaults for who configures self-enrollment for this specific community').'</li>'."\n";
+    } elsif ($type eq 'Placement') {
+        $menu_html .= '<li>'.&mt('Course owner (permitted to assign Course Coordinator roles in the course).').'</li>'."\n".
+                      '<li>'.&mt('Override defaults for who configures self-enrollment for this specific course.').'</li>'."\n";
+
     } else {
         $menu_html .=  '<li>'.&mt('Course owner (permitted to assign Course Coordinator roles in the course).').'</li>'."\n".
                        '<li>'.&mt("Institutional code and default authentication (both required for auto-enrollment of students from institutional datafeeds).").'</li>'."\n";
-        if (&showcredits($dom)) {
+        if (($type ne 'Placement') && &showcredits($dom)) {
             $menu_html .= '<li>'.&mt('Default credits earned by student on course completion.').'</li>'."\n";
         }
         $menu_html .= ' <li>'.&mt('Override defaults for who configures self-enrollment for this specific course.').'</li>'."\n";
@@ -693,6 +713,8 @@
                       ' <label><input name="hidefromcat" type="radio" value="yes" '.$excludeon.' />'.&mt('Yes').'</label>   <label><input name="hidefromcat" type="radio" value="" '.$excludeoff.' />'.&mt('No').'</label><br /><p>');
             if ($type eq 'Community') {
                 $r->print(&mt("If a community has been categorized using at least one of the categories defined for communities in the domain, it will be listed in the domain's publicly accessible Course/Community Catalog, unless excluded."));
+            } elsif ($type eq 'Placement') {
+                $r->print(&mt("If a placement test has been categorized using at least one of the categories defined for placement tests in the domain, it will be listed in the domain's publicly accessible Course/Community Catalog, unless excluded."));
             } else {
                 $r->print(&mt("Unless excluded, a course will be listed in the domain's publicly accessible Course/Community Catalog, if at least one of the following applies").':<ul>'.
                           '<li>'.&mt('Auto-cataloging is enabled and the course is assigned an institutional code.').'</li>'.
@@ -714,7 +736,7 @@
             } else {
                 $r->print(&mt('No categories defined for this domain'));
             }
-            unless ($type eq 'Community') { 
+            unless (($type eq 'Community') || ($type eq 'Placement')) { 
                 $r->print('<p>'.&mt('If auto-cataloging based on institutional code is enabled in the domain, a course will continue to be listed in the catalog of official courses, in addition to receiving a listing under any manually assigned categor(ies).').'</p>');
             }
         }
@@ -831,6 +853,10 @@
         $r->print(&Apache::lonhtmlcommon::row_title(
                   &Apache::loncommon::help_open_topic('Modify_Community_Owner').
                   ' '.&mt('Community Owner'))."\n");
+    } elsif ($crstype eq 'Placement') {
+         $r->print(&Apache::lonhtmlcommon::row_title(
+                   &Apache::loncommon::help_open_topic('Modify_Course_Owner').
+                      ' '.&mt('Course Owner'))."\n");
     } else {
         $r->print(&Apache::lonhtmlcommon::row_title(
                       &Apache::loncommon::help_open_topic('Modify_Course_Instcode').
@@ -905,7 +931,7 @@
               '<br />'.&Apache::lonhtmlcommon::row_closure(1).
               &Apache::lonhtmlcommon::end_pick_box().'</p><p>'.$hidden_elements.
               '<input type="button" onclick="javascript:changePage(this.form,'."'processparms'".');');
-    if ($crstype eq 'Community') {
+    if (($crstype eq 'Community') || ($crstype eq 'Placement')) {
         $r->print('this.form.submit();"');
     } else {
         $r->print('javascript:verify_message(this.form);"');
@@ -1026,7 +1052,7 @@
                  'internal.pendingco-owners','internal.selfenrollmgrdc',
                  'internal.selfenrollmgrcc');
     my ($selfenrollrows,$selfenrolltitles) = &Apache::lonuserutils::get_selfenroll_titles();
-    unless ($type eq 'Community') {
+    unless (($type eq 'Community') || ($type eq 'Placement')) {
         push(@items,('internal.coursecode','internal.authtype','internal.autharg',
                      'internal.sectionnums','internal.crosslistings'));
         if (&showcredits($cdom)) {  
@@ -1044,6 +1070,9 @@
     if ($type eq 'Community') {
         %changed = ( owner  => 0 );
         $ccrole = 'co';
+    } elsif ($type eq 'Placement') {
+        %changed = ( owner  => 0 );
+        $ccrole = 'cc';
     } else {
         %changed = ( code  => 0,
                      owner => 0,
@@ -1204,7 +1233,7 @@
                     $nochgresponse .= '<li>'.&mt('[_1] still set to: [_2]',$longtype{$attr},$shown).'</li>';
                 }
             }
-            if (($type ne 'Community') && ($changed{'code'} || $changed{'owner'})) {
+            if (($type ne 'Community') && ($type ne 'Placement') && ($changed{'code'} || $changed{'owner'})) {
                 if ( $newattr{'courseowner'} eq '') {
 	            push(@warnings,&mt('There is no owner associated with this LON-CAPA course.').
                                    '<br />'.&mt('If automated enrollment at your institution requires validation of course owners, automated enrollment will fail.'));
@@ -2041,6 +2070,8 @@
     my $bread_text = "View/Modify Courses/Communities";
     if ($type eq 'Community') {
         $bread_text = 'Community Settings';
+    } elsif ($type eq 'Placement') {
+        $bread_text = 'Placement Test Settings';
     } else {
         $bread_text = 'Course Settings';
     }
@@ -2174,11 +2205,14 @@
             }
             my $choose_text;
             my $type = $env{'form.type'};
+print STDERR "type is ||$type||\n";
             if ($type eq '') {
                 $type = 'Course';
             }
             if ($type eq 'Community') {
                 $choose_text = "Choose a community";
+            } elsif ($type eq 'Placement') {
+                $choose_text = "Choose a placement test";
             } else {
                 $choose_text = "Choose a course";
             } 
@@ -2195,6 +2229,8 @@
                     my $enter_text;
                     if ($type eq 'Community') {
                         $enter_text = 'Enter community';
+                    } elsif ($type eq 'Placement') {
+                        $enter_text = 'Enter placement test'; 
                     } else {
                         $enter_text = 'Enter course';
                     }
@@ -2299,6 +2335,8 @@
                     $r->print('<span class="LC_error">');
                     if ($type eq 'Community') {
                         $r->print(&mt('The community you selected is not a valid community in this domain'));
+                    } elsif ($type eq 'Placement') {
+                        $r->print(&mt('The course you selected is not a valid placement test in this domain'));
                     } else {
                         $r->print(&mt('The course you selected is not a valid course in this domain'));
                     }
Index: loncom/interface/lonrequestcourse.pm
diff -u loncom/interface/lonrequestcourse.pm:1.97 loncom/interface/lonrequestcourse.pm:1.98
--- loncom/interface/lonrequestcourse.pm:1.97	Mon Apr  4 01:07:17 2016
+++ loncom/interface/lonrequestcourse.pm	Mon Apr  4 01:09:48 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Request a course
 #
-# $Id: lonrequestcourse.pm,v 1.97 2016/04/04 01:07:17 raeburn Exp $
+# $Id: lonrequestcourse.pm,v 1.98 2016/04/04 01:09:48 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3168,6 +3168,8 @@
     my $type = 'Course';
     if ($crstype eq 'community') {
         $type = 'Community';
+    } elsif ($crstype eq 'placement') {
+        $type = 'Placement'; 
     }
     my %lt = &clone_text();
     my $output .= 


More information about the LON-CAPA-cvs mailing list