--- loncom/interface/lonmodifycourse.pm 2016/04/04 01:12:11 1.82 +++ loncom/interface/lonmodifycourse.pm 2016/07/24 14:34:59 1.84 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # handler for DC-only modifiable course settings # -# $Id: lonmodifycourse.pm,v 1.82 2016/04/04 01:12:11 raeburn Exp $ +# $Id: lonmodifycourse.pm,v 1.84 2016/07/24 14:34:59 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -41,7 +41,7 @@ use LONCAPA qw(:DEFAULT :match); sub get_dc_settable { my ($type,$cdom) = @_; - if (($type eq 'Community') || ($type eq 'Placement')) { + if ($type eq 'Community') { return ('courseowner','selfenrollmgrdc','selfenrollmgrcc'); } else { my @items = ('courseowner','coursecode','authtype','autharg','selfenrollmgrdc','selfenrollmgrcc'); @@ -55,7 +55,7 @@ sub get_dc_settable { sub autoenroll_keys { my $internals = ['coursecode','courseowner','authtype','autharg','defaultcredits', 'autoadds','autodrops','autostart','autoend','sectionnums', - 'crosslistings','co-owners']; + 'crosslistings','co-owners','autodropfailsafe']; my $accessdates = ['default_enrollment_start_date','default_enrollment_end_date']; return ($internals,$accessdates); } @@ -124,14 +124,13 @@ sub get_enrollment_settings { $enrollvar{$type} =~ s/,/, /g; } elsif ($type eq "authtype" || $type eq "autharg" || $type eq "coursecode" - || $type eq "crosslistings") { + || $type eq "crosslistings" || $type eq "selfenrollmgr" + || $type eq "autodropfailsafe") { $enrollvar{$type} = $settings{$item}; } elsif ($type eq 'defaultcredits') { if (&showcredits($cdom)) { $enrollvar{$type} = $settings{$item}; } - } elsif ($type eq 'selfenrollmgr') { - $enrollvar{$type} = $settings{$item}; } elsif ($type eq 'courseowner') { if ($settings{$item} =~ /^[^:]+:[^:]+$/) { $enrollvar{$type} = $settings{$item}; @@ -268,9 +267,7 @@ sub print_modification_menu { $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 ($type eq 'Placement') { - $setparams_text = 'View/Modify course owner and self-enrollment'; - } elsif (&showcredits($dom)) { + if (($type ne 'Placement') && (&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'; @@ -375,10 +372,6 @@ sub print_modification_menu { if ($type eq 'Community') { $menu_html .= '
'.$hidden_elements. 'print('this.form.submit();"'); } else { $r->print('javascript:verify_message(this.form);"'); @@ -1070,9 +1059,6 @@ sub modify_course { if ($type eq 'Community') { %changed = ( owner => 0 ); $ccrole = 'co'; - } elsif ($type eq 'Placement') { - %changed = ( owner => 0 ); - $ccrole = 'cc'; } else { %changed = ( code => 0, owner => 0, @@ -1125,7 +1111,7 @@ sub modify_course { } } - if (&showcredits($cdom) && exists($env{'form.defaultcredits'})) { + if (($type ne 'Placement') && (&showcredits($cdom) && exists($env{'form.defaultcredits'}))) { $newattr{'defaultcredits'} =~ s/[^\d\.]//g; $newattr{'defaultcredits'}=$env{'form.defaultcredits'}; } @@ -2144,6 +2130,7 @@ sub course_settings_descrip { 'sectionnums' => 'Course section number:LON-CAPA section', 'crosslistings' => 'Crosslisted class:LON-CAPA section', 'defaultcredits' => 'Credits', + 'autodropfailsafe' => "Failsafe section enrollment count", 'selfenrollmgrdc' => "Course-specific self-enrollment configuration by Domain Coordinator", 'selfenrollmgrcc' => "Course-specific self-enrollment configuration by Course personnel",