--- loncom/interface/lonmodifycourse.pm 2016/09/17 16:03:36 1.79.2.2
+++ loncom/interface/lonmodifycourse.pm 2016/04/06 17:41:52 1.83
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# handler for DC-only modifiable course settings
#
-# $Id: lonmodifycourse.pm,v 1.79.2.2 2016/09/17 16:03:36 raeburn Exp $
+# $Id: lonmodifycourse.pm,v 1.83 2016/04/06 17:41:52 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -44,8 +44,7 @@ sub get_dc_settable {
if ($type eq 'Community') {
return ('courseowner','selfenrollmgrdc','selfenrollmgrcc');
} else {
- my @items = ('courseowner','coursecode','authtype','autharg','selfenrollmgrdc',
- 'selfenrollmgrcc','mysqltables');
+ my @items = ('courseowner','coursecode','authtype','autharg','selfenrollmgrdc','selfenrollmgrcc');
if (&showcredits($cdom)) {
push(@items,'defaultcredits');
}
@@ -56,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','autodropfailsafe'];
+ 'crosslistings','co-owners'];
my $accessdates = ['default_enrollment_start_date','default_enrollment_end_date'];
return ($internals,$accessdates);
}
@@ -72,6 +71,13 @@ sub catalog_settable {
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');
@@ -118,13 +124,14 @@ sub get_enrollment_settings {
$enrollvar{$type} =~ s/,/, /g;
} elsif ($type eq "authtype"
|| $type eq "autharg" || $type eq "coursecode"
- || $type eq "crosslistings" || $type eq "selfenrollmgr"
-+ || $type eq "autodropfailsafe") {
+ || $type eq "crosslistings") {
$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};
@@ -167,6 +174,8 @@ sub print_course_search_page {
$r->print(&Apache::loncommon::js_changer());
if ($type eq 'Community') {
$r->print('
'.&mt('Search for a community in the [_1] domain',$domdesc).' ');
+ } elsif ($type eq 'Placement') {
+ $r->print(''.&mt('Search for a placement test in the [_1] domain',$domdesc).' ');
} else {
$r->print(''.&mt('Search for a course in the [_1] domain',$domdesc).' ');
}
@@ -178,6 +187,11 @@ sub print_course_search_page {
''.&mt('Enter the community with the role of [_1]',$cctitle).' '."\n".
''.&mt('View or modify community settings which only a [_1] may modify.',$dctitle).
' '."\n".'');
+ } elsif ($type eq 'Placement') {
+ $r->print(&mt('Actions available after searching for a placement test:').''.
+ ''.&mt('Enter the placement test with the role of [_1]',$cctitle).' '."\n".
+ ''.&mt('View or modify placement test settings which only a [_1] may modify.',$dctitle).
+ ' '."\n".' ');
} else {
$r->print(&mt('Actions available after searching for a course:').''.
''.&mt('Enter the course with the role of [_1]',$cctitle).' '."\n".
@@ -254,10 +268,10 @@ 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 (&showcredits($dom)) {
- $setparams_text = 'View/Modify course owner, institutional code, default authentication, credits, self-enrollment and table lifetime';
+ 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, self-enrollment and table lifetime';
+ $setparams_text = 'View/Modify course owner, institutional code, default authentication, and self-enrollment';
}
$cat_text = 'View/Modify catalog settings for course';
}
@@ -320,7 +334,7 @@ sub print_modification_menu {
{
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 => ''
@@ -362,13 +376,12 @@ sub print_modification_menu {
} else {
$menu_html .= ''.&mt('Course owner (permitted to assign Course Coordinator roles in the course).').' '."\n".
''.&mt("Institutional code and default authentication (both required for auto-enrollment of students from institutional datafeeds).").' '."\n";
- if (&showcredits($dom)) {
+ if (($type ne 'Placement') && &showcredits($dom)) {
$menu_html .= ''.&mt('Default credits earned by student on course completion.').' '."\n";
}
$menu_html .= ' '.&mt('Override defaults for who configures self-enrollment for this specific course.').' '."\n";
}
- $menu_html .= ''.$mysqltables_text.' '."\n".
- ''.$setquota_text.' '."\n".
+ $menu_html .= ''.$setquota_text.' '."\n".
''.$setuploadquota_text.' '."\n".
''.$anon_text.' '."\n".
''.$postsubmit_text.' '."\n";
@@ -635,7 +648,7 @@ sub domain_postsubtimeout {
my ($cdom,$type,$settings) = @_;
return unless (ref($settings) eq 'HASH');
my $lctype = lc($type);
- unless ($type eq 'Community') {
+ unless (($type eq 'Community') || ($type eq 'Placement')) {
$lctype = 'unofficial';
if ($settings->{'internal.coursecode'}) {
$lctype = 'official';
@@ -694,6 +707,8 @@ sub print_catsettings {
' '.&mt('Yes').' '.&mt('No').'');
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").':
'.
''.&mt('Auto-cataloging is enabled and the course is assigned an institutional code.').' '.
@@ -715,7 +730,7 @@ sub print_catsettings {
} else {
$r->print(&mt('No categories defined for this domain'));
}
- unless ($type eq 'Community') {
+ unless (($type eq 'Community') || ($type eq 'Placement')) {
$r->print(''.&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).').'
');
}
}
@@ -754,8 +769,8 @@ sub print_course_modification_page {
my ($ownertable,$ccrole,$javascript_validations,$authenitems,$ccname);
my %enrollvar = &get_enrollment_settings($cdom,$cnum);
my %settings = &Apache::lonnet::get('environment',['internal.coursecode','internal.textbook',
- 'internal.selfenrollmgrdc','internal.selfenrollmgrcc',
- 'internal.mysqltables'],$cdom,$cnum);
+ 'internal.selfenrollmgrdc','internal.selfenrollmgrcc'],
+ $cdom,$cnum);
my $type = &Apache::lonuserutils::get_extended_type($cdom,$cnum,$crstype,\%settings);
my @specific_managebydc = split(/,/,$settings{'internal.selfenrollmgrdc'});
my @specific_managebycc = split(/,/,$settings{'internal.selfenrollmgrcc'});
@@ -838,21 +853,21 @@ sub print_course_modification_page {
' '.&mt('Course Code'))."\n".
' '.
&Apache::lonhtmlcommon::row_closure());
- if (&showcredits($cdom)) {
+ if (($crstype eq 'Course') && (&showcredits($cdom))) {
$r->print(&Apache::lonhtmlcommon::row_title(
&Apache::loncommon::help_open_topic('Modify_Course_Credithours').
' '.&mt('Credits (students)'))."\n".
' '.
&Apache::lonhtmlcommon::row_closure());
- }
- $r->print(&Apache::lonhtmlcommon::row_title(
- &Apache::loncommon::help_open_topic('Modify_Course_Defaultauth').
- ' '.&mt('Default Authentication method'))."\n".
- $authenitems."\n".
- &Apache::lonhtmlcommon::row_closure().
- &Apache::lonhtmlcommon::row_title(
- &Apache::loncommon::help_open_topic('Modify_Course_Owner').
- ' '.&mt('Course Owner'))."\n");
+ }
+ $r->print(&Apache::lonhtmlcommon::row_title(
+ &Apache::loncommon::help_open_topic('Modify_Course_Defaultauth').
+ ' '.&mt('Default Authentication method'))."\n".
+ $authenitems."\n".
+ &Apache::lonhtmlcommon::row_closure().
+ &Apache::lonhtmlcommon::row_title(
+ &Apache::loncommon::help_open_topic('Modify_Course_Owner').
+ ' '.&mt('Course Owner'))."\n");
}
my ($cctitle,$rolename,$currmanages,$ccchecked,$dcchecked,$defaultchecked);
my ($selfenrollrows,$selfenrolltitles) = &Apache::lonuserutils::get_selfenroll_titles();
@@ -903,12 +918,7 @@ sub print_course_modification_page {
&Apache::loncommon::end_data_table_row()."\n");
}
$r->print(&Apache::loncommon::end_data_table()."\n".
- ' '.&Apache::lonhtmlcommon::row_closure().
- &Apache::lonhtmlcommon::row_title(
- &Apache::loncommon::help_open_topic('Modify_Course_Table_Lifetime').
- ' '.&mt('"Temporary" Tables Lifetime (s)'))."\n".
- ' '.
- &Apache::lonhtmlcommon::row_closure(1).
+ ' '.&Apache::lonhtmlcommon::row_closure(1).
&Apache::lonhtmlcommon::end_pick_box().''.$hidden_elements.
' ';
} else {
@@ -1211,13 +1216,11 @@ sub modify_course {
$shown = &selfenroll_config_status(\@currmgrcc,$selfenrolltitles);
} elsif (($attr eq 'defaultcredits') && ($shown eq '')) {
$shown = &mt('None');
- } elsif (($attr eq 'mysqltables') && ($shown eq '')) {
- $shown = &mt('domain default');
}
$nochgresponse .= '
'.&mt('[_1] still set to: [_2]',$longtype{$attr},$shown).' ';
}
}
- 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.').
' '.&mt('If automated enrollment at your institution requires validation of course owners, automated enrollment will fail.'));
@@ -1284,8 +1287,6 @@ sub modify_course {
$shown = &selfenroll_config_status(\@currmgrcc,$selfenrolltitles);
} elsif (($attr eq 'defaultcredits') && ($shown eq '')) {
$shown = &mt('None');
- } elsif (($attr eq 'mysqltables') && ($shown eq '')) {
- $shown = &mt('domain default');
}
$nochgresponse .= ''.&mt('[_1] still set to: [_2]',$longtype{$attr},$shown).' ';
}
@@ -2056,6 +2057,8 @@ ENDSCRIPT
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';
}
@@ -2128,10 +2131,8 @@ 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",
- 'mysqltables' => '"Temporary" student performance tables lifetime (seconds)',
);
}
@@ -2145,7 +2146,7 @@ sub hidden_form_elements {
'locarg','krbarg','krbver','counter','hidefromcat','usecategory',
'threshold','postsubmit','postsubtimeout','defaultcredits','uploadquota',
'selfenrollmgrdc','selfenrollmgrcc','action','state','currsec_st',
- 'sections','newsec','mysqltables'],['^selfenrollmgr_','^selfenroll_'])."\n".
+ 'sections','newsec'],['^selfenrollmgr_'])."\n".
' ';
return $hidden_elements;
}
@@ -2196,6 +2197,8 @@ sub handler {
}
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";
}
@@ -2212,6 +2215,8 @@ sub handler {
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';
}
@@ -2316,6 +2321,8 @@ sub handler {
$r->print('');
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'));
}