--- loncom/interface/lonmodifycourse.pm 2015/03/23 13:03:32 1.76
+++ loncom/interface/lonmodifycourse.pm 2016/09/17 16:03:36 1.79.2.2
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# handler for DC-only modifiable course settings
#
-# $Id: lonmodifycourse.pm,v 1.76 2015/03/23 13:03:32 droeschl Exp $
+# $Id: lonmodifycourse.pm,v 1.79.2.2 2016/09/17 16:03:36 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -44,7 +44,8 @@ sub get_dc_settable {
if ($type eq 'Community') {
return ('courseowner','selfenrollmgrdc','selfenrollmgrcc');
} else {
- my @items = ('courseowner','coursecode','authtype','autharg','selfenrollmgrdc','selfenrollmgrcc');
+ my @items = ('courseowner','coursecode','authtype','autharg','selfenrollmgrdc',
+ 'selfenrollmgrcc','mysqltables');
if (&showcredits($cdom)) {
push(@items,'defaultcredits');
}
@@ -55,7 +56,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);
}
@@ -117,14 +118,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};
@@ -208,7 +208,7 @@ sub print_course_selection_page {
my %courses = &Apache::loncommon::search_courses($dom,$type,$filter,$numtitles,
undef,undef,undef,\@codetitles);
&Apache::lonpickcourse::display_matched_courses($r,$type,0,$action,undef,undef,undef,
- %courses);
+ undef,undef,%courses);
return;
}
@@ -255,9 +255,9 @@ sub print_modification_menu {
$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, and self-enrollment';
+ $setparams_text = 'View/Modify course owner, institutional code, default authentication, credits, self-enrollment and table lifetime';
} else {
- $setparams_text = 'View/Modify course owner, institutional code, default authentication, and self-enrollment';
+ $setparams_text = 'View/Modify course owner, institutional code, default authentication, self-enrollment and table lifetime';
}
$cat_text = 'View/Modify catalog settings for course';
}
@@ -367,7 +367,8 @@ sub print_modification_menu {
}
$menu_html .= '
'.&mt('Override defaults for who configures self-enrollment for this specific course.').''."\n";
}
- $menu_html .= ''.$setquota_text.''."\n".
+ $menu_html .= ''.$mysqltables_text.''."\n".
+ ''.$setquota_text.''."\n".
''.$setuploadquota_text.''."\n".
''.$anon_text.''."\n".
''.$postsubmit_text.''."\n";
@@ -753,8 +754,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'],
- $cdom,$cnum);
+ 'internal.selfenrollmgrdc','internal.selfenrollmgrcc',
+ 'internal.mysqltables'],$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'});
@@ -902,7 +903,12 @@ sub print_course_modification_page {
&Apache::loncommon::end_data_table_row()."\n");
}
$r->print(&Apache::loncommon::end_data_table()."\n".
- '
'.&Apache::lonhtmlcommon::row_closure(1).
+ '
'.&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::end_pick_box().''.$hidden_elements.
'';
} else {
@@ -1200,6 +1211,8 @@ 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).'';
}
@@ -1271,6 +1284,8 @@ 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).'';
}
@@ -1901,6 +1916,8 @@ function hide_searching() {
} elsif ($phase eq 'setquota') {
my $invalid = &mt('The quota you entered contained invalid characters.');
my $alert = &mt('You must enter a number');
+ &js_escape(\$invalid);
+ &js_escape(\$alert);
my $regexp = '/^\s*(\d+\.?\d*|\.\d+)\s*$/';
$js .= <<"ENDSCRIPT";
@@ -1920,6 +1937,8 @@ ENDSCRIPT
} elsif ($phase eq 'setanon') {
my $invalid = &mt('The responder threshold you entered is invalid.');
my $alert = &mt('You must enter a positive integer.');
+ &js_escape(\$invalid);
+ &js_escape(\$alert);
my $regexp = ' /^\s*\d+\s*$/';
$js .= <<"ENDSCRIPT";
@@ -1945,6 +1964,9 @@ ENDSCRIPT
my $invalid = &mt('The choice entered for disabling the submit button is invalid.');
my $invalidtimeout = &mt('The timeout you entered for disabling the submit button is invalid.');
my $alert = &mt('Enter one of: a positive integer, 0 (for no timeout), or leave blank to use domain default');
+ &js_escape(\$invalid);
+ &js_escape(\$invalidtimeout);
+ &js_escape(\$alert);
my $regexp = ' /^\s*\d+\s*$/';
$js .= <<"ENDSCRIPT";
@@ -2106,8 +2128,10 @@ 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)',
);
}
@@ -2121,7 +2145,7 @@ sub hidden_form_elements {
'locarg','krbarg','krbver','counter','hidefromcat','usecategory',
'threshold','postsubmit','postsubtimeout','defaultcredits','uploadquota',
'selfenrollmgrdc','selfenrollmgrcc','action','state','currsec_st',
- 'sections','newsec'],['^selfenrollmgr_'])."\n".
+ 'sections','newsec','mysqltables'],['^selfenrollmgr_','^selfenroll_'])."\n".
'';
return $hidden_elements;
}
@@ -2129,7 +2153,7 @@ sub hidden_form_elements {
sub showcredits {
my ($dom) = @_;
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom);
- if ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'} || $domdefaults{'textbokcredits'}) {
+ if ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'} || $domdefaults{'textbookcredits'}) {
return 1;
}
}